Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Mount / unmount external drive for Backup use' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mount / unmount external drive for Backup use
Authored by: ssevenup on Mar 16, '07 09:42:06AM
I have been working on an rsync script and I believe you will find that the device name will change depending on the circumstances. We have automount to thank for that. I am not yet mounting/unmounting my disk but I am using `/usr/sbin/diskutil info /Volumes/ROCSTOR | grep UUID | awk '{print $2}' | grep xxxx-xxxxxx-xxxxxx-xxxxxx` to verify the script only runs when the exact disk volume needed is there. I found that without a good sanity check rsync would mirror my directory back onto the local disk in "/Volumes" because automount sometimes leaves a directory behind after the volume is unmounted. And if that happens at the same time another device is using the same device name you have a problem. So I look for the disk UUID, and that the target directory is present. I will probably be adding mount/unmount at some point. More importantly, I need a "busy" UI that a) informs when the sync is running and b) allows one to interrupt when needed. Unmounting between syncs also allows the user to yank the firewire (or USB) cable without ejecting the disk. This lessens the likelihood of disk corruption.

---
Mark Moorcroft
ELORET Corp. - NASA/Ames RC
Sys. Admin.

[ Reply to This | # ]