Bacula-users

Re: [Bacula-users] simple (?) mount/unmount of USB storage device

2009-10-30 19:29:17
Subject: Re: [Bacula-users] simple (?) mount/unmount of USB storage device
From: Cedric Tefft <logicloop AT gmail DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 30 Oct 2009 16:25:51 -0700
Michael FIG wrote:
> Hi,
>
> I'm a long-term Bacula user, having used it for file and DVD volume
> backups in the past.  I'm scratching my head over what seems like a
> really simple requirement, but I can't for the life of me figure it
> out right now.
>
> I have a large external USB drive on which I want to write file
> volumes, by mounting it as /var/lib/bacula/media
>
> I have everything working to create and rotate files in the
> /var/lib/bacula/media directory, but I want to leave the drive
> unmounted (and thereby less liable to corruption) as often as
> possible, so that bacula-sd "mount"s it as /var/lib/bacula/media to do
> the backup, and "umount"s it when the backup is finished.
>
> I've been messing around with the autochanger scripts, but just don't
> understand them enough to put something this simple together.
>
> Anybody out there have a suggestion for what to do?
>
> Thanks,
>
>   
An autochanger config is probably overkill.  You can implement autofs as 
John already suggested, or you can use the "Mount Command", "Unmount 
Command" (et. al.) directives in your Device resource:

http://www.bacula.org/3.0.x-manuals/en/install/install/Storage_Daemon_Configuratio.html#SECTION00830000000000000000

Mine looks like this:

Device {
  Name = BackupDrive
  Media Type = File
  Archive Device = /media/backup/volumes
  Mount Point = /media/backup
  Mount Command = "/bin/mount %m"
  Unmount Command = "/bin/umount %m"
  Requires Mount = yes
  LabelMedia = yes
  Random Access = Yes
  AutomaticMount = yes
  RemovableMedia = yes
  AlwaysOpen = no
  Offline On Unmount = Yes
}

Note that there is a bug in 3.0.2 that prevents Bacula from calling the 
unmount command for file resources.  It's fixed in the git repository, 
but I don't know if the fix made it into 3.0.3.

- Cedric


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>