How do I copy files from various locations to a USB flash drive in Single User Mode?

Hi,

I'm currently sitting in Single User Mode and would like to copy some important files to a flash drive. I suppose my question is more about how I actually locate or copy files to said drive. When I insert the drive I get notification of a USBMSC Indentifier (non-unique): 070B54A355.... on-screen, but when I navigate to Volumes, the drive doesn't appear, so I'm not sure what's going on. I'd like to copy files using cp or ditto, but it doesn't look like the drive is there to use as a destination. Can anyone help?

MacBook Pro, OS X Mountain Lion (10.8.3)

Posted on Sep 6, 2015 5:40 AM

Reply
9 replies
Sort By: 

Sep 6, 2015 2:39 PM in response to Eric Root

I'm unable to boot normally or in safe mode. When I try either method, the progress bar and pinwheel appear for a while, but once the progress bar reaches about halfway, the system just shuts down. I've also tried repairing the disk in Recovery Mode, but I get a message telling me it's not possible. Verbose mode comes up with a couple of pages of missing threads, which is probably the reason why. The only option I see left open to me is to try and copy the most important files onto a flash drive if I can - hence Single User Mode being my last resort. The friend I'm trying to help (no, it's not me 🙂) didn't back up their files.

Reply

Sep 6, 2015 2:53 PM in response to BobHarris

Ok, I'll have a look through the Terminal commands regarding mount and mkdir. Where or how would I find out the name of the /dev/disk? Would it be the long identifier I mentioned earlier which appears when I plug in the flash drive - i.e. USBMSC Indentifier (non-unique): 070B54A355.... or should I try using the text name that appears when I plug it into my own computer?

Reply

Sep 6, 2015 6:00 PM in response to mikael71

It will be /dev/disk<1,2,3,4,5,etc...> s <1,2,3,4,etc...>


The first number will depend on how the internal disk is configured.


where 's' stands for 'slice' or in this case the partition, and the last number is the partition.

/bin/ls /dev/

will tell you want disks are visible.

/usr/sbin/diskutil list

might tell you something (but I'm not in Single User mode, so I'm not sure)


You may just have to try mounting the different /dev/disk<n>s<m> values and see if that works, and then use the "/bin/ls /mountpoint_directory" to see what is there and if it looks like it might be the USB drive. If the mount is not what you exptect, then you use the "sbin/umount /mountpoint_directory" to un-mount and then try another /dev/disk<n>s<m>


Best guess would be /dev/disk2s2, but it could be /dev/disk3s2, or some other combination of numbers. You will have to experiment.

Reply

Sep 8, 2015 9:44 AM in response to BobHarris

Hmm, I tried using /dev/diskmsn on all the disks listed by /bin/ls /dev/, but I keep getting a message saying "permission denied". The list is quite long, but the rest all have names such as ttyve rather than diskmsn. I also tried on the listed rdisks, though without success. The flash drive isn't locked, so if it's among those listed, I can't see why permission would be denied. I'm pretty stuck.

Reply

Sep 8, 2015 1:02 PM in response to mikael71

Are you really in single user mode? Because Single User mode is root and totally privileged.


Then again, is the mount giving you an error the the mkdir? The boot file system in Single User mode is read only, so it would not allow a mkdir.


What does the 'mount' command with no arguments say?


If the boot file system is read only, then you could try the command


/sbin/mount -wu /


ONLY /dev/disknsm are valid.


tty and pty are terminal interfaces. rdisknsm are RAW disk interfaces, which is not what you want because mounted file system needs the block interface (/dev/disk...). And all the others are special purpose interfaces.


You could try prefixing the mount command with sudo, but if that works, then I'm wondering what mode you are really in?

Reply

Sep 9, 2015 5:53 AM in response to BobHarris

As far as I'm aware, I'm in Single User Mode: CMD + S at boot. Anyway, I managed to get a bit further. I verified that the flash drive is called disk1s1 by using ls -l /dev/disk* to give me a list of available disks and fstyp /dev/disk1s1, which confirmed it was MSDOS. I tried repairing the disk several times using /sbin/fsck -fy without success. At this point, realising I still had no write persmissions and with disk still not verified as OK, I tried to mount anyway (probably not a good idea in hindsight) using /sbin/mount -uw / which deleted some orphaned files and folders. After exiting, I found I was able to boot to the login page. Now I only need the password from the familiy member of the friend I'm helping and I'll be able to find and transfer his files and set about either repairing the disk or doing a reinstall. Thanks for all your help. I'll post again, should I run into any further trouble.

Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I copy files from various locations to a USB flash drive in Single User Mode?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.