Thursday, March 8, 2007

Mount Gigabyte

I'm using an external USB disk as the backup storage device for bacula. As usual, setting it up seemed easy enough at first, but got complicated later: after all, all I needed to do was connect the drive, and let hotplugging magic take over...

This didn't quite work - the file system on the disk is FAT32 and auto-mounting it meant that the user bacula was not permitted to access the disk. I needed to manually specify an entry for the disk in /etc/fstab as follows:

This fixed the permissions issue, but caused two other problems. The most obvious problem was that the disk failed to mount during start up. Adding the noauto option to the mount options, and the following lines to do_start in /etc/init.d/bootmisc.sh, fixed it, by postponing the disk mounting very close to the end of the boot sequence:# mount backup storage device and restart backup storage service mount /mnt/gigapod /etc/init.d/bacula-sd restart

The second issue that cropped up was that when other USB storage devices were connected, I would sometimes end up with /dev/sda1pointing to one of the other storage devices. This was fixed by referring to the persistent device node name (courtesy of udev):