Ever seen this notification before? It's pretty scary when it's on a 3TB disk with your latest family photos and home movies. Like any sane person, I did have backups of the data on the disk but it was about a month out of date, because of some office reorganization I've been slow to work on.
Prior to receiving this warning, for probably about a year, I had been receiving a lot of these notifications:
Prior to receiving this warning, for probably about a year, I had been receiving a lot of these notifications:
That notification scared me for a while because I know that if a disk is unmounted in the middle of a write, some pointers can get skewed and corrupt the data. But when I saw this notification when I would sit down at the Mac, all the drives would be mounted and Time Machine would run fine, etc. It happened over and over, but nothing bad seemed to happen so I shrugged it off and went on with my life.
A couple weeks ago, I started doing some transfers of photos on the hard drive and it just suddenly started bogging down to a crawl. I unmounted the drive and remounted it to find the "Mac can't repair the disk" message. I tried to just use Drag and Drop in finder to back up some of the files, but Finder would complain of not being able to read some files and abort the entire copy. I know some of the files still have to be good in those 2.6TB of data.
I wondered if I could blame on the reoccurring "Disk Not Ejected Properly" (DNEP) issue. I found a very lengthy discussion on Apple's discussion forums about the issue. What I found in my case was that I had too much power usage going on in my home office. I have mini fridge in my office and discovered that when it kicks on is when I see the DNEP message. I unplugged the fridge and haven't seen it since. So I guess I'll be moving my fridge to the garage.
Nonetheless, I would really like to get those files back. I resorted to good old `rsync` to transfer what could be read from the corrupted disk.
A couple weeks ago, I started doing some transfers of photos on the hard drive and it just suddenly started bogging down to a crawl. I unmounted the drive and remounted it to find the "Mac can't repair the disk" message. I tried to just use Drag and Drop in finder to back up some of the files, but Finder would complain of not being able to read some files and abort the entire copy. I know some of the files still have to be good in those 2.6TB of data.
I wondered if I could blame on the reoccurring "Disk Not Ejected Properly" (DNEP) issue. I found a very lengthy discussion on Apple's discussion forums about the issue. What I found in my case was that I had too much power usage going on in my home office. I have mini fridge in my office and discovered that when it kicks on is when I see the DNEP message. I unplugged the fridge and haven't seen it since. So I guess I'll be moving my fridge to the garage.
Nonetheless, I would really like to get those files back. I resorted to good old `rsync` to transfer what could be read from the corrupted disk.
$ rsync -ah --progress /Volumes/HD1/Photos /Volumes/HD2/
This tells rsync to copy the photos directory to HD2 (your other hard drive). The options I used are
Now maybe you already have a lot of the files from HD1 on HD2 (as I did), to only copy new files you can use the `--ignore-existing` option. Also, including the slash at the end of the path on the source will copy the contents of the directory and including the slash at the end of the path on the destination directory will copy into the directory.
- -a :: archive mode: a full recursive backup of the folder and its subfolders including some metadata details like modified time and permissions.
- -h :: human-readable: if you have progress output, the transfer info will be "human readable" like in terms of MB or GB.
- --progress :: shows the progress as it works its way through each file.
Now maybe you already have a lot of the files from HD1 on HD2 (as I did), to only copy new files you can use the `--ignore-existing` option. Also, including the slash at the end of the path on the source will copy the contents of the directory and including the slash at the end of the path on the destination directory will copy into the directory.
$ rsync -ah --progress --ignore-existing /Volumes/HD1/Photos/ /Volumes/HD2/Photos/
Maybe you have a couple directories you'd like to copy at once. You can actually list multiple sources. Before doing something like this, it might be wise to do a `dry run` to get a peek at what will be done with this command without actually moving any files.
$ rsync -ah --progress --ignore-existing --dry-run /Volumes/HD1/Photos /Volumes/HD1/Home_Videos /Volumes/HD1/Sound_FX /Volumes/HD2/
This will show you that it is going to copy the Photos, Home_Videos, and Sound_FX directories from HD1 to HD2. And to fully commit and move the files from HD1 to HD2, just remove the `--dry-run` option.
$ rsync -ah --progress --ignore-existing /Volumes/HD1/Photos /Volumes/HD1/Home_Videos /Volumes/HD1/Sound_FX /Volumes/HD2/
Finally, while rsync runs, your system should stay active. But while I was still having the DNEP error, my rsync would be cut short when the disk would lose connection and after some time, my Mac would go to sleep. I wanted to keep the system active while rsync did the transfers, so I found a nifty tool called `caffeinate`. You can tie caffeinate to a process to prevent the system, display, and disks from sleeping while the process is executing. Just prepend the caffeinate call to the rsync process and your system should stay active until the transfer is completed.
$ caffeinate -ims rsync -ah --progress --ignore-existing /Volumes/HD1/Photos /Volumes/HD1/Home_Videos /Volumes/HD1/Sound_FX /Volumes/HD2/
The caffeinate options I used are:
I also found that after these long data transfers, if I were to print out the time the process finished I could see how long it's been done just for peace of mind in my estimations. This can be done with any command line process by appending `&& Date` to the end of the command. So the last command would become:
- -i :: prevents idle sleep
- -m :: prevents disks from sleep
- -s :: prevents system sleep (requires AC power)
I also found that after these long data transfers, if I were to print out the time the process finished I could see how long it's been done just for peace of mind in my estimations. This can be done with any command line process by appending `&& Date` to the end of the command. So the last command would become:
$ caffeinate -ims rsync -ah --progress --ignore-existing /Volumes/HD1/Photos /Volumes/HD1/Home_Videos /Volumes/HD1/Sound_FX /Volumes/HD2/ && Date