This subject interests me because I would like to use USB hard drives in
place of AIT tapes for daily backups and use the AIT tapes for offsite
backups.
Perhaps a RunBeforeJob is not needed. It seems it should be possible to
use a combination of udev, hal/dbus, and hotplug to insert a USB drive
at a known device node and known mountpoint. Autofs can then be used to
mount/unmount on an as needed basis. This works on Fedora Core 3 for my
ThumbDrive. When I insert the ThumbDrive any needed kernel modules are
loaded, the /dev/jumpdrive device node is created, and an entry is made
to /etc/fstab to mount /dev/jumpdrive at /media/jumpdrive. It is not yet
mounted, but can be mounted via /bin/mount /media/jumpdrive by a normal
user. When I subsequently issue a command, say /bin/ls /media/jumpdrive,
the automount daemon mounts the device and the ls continues as usual. If
I don't access the drive for a while (5 minutes in this case), the
automount daemon again takes over and umounts the device. As far as I
can tell, this timeout that causes the umount will never occur as long
as there is an open file handle pointing to the device. When I remove
the ThumDrive, the fstab entry, mountpoint, and device node are all
deleted. Most likely the kernel eventually unloads any modules that are
no longer needed as well.
The question is, "Will this work with bacula?". Looking briefly through
the src/stored/stored.c source, it looks like the SD only attempts to
open devices for which 'AlwaysOpen' is set. So the SD doesn't attempt to
open anything for a file based storage device during SD startup. I think
that the device is not accessed until a job starts that writes to that
device. In this case, automount should work just fine as long as the USB
device is inserted prior to the job being started.
I will try the following with the ThumbDrive:
1. Start the SD with the ThumbDrive removed.
2. Insert the ThumbDrive.
3. Run a small bacula job from bconsole and see if I can write to the
ThumbDrive.
If that works then I will continue testing. In any case I will post the
results.
---
Josh Fisher
Daniel Bloemer wrote:
Hello,
Josh Fisher wrote:
A RunBeforeJob script could mount the device with a simple mount
command. It could also tell if the drive was inserted by testing
whether or not the mountpoint existed. A RunAfterJob could unmount
the device just as easily. Of course, if multiple drives were being
used it would be neccessary to always insert the devices in the
correct order so that the device with a particular bacula volume
label was at the correct device node and mountpoint.
A better approach would be for the RunBeforeJob script to read the
bacula volume label from all inserted devices, find the mountpoint of
the device containing the desired label, mount it, and then create a
symlink to the mountpoint. The bacula job would use the symlink as
its ArchiveDevice. I have not tried this, and I'm not sure if the
RunAfterJob script could then figure out which device to unmount.
Unfortunately there is no RunStorageBeforeJob-Command.
Since Director and Storage are not on the same maschine here, a
RunBeforeJob-script has to do this stuff remote on another maschine.
Regards Daniel
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users