- Start in Single User Mode by holding down Command-S when starting the Mac.
- Commands can also be typed via Terminal app when OS X is running.
See also: https://support.apple.com/en-us/HT201573
More tips: http://www.tekrevue.com/tip/mac-startup-options/
- Type
diskutil list
to view available drives - Type
diskutil mount /dev/disk1s2
(Disk 1, Partition Scheme 2 - may be different on your Mac) to gain read/write access on that disk. - Type
cd /Volumes
to switch current folder to Volumes where Mac OS lists all mounted drives. - Type
ls
to list contents of Volumes folder. - Type
mkdir
to create a new folder (on the USB drive) - The
cp -a
command copies files/folders from one path to another.
Start in Single-User Mode by holding Command-S as mentioned above
You type -> diskutil list
/dev/disk0
(Physical Disk #1: Macintosh HD)
TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 120.5 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
(Physical Disk #2: PIZZA_PIZZA_256GB)
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *256.0 GB disk1
1: EFI 209.7 MB disk1s1
2: Apple_HFS PIZZA_PIZZA_256GB 255.7 GB disk1s
You type -> diskutil mount /dev/disk1s2
Volume PIZZA_PIZZA_256GB on disk1 mounted
You type -> cd /Volumes
/Volumes 13:05:47
You type -> ls
Macintosh HD PIZZA_PIZZA_256GB Recovery Disk Assistant
You type -> cd /Volumes/PIZZA_PIZZA_256GB
You type -> mkdir RecoveredFiles
You type -> cd RecoveredFiles
You type -> cp -a ~/Photos Photos
/Volumes/PIZZA_PIZZA_256GB/RecoveredFiles 13:07:20
Which should copy the entire Mac Photos folder to /Volumes/PIZZA_PIZZA_256GB/RecoveredFiles/Photos
- An empty line after running the
cp
command indicates success - Copy folder and contained files together using
cp -a /Source/FolderName /Destination/FolderName
- Copy single files without the -a using
cp /Source/file.jpg /Destination/file.jpg
- ~/Photos is the same as /Users/alex/Photos
You type -> cp ~/Photos/myphoto.jpg Photos/myphoto.jpg
You type -> cp -a ~/Documents /Volumes/PIZZA_PIZZA_256GB/RecoveredFiles/Documents
You type -> cp -a ~/Desktop /Volumes/PIZZA_PIZZA_256GB/RecoveredFiles/Desktop
You type -> reboot
Mac will reboot normally
This is great to know! Thanks!
I need to backup a Mac that failed to update from the terminal in Recovery mode (cmd+R) and now I know how to do it!