How to access files, copy them on an external hard drive, and see them on it

disk-utilitymountsingle-userterminal

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?

Best Answer

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)
Related Question