Hello,

On Monday 07 August 2006 14:01, Kern Sibbald wrote:
> > Is there a chance to get udev rules shipped with the Fedora RPM Packages?
>
> Yes, this is probably a good idea because there are probably very few users
> who know how to create udev rules.  I'll look at adding them to the
> release, but I'm not sure we will install them on the system, but rather
> leave the file in /etc/bacula for the user to install should he wish.

ok, here is what works for me (sorry for the delay).

The basic Idea of my rules is to first fix the permissions on the real device 
node(s), so that bacula works. Then, optionally, create persistent symlinks 
for use in the bacula-sd.conf file. It should be possible to shuffle SCSI 
hardware around without worries about breaking the bacula configuration (ie 
volumes loaded in the wrong drive since nst0 and nst1 have switched, etc...)

The rules goes into

        /etc/udev/rules.d/55-bacula.rules

(at least in Fedora, other distros might differ)

I put in one examples to create the persistent symlinks. It is matching the 
devices by the output of the scsi_id program. I use this here in production.

All that depends strongly on the hardware used, so it is commented out in the 
attached file.

To got things going, it is necessary to adjust the strings in RESULT. The rest 
*should* work quite distribution independent. Hopefully.

To get a RESULT string for your autochanger run something like this (provided 
the changer is currently sg5):

        scsi_id -g -u -s /class/scsi_generic/sg5

for a tape drive the command would be:

        scsi_id -g -u -s /class/scsi_tape/nst0

whatever string those commands return, put it in the udev config file. If the 
matching works you should see device links like that in /dev:

        # ls  -la /dev/autochanger1*
        lrwxrwxrwx  1 root root 3 Aug 15 20:00 /dev/autochanger1 -> sg5
        lrwxrwxrwx  1 root root 4 Aug 15 20:00 /dev/autochanger1-drive1 -> nst1
        lrwxrwxrwx  1 root root 4 Aug 15 19:59 /dev/autochanger1-drive2 -> nst0

(that is only my philosophy of representing one changer with two drives, it 
can be named however you like)

The links should remain stable, while their targets (sg5, nst1, nst0) might 
change if something changes on the SCSI bus.

best regards,
Stephan
#
# Setup Autochanger Devices for use with bacula (http://www.bacula.org)
#
# - tested on Fedora Core 4 with bacula-mysql RPM package
#

# fix the permissions of the standard devices
# - this is enough to get bacula going
KERNEL=="sg[0-9]*", BUS=="scsi", MODE="0660", GROUP="disk"


# optional:
# - create persistent symlinks for use in bacula-sd.conf
# - adjust the RESULT strings to match your specific hardware 
#   (you can run the scsi_id program on the command line to get correct strings)
#
#SUBSYSTEM=="scsi_generic", PROGRAM=="/sbin/scsi_id -g -d %N -s %p", 
RESULT=="200900de794345a07", SYMLINK+="autochanger1"
#KERNEL=="nst*", SUBSYSTEM=="scsi_tape", PROGRAM=="/sbin/scsi_id -g -u -d %N -s 
%p" RESULT=="1IBM_____ULTRIUM-TD2_____1110279276" SYMLINK+="autochanger1-drive1"
#KERNEL=="nst*", SUBSYSTEM=="scsi_tape", PROGRAM=="/sbin/scsi_id -g -u -d %N -s 
%p" RESULT=="1IBM_____ULTRIUM-TD2_____1110279611" SYMLINK+="autochanger1-drive2"

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to