How do I access files, copy them on an external hard drive, and see them on it?
-
31-05-2021 - |
Question
I'm trying to recover the password of an old iMac, couldn’t boot to Recovery though. So I went into single user mode to access the files, which worked. I have an external hard drive that is formatted as Mac OS Extended (Journaled) to put the files I'm looking for on the iMac into the drive. I copied them and I went to my computer to access it. But now my drive isn't mounting!
When I did the copy I ran the command cp <file> /dev/disk1s2
. When I try to mount it on the other computer to see the files, I tried mounting it through the command line with diskutil mountDisk /dev/disk2
and diskutil mount /dev/disk2s2
. Both commands gave me an error saying that the disk failed to mount. I also tried mounting it through Disk Utility but nothing happens.
I need those files because it contains the password of the computer. How am I going to see the files?
Solution
Your cp
destroyed whatever filesystem there was on the external disk because you copied to the device itself without mounting it first. To fix:
- format the external disk on the other Mac (HFS+ should be fine)
- boot old Mac into single user
- mount the external disk (
mkdir /Volumes/mydisk; mount /dev/disk1s2 /Volumes/mydisk
) - copy the files to the mounted disk (
cp files /Volumes/mydisk/
) - unmount disk before unplugging (
umount /Volumes/mydisk
)
OTHER TIPS
I'd recommend using target disk mode to copy the files to a location that's available on your working computer, eg. a properly formatted & mounted external drive.