Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Mount USB Memory Sticks in single user mode' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mount USB Memory Sticks in single user mode
Authored by: abeness on Nov 17, '10 07:22:08PM

An update for 10.5.x: Whether you plug the drive in before booting to single-user mode or after, the drive doesn't seem to show up in /dev here. It DOES in 10.6.x.

What worked for me in 10.5.8 was to load kernel extensions after plugging in the drive:

mount -uw /
launchctl load /System/Library/LaunchDaemons/

[WAIT approx 30 seconds: various log messages scroll by; after the "kernel link data" error re: /var/run/mach.sym existing already, I continued:]

mkdir /Volumes/usb
mount -t msdos -v /dev/disk1s1 /Volumes/usb

This was on a MacBook with no other disks present, so disk0 was the internal HDD, and I had already determined that disk1 was the flash drive. disk1s1 was the single MS-DOS FAT16 data partition on that drive; hence the "-t msdos" parameter, above. Refer to the man page for mount for other options relevant to other file systems.

If you're on a system with multiple internal disks, you may want to review the disks present in /dev before loading the kexts:

ls /dev/disk*

Then load the kexts as above, then rerun

ls /dev/disk*

and compare to learn the disk ID of your flash (or other) drive.

Note also that the "root" of each physical disk appears as disk0, disk1, disk2, etc. Those entries are not mountable or accessible. They are the command-line designation of the top-most entry of a disk as listed in Disk Utility's GUI, beneath which the disks data partitions are displayed. Data partitions are labeled e.g. disk0s1, disk0s2, disk1s1, etc.

One more note: you can in fact continue typing your command despite being interrupted by new log messages that crop up (e.g. diskarb errors). It can be tough to keep track of where you are in your command, but if you continue to type it correctly, it will execute.

In 10.6.x, if the drive is connected prior to booting into single-user mode, you need only mount it as usual ("mkdir" and "mount" lines, above, modified to reflect the ID of your drive).

An aside: the reason I wanted to mount a flash drive here was to be able to run a shell script that reset a clean install after initial setup/login/updates back to "out-of-box" no-users, Apple Setup Assistant state. See my comment to "10.5: How to reset Leopard back to the setup assistant" here: (can't seem to pin down the link: code syntax, sorry!).


[ Reply to This | # ]