Saturday, 1 April 2006

Command line target mode



You really do learn something new every day. Today, it was that EFI Macs can be set from the command line to boot into FireWire target mode on their next reboot (Open Firmware macs can do it, too, but it's more complicated). Nifty. Why would you want to do this? A couple of reaso . One, if you, like me, tend to be doing two, or three, or ten, things at once, holding down keys at startup can be a pain. I often hit 'reboot,' figure I have enough time to finish off a task on another machine, get caught up in the new task, and mi the window of o ortunity to start the first machine in target disk mode, switch the startup disk, or whatever it was I wanted to reboot for. with the command line, it's "no mu , no fu ," just:

sudo nvram target-mode=1

That will set the machine to boot in target disk mode at it's next start-up. It only works for the next start-up, and can't be u et. That's a actually a bit of a pain: habitual command line users expect that '1' will toggle a behavior, and '0' will untoggle it, but that i 't the case here. Any value, even zero will work.

Another potential use is for a disk you su ect is corrupt, or to u tick a frozen system. Often, you can h in from another machine (a uming you have remote login turned on) even when finder crashes and a machine a ears to be frozen. Just toggle target mode, i ue a quick sudo shutdown -r now, and you can plug the offending machine into another computer and run your diagnostics. That, and it's a cool party trick.

Thanks to Matt for pointing this out.

No comments:

Post a Comment