Even when you keep daily backups your MAC might freeze at a time when the last important file has not been backed up. You should not reinstall the OS before making sure you have a backup. How to proceed? The easiest way (for the geek ?) would be:
- Restart in single mode (turn off, turn on and press "Command+S").
- When the prompt appears connect the external USB drive.
- Look for available disk drives. Most likely it will be the last one listed. In my case I had the internal drive, a USB stick and an external USB hard drive:
# ls -l /dev/disk*
...
/dev/disk2s2
- Now let us find the file system type. In my case it is a MAC Hierarchical File System (HFS)
# fstyp /dev/disk2s2
hfs
- To mount the drive we need write permissions. That is why we run the first command below. Needless to say you need to be careful from now on ...
# mount -uw /
# mkdir /extdrive
# mount -t hfs /dev/disk2s2 /extdrive
- Backup what you need. For examplehere are some directories I backed up today:
# cp -pr /Users/nestor/Downloads /extdrive/
# cp -pr /Users/nestor/Documents /extdrive/
# cp -pr /Users/nestor/Pictures /extdrive/
# cp -pr /Users/nestor/Movies /extdrive/
# cp -pr /Users/nestor/Desktop /extdrive/
# cp -pr /Users/nestor/Library/Mail /extdrive/
- Unmount and shutdown (or restart):
# umount /extdrive/
# shutdown -h now
Bootable OSX USB Drive
If you do not have an OSX bootable USB drive you will need to make one from a healthy MAC:
- From the App Store search and download OS X. When you get to the below screen do not interact with it, that way the installer remains in the Applications directory. Just move on to the next step.
- Format a USB drive from "Disk Utility" using option "MAC OSX Extended (Journaled)" which will format the drive using HFS. Do not bother changing the name as it will be changed anyway as part of the below step.
- Run the below from Terminal (assuming the USB was formatted using the default 'untitled' name. Note that the command below corresponds to Mavericks. You probably will have to deal with a different version like El Capitan (/Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia) :
$ sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
Erasing Disk: 0%... 10%... 20%... 30%...100%...
Copying installer files to disk...
Copy complete.
Making disk bootable...
Copying boot files...
Copy complete.
Done.
Reinstall OS X
-
Turn off the target MAC, insert the Bootable OSX USB Drive, turn on keeping the Option key pressed to be able to select from where to boot. BTW click here for more OSX startup options.
- From the options choose Disk Utility and select the "Macintouch HD". Click on Verify and if needed click on Repair Disk after. This is a crucial step. Errors like "this disk is lock" will be avoided later on. If the disk is damaged there is no need to keep trying as a replacement most likely will be needed.
- WARNING: This step erase the whole disk so I assume you have a backup or this is a blank disk. Just click on Erase and select as format "MAC OS Extended (Case-sensitive, journaled)". You might want to pick the "MAC OS Extended (Case-sensitive, journaled, Encrypted)" option. Conform you want to "Erase"
- NOw that the disk is formatted go to the menu and close the Disk Utility. Click on Install OSX, select the disk and continue with the installation. After some minutes your new OSX will be ready.
4 comments:
I tried this and everything worked nicely until I got to my Downloads directory. I forgot the exact line but it was something about running out of room. Perhaps some of my download files were too big? Why do you backup downloads when most things can be re-downloaded later.
Side note: I have the grey/white screen of death (27 inch iMac circa January 2012). After the Apple logo and spinner appears, I get the white screen. I tried all the options I read about online (Command R and also the method to go wireless) and nothing works. But hard drive seems fine as I have been able to access everything so far.
Hi Greg, some people like me just download and work directly on the Downloads directory which means I also clean it up frequently. But you are right that most of the time it is not necessary to backup that directory so go ahead and skip it. After you have your backup then just wipe out the OS from the bootable USB and reinstall the OS.
Hi Nestor,
You may want to include the -p option in your cp command. It "preserve(s) the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions. Access Control Lists (ACLs) and Extended Attributes (EAs), including resource forks, will also be preserved."
Aloha,
Miles
@Miles Thanks. Updated.
Post a Comment