I understand your concerns, Kern, but let's look at this from another angle. I say it is a delegation of authority issue. You have done such excellent work here that I hesitate for fear of stepping on your toes, but this is just my thoughts (and I've been wrong many times before). For disk storage devices bacula should continue to treat the volume as a file and nothing more. It is the operating system's job to abstract the physical device issues so that application software can read/write to a filesystem and thus be used on any device capable of containing that filesystem. In fact, the filesystem itself is abstracted for the same reason. Modern devices include removable, hot pluggable disk drives. The OS must be able to handle this if it is to be reasonably useful with modern storage devices.

Barry will testify that bacula is usable as is with USB devices on a Linux system with HAL/udev. I don't know that anyone has tried it yet, but the same method should be usable with hot pluggable devices on other bus types on Linux as long as HAL/udev can handle them. By sticking with treating file-based volumes as simply files, bacula can more easily be made to work on any OS, probably even Windows.

I think your concern is "what happens when a USB drive is unplugged during a job?". I believe the answer to that is the same as "what happens when a SCSI hard drive dies during a job?". And I think the answer is that bacula fails the job and changes the volume status to "error". I believe that to be the correct behavior AFTER the job has already written successfully to the volume at least once. But the initial opening of the file at the start of the job needs to be handled differently when it fails. For disk storage devices with "Removable media = no" it should continue to fail the job as it does now. For disk storage devices with "Removable media = yes" I am imagining the following algorithm:

1. Attempt to open volume file. If successful then proceed with backup
  as usual.
2. Wait some period of time then try the open again (in case automount
  might have mounted an NFS share). If successful then proceed with
  backup as usual.
3. Determine if there is a device mounted at the path specified in the
  "Archive device" directive and fail the job if there already is
4. Re-queue the job with status "pending user intervention" and inform
  user that device is not mounted at mountpoint
5. Fork thread to wait for a device to be mounted at mountpoint
6. When device is detected as being mounted at mountpoint resume
  the job at step 1

I believe this to be a more general way of handling removable disk drives, as well as NFS, smbfs,cifs, etc. mounts. HAL/udev is just a convenience. Without it the user would manually mount the device when bacula asked for it. With HAL/udev the user would simply plug the thing in and it would Just Work(tm).


Kern Sibbald wrote:

Hello Barry,

It is nice to hear this kind of enthousiasm and success !

Please when you get it going to your satisfaction, send us the details. I am sure there a lot of users who would like to accomplish the same thing.

I'm still concerned about how Bacula is going to deal with directories and volumes that "disappear". In any case, I have my two little 2GB USB devices, and I am going to work over the next months on making Bacula understand what a USB device is and to deal with it in a more reasonable way. To do this, I think there are more than sufficient directives in the Device resource in the SD, with one exception -- most likely I need to add a "Device Type = xxx" directive which could have values such as "Tape, File, DVD, USB, FIFO, ..." Bacula currently "guesses" at what the device type is, and in most cases, it gets it right, but USB vs DVD is not so easy, and on FreeBSD there is no distinction between character devices and block devices.
On Saturday 14 January 2006 04:27, Barry L. Bond wrote:
Hey, Kern, Arno and Josh!

    I GOT IT -- I GOT IT -- I GOT IT!  :-)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to