I use a usb 1Tb hard driver for backups. I have three of them and I have one one site (two weeks old) for the next backup, one off site (one week old), and one in the system (current back drive). I have mounted this drive at /mnt/backup. Since all drives had different uuid's and sometimes the /dev/sd number changes, how do I get these devices to automount suing a shell script. My problem is I have to manually mount the drive every time I replace the drive. If it could be automounted some way the backup script could check to see if it was mounted and if it is not mounted it could mount it and finish the backup. As it is now if the mount is not there my scrip exits (due to filling up the / partition) and the backup needs to be run manually when I am in the office. Ubuntu 10.10 Server.
Add all 3 UUIDs to
/etc/fstab, and have them all mount to the same folder. This way, regardless of which device you plug in, they will all auto-mount to the same folder.
An alternate route is to use the
e2label utility to "label" the devices, example:
e2label /dev/sdc1 /LABELNAME. Make sure you use the same label name for all 3 devices.
Use an fstab similar to this:
LABEL=/BACKUP /mnt/backup ext3 defaults