[Bglug] Mac2Lin Part 1 - freeing my files
Andrew Howlett
andrew at howlett.net
Wed Jul 27 22:44:53 EDT 2016
warning - this part is all about mac os x, so you might want to skip it.
My macbook died. At first I thought the hard drive had crashed, so I
tried putting another hard drive in my mac - didn't work. Tried putting
my hard drive in my daughter's macbook (same model) - sorta worked. My
daughter's macbook would boot, ask for my password, start loading the
operating system, then turn itself off. I suspect some system files had
been corrupted. So could not boot this drive using the normal procedure
even on a good Mac.
Now normally i could connect the macbook's HD to my linux server using a
USB dock, mount the HFS+ filesystem and read all my macbook files off
the drive. Linux works great with HFS+. But I had done something very
dumb. I had enabled Macbook File Vault encryption. This is a proprietary
disc encryption used by apple to secure their hard drives. Only a mac
can decrypt it. If I can't boot from the drive on Apple hardware, then
the only option would be to restore from a Time Machine backup which is
about two weeks old. I don't want to lose two weeks of work. So I need
to find a way to boot this drive in a Mac.
I tried to boot my daughter's macbook with my hard drive in single user
mode. This is accomplished by holding down the CMD and S keys when the
macbook "chimes" on boot. (The CMD key is like the windows key on a
Mac.) I got the GUI screen asking me to login, which actually happens
before the mac mounts the encrypted filesystem. Entered username and
password. The macbook switched back into text mode, booted up and i'm
looking at a text console on the macbook, like booting linux in text mode.
Operating mac os x from the command line is just like linux. Actually,
it is just like BSD because mac is based on bsd. Macbooks are VERY gui.
So it feels strange to do stuff CLI on macbook using commands like
mount. Also, important system directories are not in the PATH, so need
to change to use full path. First, by default single user mode mounts
the root filesystem as read only, so have to change to read/write:
/sbin/mount -uw /
next make a directory for a mount point
mkdir /Volumes/usb
then mount the usb-dock with external hard drive
/sbin/mount_hfs /dev/disk2s1 /Volumes/usb
and now rsync the plaintext files to an unencrypted hfs+ filesystem on
the external drive
rsync -av /* /Volumes/usb
It took seven and a half hours to copy 800GB of files to the external
drive. When it was done I was free of the macbook.
More information about the Group
mailing list