Hello,

On 2/6/2006 8:13 PM, John Demme wrote:
So the requires mount option and family have very misleading names. In my not-so-humble opinion, the correct way to implement removable hard drive backup is to rename the current options to something like dvd mount ..., and use the generic names for a generic mount/umount scheme. That is, requires mount = yes tells the SD that it is in charge of mounting/umounting a device. Mount Command is the command it runs to mount the device, and unmount command is the command that SD uses to unmount the device.

Which is what the commands do now.

Make write part command and free space command optional. Use the output from something like df for free space by default.

Look into the dvd-handler script and you might be surprised :-)

Then, people can implement their hard drive backup schemes however they'd like. Personally, I'd use something like:
Requires Mount = Yes
Mount Point = /mnt/backup1
Mount Command = /sbin/mountBackup1
Unmount Command = /sbin/umount /mnt/backup1

Where /sbin/mountBackup1 is a script that reads the drive and mounts the first partition to /mnt/backup1, and if the disk doesn't have a first partition it assumes it's a clean disk and writes a partition table and creates an ext3 partition, then mounts it.

Actually, something similar to what you suggest it what I had in mind with dvd-handler.

I'd prefer that script to become more generally usable - we were discussing storing backups to ftp servers, for example -, but that would require some changes to the SD source code.

The problem currently is (as I see it, and keep in mind I am not a programmer!) that the SD does lots of things the dvd-handler script should do. Mainly, that's mounting and unmounting and verifying the disk contents.

I'd rather only see calls to the external handler script:
- Verify volume name (or availability)
- Label volume
- Mount volume
- Umount (and eject) volume
- Write a part file to the volume
- Read a part file from the volume, and return its name or simply return the name if the storage media is mounted
... and so on.

This seems to be the most straight forward way to do it and I'm a little surprised it doesn't exist already.

the problem is that, IMO, dvd writing started as kind of a hack and is not really maintained. Further, there is one conceptual difference between DVDs and hard disks for Bacula: A DVD always contains exactly one volume (like a tape) where a disk can contain many columes, distinguished by name and not by the device and Baculas volume label.

Without it, I'm just going to create two scripts that manage the drive's mounted status and the user will have to do it manually.

Look into the list archive - there was some lengthy discussion about a similar setup some time ago. Search for the name "Barry L. Bond".

I suppose the only wrikle is detecting when a new drive has been inserted. Preferably, Bacula would listen on dbus for a particular (configurable) message, and the user (again) care take care of it.

Such a scheme would be much too OS/distribution specific for my taste...

I'm pretty busy right now (and my that I mean the last few and upcoming years), but when I get a chance (hopefully later in the week) I'll grep through the Bacula source. No promises.

I consider the Bacula source somewhat complicated... anyway, you might want to start with src/stored/dvd.c which contains the interface to the external handler script and the (too much) DVD specific functions. Some fairly important information is in stored_conf.h, and of course you should try to understand Baculas variables / objects (which I never really did...)

Thanks for the quick (albeight disappointing) answer,

Disappointing? I hope not! I'd rather say I pointed out an interesting project!

;-)

Arno

John Demme

On 2/6/06, *Arno Lehmann* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hello,

    On 2/6/2006 4:20 PM, John Demme wrote:
     > I'm trying to get Bacula to backup to my removable SATA hard
    drive.  I
     > want bacula to manage whether of not the drive is mounted.  Thus,
    I have
     > the following bacula-sd device area:
     >
     > Device {
     >   Name = FileStorage
     >   Media Type = RemovableFile
     >   Archive Device = /dev/sdg1

    oh oh...

     >   Requires Mount = yes
     >   Mount Point = /mnt/backup1
     >   Mount Command = "/bin/mount /mnt/backup1"
     >   Unmount Command = "/bin/umount /mnt/backup1"
     >   Write Part Command = "/usr/bin/true"
     >
     >   LabelMedia = yes;                   # lets Bacula label
    unlabeled media
     >   Random Access = Yes;
     >   AutomaticMount = yes;               # when device opened, read it
     >   RemovableMedia = yes;
     >   AlwaysOpen = no;
     > }
     >
     >
     > However, when I try to label the drive the following hits me:
     >
     > *label
     > Using default Catalog name=MyCatalog DB=bacula
     > Automatically selected Storage: File
     > Enter new Volume name: Daily001
     > Defined Pools:
     >      1: Daily
     >      2: Monthly
     > Select the Pool (1-2): 1
     > Connecting to Storage daemon File at sophy:9103 ...
     > Sending label command for Volume "Daily001" Slot 0 ...
     > 3910 Unable to open device "FileStorage" (/dev/sdg1): ERR=The
    media in
     > the device "FileStorage" (/dev/sdg1) is not empty, please blank it
     > before writing anything to it.
     >
     > Label command failed for Volume Daily001.
     > Do not forget to mount the drive!!!
     >
     >
     > So I guess Bacula thinks I'm backing up to a DVD or CD since I'm
    using
     > the requires mount = yes option.
     >
     > What am I doing wrong?

    You can't achieve what you want like this.

    The requires mount options and related stuff heavily depend on the write
    part command program, so first, you'd need a real program that does
    what
    dvd-handler does with DVDs - writing part files to the device, mainly.

    Unless you're ready to read through the SD code - especially the parts
    regarding DVD writing - and creating a customized write part command
    program, what you want to do is not easily possible.

    There have been some suggestions as to how effectively use removable
    hard disk storage recently, you might want to search the archives for
    these. Also, Kern has started thinking about how to handle removable
    disks, so it might be that he comes up with something some day.

    And, of course, you can always suggest how Bacula should handle this
    sort of stuff, and also submit code :-)

    Arno

     > Thanks,
     > John Demme

    --
    IT-Service Lehmann                    [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    Arno Lehmann                  http://www.its-lehmann.de


    -------------------------------------------------------
    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
    <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642>
    _______________________________________________
    Bacula-users mailing list
    Bacula-users@lists.sourceforge.net
    <mailto:Bacula-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/bacula-users



--
IT-Service Lehmann                    [EMAIL PROTECTED]
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------
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