[Bacula-users] Bacula vchanger USB - Device is not open
Hi all. I installed bacula 5.2.13 with vchanger to store data in USB disks. I would use one external drive by day (mon-fri), so follow settings: /opt/bacula/c1.conf: # /etc/bacula/c1.conf logfile = /var/lib/bacula/vchanger_c1.log work_dir = /var/lib/bacula changer_name = c1 virtual_drives = 1 slots_per_magazine = 1 magazine_bays = 1 automount_dir = /mnt/vchanger magazine = UUID:3f23d14d-b390-4b7b-9b06-0f0ced5a1277 (for testing because i dont know how can i use variables do match the UUID) #eof sd.conf: -- Storage { # definition of myself Name = c1 SDPort = 9103 # Director's port WorkingDirectory = /opt/bacula/ Pid Directory = /opt/bacula/bin/working Maximum Concurrent Jobs = 20 SDAddress = 200.238.251.77 } # List Directors who are permitted to contact Storage daemon # # local virtual autochanger with USB drive magazines Autochanger { Name = usb-changer Device = usb-changer-drive0 Changer Command = /opt/bacula/vchanger %c %o %S %a %d Changer Device = /opt/bacula/c1.conf } #--- drive 0 of the usb-changer-1 autochanger Device { Name = usb-changer-drive0 Drive Index = 0 Autochanger = yes; DeviceType = File MediaType = File ArchiveDevice = /var/lib/bacula/0/drive0 RemovableMedia = no; RandomAccess = yes; AlwaysOpen = yes; } - [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf initmag 1 created magazine 1 in bay 1 [/mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277] [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf listmags 1:c1:1:/mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277 [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf list 1:c1_0001_0001 Loading volume in slot 1 of drive 0: [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf load 1 /var/lib/bacula/0/drive0 0 OK (i guess). [root@aplicativos2 bin]# cat /mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277/loaded0 c1_0001_0001 In bconsole: sta sto: Device status: Autochanger usb-changer with devices: usb-changer-drive0 (/var/lib/bacula/0/drive0) Device usb-changer-drive0 (/var/lib/bacula/0/drive0) is not open. Drive 0 is not loaded. == In dont understand! the drive was loaded! Whats wrong? Sorry my english. Tnx for any help. +-- |This was sent by arnaldojso...@gmail.com via Backup Central. |Forward SPAM to ab...@backupcentral.com. +-- -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger USB - Device is not open
On Tue, Jul 2, 2013 at 9:35 AM, arnaldojsousa bacula-fo...@backupcentral.com wrote: Hi all. I installed bacula 5.2.13 with vchanger to store data in USB disks. I would use one external drive by day (mon-fri), so follow settings: /opt/bacula/c1.conf: # /etc/bacula/c1.conf logfile = /var/lib/bacula/vchanger_c1.log work_dir = /var/lib/bacula changer_name = c1 virtual_drives = 1 slots_per_magazine = 1 magazine_bays = 1 automount_dir = /mnt/vchanger magazine = UUID:3f23d14d-b390-4b7b-9b06-0f0ced5a1277 (for testing because i dont know how can i use variables do match the UUID) #eof sd.conf: -- Storage { # definition of myself Name = c1 SDPort = 9103 # Director's port WorkingDirectory = /opt/bacula/ Pid Directory = /opt/bacula/bin/working Maximum Concurrent Jobs = 20 SDAddress = 200.238.251.77 } # List Directors who are permitted to contact Storage daemon # # local virtual autochanger with USB drive magazines Autochanger { Name = usb-changer Device = usb-changer-drive0 Changer Command = /opt/bacula/vchanger %c %o %S %a %d Changer Device = /opt/bacula/c1.conf } #--- drive 0 of the usb-changer-1 autochanger Device { Name = usb-changer-drive0 Drive Index = 0 Autochanger = yes; DeviceType = File MediaType = File ArchiveDevice = /var/lib/bacula/0/drive0 RemovableMedia = no; RandomAccess = yes; AlwaysOpen = yes; } - [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf initmag 1 created magazine 1 in bay 1 [/mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277] [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf listmags 1:c1:1:/mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277 [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf list 1:c1_0001_0001 Loading volume in slot 1 of drive 0: [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf load 1 /var/lib/bacula/0/drive0 0 OK (i guess). [root@aplicativos2 bin]# cat /mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277/loaded0 c1_0001_0001 In bconsole: sta sto: Device status: Autochanger usb-changer with devices: usb-changer-drive0 (/var/lib/bacula/0/drive0) Device usb-changer-drive0 (/var/lib/bacula/0/drive0) is not open. Drive 0 is not loaded. == In dont understand! the drive was loaded! Whats wrong? Sorry my english. Did you try to run a job? I mean without running a job the device will not be loaded. John -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger USB - Device is not open
On 7/2/2013 9:35 AM, arnaldojsousa wrote: Hi all. I installed bacula 5.2.13 with vchanger to store data in USB disks. I would use one external drive by day (mon-fri), so follow settings: /opt/bacula/c1.conf: # /etc/bacula/c1.conf logfile = /var/lib/bacula/vchanger_c1.log work_dir = /var/lib/bacula changer_name = c1 virtual_drives = 1 slots_per_magazine = 1 magazine_bays = 1 automount_dir = /mnt/vchanger magazine = UUID:3f23d14d-b390-4b7b-9b06-0f0ced5a1277 (for testing because i dont know how can i use variables do match the UUID) #eof sd.conf: -- Storage { # definition of myself Name = c1 SDPort = 9103 # Director's port WorkingDirectory = /opt/bacula/ Pid Directory = /opt/bacula/bin/working Maximum Concurrent Jobs = 20 SDAddress = 200.238.251.77 } # List Directors who are permitted to contact Storage daemon # # local virtual autochanger with USB drive magazines Autochanger { Name = usb-changer Device = usb-changer-drive0 Changer Command = /opt/bacula/vchanger %c %o %S %a %d Changer Device = /opt/bacula/c1.conf } #--- drive 0 of the usb-changer-1 autochanger Device { Name = usb-changer-drive0 Drive Index = 0 Autochanger = yes; DeviceType = File MediaType = File ArchiveDevice = /var/lib/bacula/0/drive0 RemovableMedia = no; RandomAccess = yes; AlwaysOpen = yes; } - [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf initmag 1 created magazine 1 in bay 1 [/mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277] [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf listmags 1:c1:1:/mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277 [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf list 1:c1_0001_0001 Loading volume in slot 1 of drive 0: [root@aplicativos2 mnt]# vchanger -u bacula -g disk /opt/bacula/c1.conf load 1 /var/lib/bacula/0/drive0 0 OK (i guess). [root@aplicativos2 bin]# cat /mnt/vchanger/3f23d14d-b390-4b7b-9b06-0f0ced5a1277/loaded0 c1_0001_0001 In bconsole: sta sto: Device status: Autochanger usb-changer with devices: usb-changer-drive0 (/var/lib/bacula/0/drive0) Device usb-changer-drive0 (/var/lib/bacula/0/drive0) is not open. Drive 0 is not loaded. == In dont understand! the drive was loaded! Whats wrong? Sorry my english. Did you do a 'update slots' command in bconsole? In vchanger, you used user bacula:disk. Are you sure that is the user that bacula-sd runs as? Tnx for any help. +-- |This was sent by arnaldojso...@gmail.com via Backup Central. |Forward SPAM to ab...@backupcentral.com. +-- -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
[Bacula-users] Bacula vchanger USB - Device is not open
Hi Josh.. tnx for you reply. I run udate slots command now in bconsole and the output: *update slots Automatically selected Storage: c1 Connecting to Storage daemon c1 at aplicativos2:9103 ... 3306 Issuing autochanger slots command. Device usb-changer has 0 slots. No slots in changer to scan. And yes... the sd runs as bacula user: output of ps aux | grep bacula command: bacula 23622 0.0 0.1 39612 1776 ?Ssl 09:32 0:00 /opt/bacula/bin/bacula-sd -u bacula -g disk -v -c /opt/bacula/bin/bacula-sd.conf bacula 23644 0.0 0.1 29096 1236 ?Ssl 09:32 0:00 /opt/bacula/bin/bacula-fd -u bacula -g disk -v -c /opt/bacula/bin/bacula-fd.conf bacula 23656 0.0 0.2 51956 2616 ?Ssl 09:32 0:00 /opt/bacula/bin/bacula-dir -u bacula -g disk -v -c /opt/bacula/bin/bacula-dir.conf Tnx again. +-- |This was sent by arnaldojso...@gmail.com via Backup Central. |Forward SPAM to ab...@backupcentral.com. +-- -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
[Bacula-users] Bacula vchanger USB - Device is not open
Something is wrong because when I run the command: [root@aplicativos2 bin]# ls /var/lib/bacula/0/ drive0 index loaded0 lost+found The volume c1_0001_0001 is not show. Tnx. +-- |This was sent by arnaldojso...@gmail.com via Backup Central. |Forward SPAM to ab...@backupcentral.com. +-- -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
On Tue, May 3, 2011 at 11:05 AM, Josh Fisher jfis...@pvct.com wrote: On 5/3/2011 5:55 AM, Koenraad Lelong wrote: ... # chmod 770 /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663/ # ls -la /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663/ totaal 196768 drwxrwx--- 6 bacula bacula 4096 3 mei 10:36 . drwxr-xr-x 3 root root 0 3 mei 10:51 .. drwx-- 2 bacula bacula 16384 21 apr 11:39 lost+found ... ls -la /var/lib/bacula/c2/ totaal 12 drwxr-x--- 2 bacula bacula 4096 3 mei 11:29 . drwxr-xr-x 3 bacula bacula 4096 3 mei 11:29 .. -rw-r--r-- 1 bacula bacula 1 3 mei 11:29 bay1 -rw-r--r-- 1 bacula bacula 0 3 mei 11:29 state0 So I'm still stuck. Just for fun I tried again : # vchanger -u bacula -g bacula /etc/bacula/c2.conf initmag 1 magazine bay 1 has no magazine mounted # vchanger -u bacula -g disk /etc/bacula/c2.conf initmag 1 created magazine 1 in bay 1 [/mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663] So the disk-group can initialize the magazine, the bacula-group has problems. I looked at the udev-rules, but there is nothing there that rings a bell. So, bacula:bacula cannot write, but bacula:disk can, yet all accessed directories appear to be owned by bacula:bacula? What group does the bacula-sd daemon run as? On Fedora, it is typical for bacula-dir to run as bacula:bacula, while bacula-sd runs as bacula:disk. Perhaps this is an selinux thing? Maybe the simple solution is to change everything to be owned by bacula:disk and run bacula-sd as bacula:disk. Hi... I had the same error today in ubuntu server: $ sudo vchanger -u bacula -g bacula /etc/bacula/disco_usb.conf initmag 1 magazine bay 1 has no magazine mounted $ sudo vchanger -u bacula -g tape /etc/bacula/disco_usb.conf initmag 1 magazine bay 1 has no magazine mounted $ sudo vchanger -u bacula -g disk /etc/bacula/disco_usb.conf initmag 1 magazine in bay 1 (/mnt/vchanger/29d9d497-62dd-4903-9054-a3fb9777b79d) already initialized as magazine 1 bacula-dir and bacula-sd are working in bacula and tape groups respectively and all folders and files have this groups. = $ find /var/lib/bacula/ /var/log/bacula/ /var/bacula -not -group bacula -and -not -group tape /var/log/bacula/ = and after check the output of strace = $ sudo strace -s 100 vchanger -u bacula -g bacula /etc/bacula/disco_usb.conf initmag 1 stat64(/dev/sdc1, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 33), ...}) = 0 time(NULL) = 1309454624 stat64(/dev/sdc1, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 33), ...}) = 0 open(/dev/sdc1, O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied) read(4, , 1024) = 0 close(4) = I found that the problem is that vchanger try to access the device (/dev/sd*) directly and not the directory/mountpoint configured.. and how the script are running with a group (bacula/tape) that don't have access do /dev/sd*, the script don't work... === $ ls -ltr /dev/sd* brw-rw 1 root disk 8, 16 2011-06-28 11:16 /dev/sdb brw-rw 1 root disk 8, 0 2011-06-28 11:16 /dev/sda brw-rw 1 root disk 8, 1 2011-06-28 11:16 /dev/sda1 brw-rw 1 root disk 8, 17 2011-06-28 11:16 /dev/sdb1 brw-rw 1 root disk 8, 21 2011-06-28 11:16 /dev/sdb5 brw-rw 1 root disk 8, 18 2011-06-28 11:16 /dev/sdb2 brw-rw 1 root disk 8, 32 2011-06-30 12:10 /dev/sdc brw-rw 1 root disk 8, 33 2011-06-30 12:10 /dev/sdc1 === solution... mmm .. include bacula in disk group ?? attentive -- -- Victor Hugo dos Santos Linux Counter #224399 -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
On 6/30/2011 1:28 PM, Victor Hugo dos Santos wrote: On Tue, May 3, 2011 at 11:05 AM, Josh Fisherjfis...@pvct.com wrote: So, bacula:bacula cannot write, but bacula:disk can, yet all accessed directories appear to be owned by bacula:bacula? What group does the bacula-sd daemon run as? On Fedora, it is typical for bacula-dir to run as bacula:bacula, while bacula-sd runs as bacula:disk. Perhaps this is an selinux thing? Maybe the simple solution is to change everything to be owned by bacula:disk and run bacula-sd as bacula:disk. Hi... I had the same error today in ubuntu server: $ sudo vchanger -u bacula -g bacula /etc/bacula/disco_usb.conf initmag 1 magazine bay 1 has no magazine mounted $ sudo vchanger -u bacula -g tape /etc/bacula/disco_usb.conf initmag 1 magazine bay 1 has no magazine mounted $ sudo vchanger -u bacula -g disk /etc/bacula/disco_usb.conf initmag 1 magazine in bay 1 (/mnt/vchanger/29d9d497-62dd-4903-9054-a3fb9777b79d) already initialized as magazine 1 bacula-dir and bacula-sd are working in bacula and tape groups respectively and all folders and files have this groups. = $ find /var/lib/bacula/ /var/log/bacula/ /var/bacula -not -group bacula -and -not -group tape /var/log/bacula/ = and after check the output of strace = $ sudo strace -s 100 vchanger -u bacula -g bacula /etc/bacula/disco_usb.conf initmag 1 stat64(/dev/sdc1, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 33), ...}) = 0 time(NULL) = 1309454624 stat64(/dev/sdc1, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 33), ...}) = 0 open(/dev/sdc1, O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied) read(4, , 1024) = 0 close(4) = I found that the problem is that vchanger try to access the device (/dev/sd*) directly and not the directory/mountpoint configured.. Could be. If magazines are specified by UUID, then libblkid functions are used to discover the device node with that UUID, followed by a getmntent() call to query the mountpoint path. Either libblkid or getmntent() is very likely making the stat64() call on the device node. and how the script are running with a group (bacula/tape) that don't have access do /dev/sd*, the script don't work... === $ ls -ltr /dev/sd* brw-rw 1 root disk 8, 16 2011-06-28 11:16 /dev/sdb brw-rw 1 root disk 8, 0 2011-06-28 11:16 /dev/sda brw-rw 1 root disk 8, 1 2011-06-28 11:16 /dev/sda1 brw-rw 1 root disk 8, 17 2011-06-28 11:16 /dev/sdb1 brw-rw 1 root disk 8, 21 2011-06-28 11:16 /dev/sdb5 brw-rw 1 root disk 8, 18 2011-06-28 11:16 /dev/sdb2 brw-rw 1 root disk 8, 32 2011-06-30 12:10 /dev/sdc brw-rw 1 root disk 8, 33 2011-06-30 12:10 /dev/sdc1 === solution... mmm .. include bacula in disk group ?? That, or run bacula-sd as bacula:disk, rather than bacula:tape, if that is possible. The user bacula-sd runs as needs read-only access in order to look up the mountpoint using a getmntent() call. -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
[Bacula-users] Bacula vchanger
Hi Josh I think Ubuntu uses apparmor instead of selinux. I'll do a bit of digging but I've messed something up in the meantime. I can't get the initialization to work with 'disk' now! I'd laugh if I wasn't crying so hard! Koenraad, I hope I am not hijacking your thread - just wanted to show some empathy and hope that another voice might throw some ideas into the mix, especially since we are using different distros. +-- |This was sent by darren.fau...@easl-stress.co.uk via Backup Central. |Forward SPAM to ab...@backupcentral.com. +-- -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
Op 03-05-11 16:05, Josh Fisher schreef: On 5/3/2011 5:55 AM, Koenraad Lelong wrote: ... So, bacula:bacula cannot write, but bacula:disk can, yet all accessed directories appear to be owned by bacula:bacula? What group does the bacula-sd daemon run as? On Fedora, it is typical for bacula-dir to run as bacula:bacula, while bacula-sd runs as bacula:disk. Perhaps this is an selinux thing? Maybe the simple solution is to change everything to be owned by bacula:disk and run bacula-sd as bacula:disk. Hi, I got a step further. Since I didn't know which user/group bacula was running as, pa aux showed only bacula-binaries running as root. So I tried to force the group to disk in the startup-script. I didn't see any difference, I forced the user in the startup-script. Then I saw bacula-sd running as bacula. Then I tried barcode labels in bconsole, this time with success. I'm using OpenSuse 11.4 to do my tests. Since there is no official package of bacula I had to download a contributed package. After installing the package I saw a file where it seemed bacula-sd was compiled with user and group bacula/bacula. So this is not the case I think. My only problem now I that I can't eject the disk with the button (after the autofs timeout). Something is using the disk, and I can't find what. lsof didn't show anything was using the disk. eject /dev/sdb1 did eject the disk though. Now I have to study again to see how to use the setup. Thanks for your help. Regards, Koenraad. -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
On 5/5/2011 5:35 AM, Koenraad Lelong wrote: Op 03-05-11 16:05, Josh Fisher schreef: On 5/3/2011 5:55 AM, Koenraad Lelong wrote: ... My only problem now I that I can't eject the disk with the button (after the autofs timeout). Something is using the disk, and I can't find what. lsof didn't show anything was using the disk. eject /dev/sdb1 did eject the disk though. Perhaps Gnome has auto-mounted the device on your desktop. -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
On 5/5/2011 9:12 AM, alidaf wrote: I'm having exactly the same problems. On Ubuntu, the storage daemon actually runs as group 'tape' but I've tried to force it to use 'bacula' and 'disk' without effect. The disk initialization will only work when the vchanger command is run with the group 'disk', regardless of which group the daemon is running as. Very strange and no joy in getting this to work at all. One would think that since the directories and files are owned by user bacula, then it should have access regardless of the group. Might this be selinux related? -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
Op 26-04-11 16:51, Josh Fisher schreef: On 4/26/2011 5:10 AM, Koenraad Lelong wrote: ... Hi, I started from scratch again. The partition itself must also have the correct owner and permissions. It should look like: # ls -la 49299ccc-6489-43f8-9536-d63dd3de9663 drwxrwx--- 3 bacula bacula 4096 26 apr 08:10 . drwxr-xr-x 3 root root0 26 apr 08:10 .. -rw-r- 1 bacula bacula 0 26 apr 09:34 c2_0001_0001 -rw-r- 1 bacula bacula 0 26 apr 09:34 c2_0001_0002 -rw-r- 1 bacula bacula 0 26 apr 09:34 c2_0001_0003 -rw-r--r-- 1 bacula bacula 7 26 apr 09:34 index -rw-r--r-- 1 bacula bacula 1 26 apr 09:34 loaded0 # chmod 770 /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663/ # ls -la /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663/ totaal 196768 drwxrwx--- 6 bacula bacula 4096 3 mei 10:36 . drwxr-xr-x 3 root root 0 3 mei 10:51 .. drwx-- 2 bacula bacula16384 21 apr 11:39 lost+found Likewise, the work directory, (determined by the work_dir= in the vchanger config), should have permissions such that bacula:bacula has read/write permissions for the directory and all files within it. Working dir : # ls -la /var/lib/bacula/ totaal 8 drwxr-xr-x 2 bacula bacula 4096 3 mei 10:54 . drwxr-xr-x 52 root root 4096 12 apr 15:34 .. Finally, make sure that the vchanger config file is readable by bacula:bacula. # ls -la /etc/bacula/ totaal 88 drwxr-xr-x 3 root root4096 26 apr 09:09 . drwxr-xr-x 126 root root 12288 3 mei 10:03 .. -rw-r- 1 root root5408 22 apr 11:20 bacula-dir.conf -rw-r- 1 root root 943 12 apr 11:19 bacula-fd.conf -rw-r- 1 root root1176 22 apr 11:32 bacula-sd.conf -rw-r- 1 root root 166 12 apr 11:30 bat.conf -rw-r- 1 root bacula 164 21 apr 16:09 bconsole.conf -rw-r--r-- 1 root root 323 26 apr 09:09 c2.conf -rw-r--r-- 1 root root1506 4 mrt 09:26 mtx-changer.conf -rw-r--r-- 1 root root 256 4 mrt 09:26 query.sql -rw-r- 1 root root 554 22 apr 11:56 tray-monitor.conf Then the best way to test is to run as user bacula # su bacula $ vchanger /path/to/vchanger.conf list 1:c2_0001_0001 2:c2_0001_0002 3:c2_0001_0003 You may have to temporarily change /etc/passwd to allow user bacula to run in a interactive shell. I gave the bacula-user a shell, then : # su - bacula vchanger /etc/bacula/c2.conf initmag 1 magazine bay 1 has no magazine mounted After that : ls -la /var/lib/bacula/ totaal 12 drwxr-xr-x 3 bacula bacula 4096 3 mei 11:29 . drwxr-xr-x 52 root root 4096 12 apr 15:34 .. drwxr-x--- 2 bacula bacula 4096 3 mei 11:29 c2 ls -la /var/lib/bacula/c2/ totaal 12 drwxr-x--- 2 bacula bacula 4096 3 mei 11:29 . drwxr-xr-x 3 bacula bacula 4096 3 mei 11:29 .. -rw-r--r-- 1 bacula bacula1 3 mei 11:29 bay1 -rw-r--r-- 1 bacula bacula0 3 mei 11:29 state0 So I'm still stuck. Just for fun I tried again : # vchanger -u bacula -g bacula /etc/bacula/c2.conf initmag 1 magazine bay 1 has no magazine mounted # vchanger -u bacula -g disk /etc/bacula/c2.conf initmag 1 created magazine 1 in bay 1 [/mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663] So the disk-group can initialize the magazine, the bacula-group has problems. I looked at the udev-rules, but there is nothing there that rings a bell. Thanks again for your patience. Regards, Koenraad Lelong. -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
On 5/3/2011 5:55 AM, Koenraad Lelong wrote: ... # chmod 770 /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663/ # ls -la /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663/ totaal 196768 drwxrwx--- 6 bacula bacula 4096 3 mei 10:36 . drwxr-xr-x 3 root root 0 3 mei 10:51 .. drwx-- 2 bacula bacula16384 21 apr 11:39 lost+found ... ls -la /var/lib/bacula/c2/ totaal 12 drwxr-x--- 2 bacula bacula 4096 3 mei 11:29 . drwxr-xr-x 3 bacula bacula 4096 3 mei 11:29 .. -rw-r--r-- 1 bacula bacula1 3 mei 11:29 bay1 -rw-r--r-- 1 bacula bacula0 3 mei 11:29 state0 So I'm still stuck. Just for fun I tried again : # vchanger -u bacula -g bacula /etc/bacula/c2.conf initmag 1 magazine bay 1 has no magazine mounted # vchanger -u bacula -g disk /etc/bacula/c2.conf initmag 1 created magazine 1 in bay 1 [/mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663] So the disk-group can initialize the magazine, the bacula-group has problems. I looked at the udev-rules, but there is nothing there that rings a bell. So, bacula:bacula cannot write, but bacula:disk can, yet all accessed directories appear to be owned by bacula:bacula? What group does the bacula-sd daemon run as? On Fedora, it is typical for bacula-dir to run as bacula:bacula, while bacula-sd runs as bacula:disk. Perhaps this is an selinux thing? Maybe the simple solution is to change everything to be owned by bacula:disk and run bacula-sd as bacula:disk. Thanks again for your patience. Regards, Koenraad Lelong. -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
Op 25-04-11 17:43, Josh Fisher schreef: On 4/22/2011 7:37 AM, Koenraad Lelong wrote: Hi, ... It looks like you either did not create the volumes using vchanger's INITMAG command, or else you created them as root or some other user and it is a permissions problem. The volume files must be owned by (or at least read/write) for the user that the bacula-sd daemon runs as. Hi Josh, I investigated and it seems bacula-sd and bacula-dir were compiled to run as bacula:bacula. I initialized the magazine with vchanger -u bacula -g disk /etc/bacula/c2.conf initmag 1 This results in -rw-r- 1 bacula disk0 26 apr 09:34 c2_0001_0001 -rw-r- 1 bacula disk0 26 apr 09:34 c2_0001_0002 -rw-r- 1 bacula disk0 26 apr 09:34 c2_0001_0003 -rw-r--r-- 1 bacula disk7 26 apr 09:34 index -rw-r--r-- 1 bacula disk1 26 apr 09:34 loaded0 So I started again, now with vchanger -u bacula -g bacula /etc/bacula/c2.conf initmag 1 response : magazine bay 1 has no magazine mounted Tried again with vchanger -u bacula -g disk /etc/bacula/c2.conf initmag 1 This went fine. Then I chown'ed -R /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663 to bacula:bacula. Again bconsole reported no slots to scan. I don't understand anymore. For what it's worth, I'm trying this on Opensuse 11.4, with bacula-rpm's from Opensuses factory buildservice. Thanks for your patience, Koenraad Lelong. -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
On 4/26/2011 5:10 AM, Koenraad Lelong wrote: ... It looks like you either did not create the volumes using vchanger's INITMAG command, or else you created them as root or some other user and it is a permissions problem. The volume files must be owned by (or at least read/write) for the user that the bacula-sd daemon runs as. Hi Josh, I investigated and it seems bacula-sd and bacula-dir were compiled to run as bacula:bacula. I initialized the magazine with vchanger -u bacula -g disk /etc/bacula/c2.conf initmag 1 This results in -rw-r- 1 bacula disk0 26 apr 09:34 c2_0001_0001 -rw-r- 1 bacula disk0 26 apr 09:34 c2_0001_0002 -rw-r- 1 bacula disk0 26 apr 09:34 c2_0001_0003 -rw-r--r-- 1 bacula disk7 26 apr 09:34 index -rw-r--r-- 1 bacula disk1 26 apr 09:34 loaded0 So I started again, now with vchanger -u bacula -g bacula /etc/bacula/c2.conf initmag 1 response : magazine bay 1 has no magazine mounted Tried again with vchanger -u bacula -g disk /etc/bacula/c2.conf initmag 1 This went fine. Then I chown'ed -R /mnt/vchanger/49299ccc-6489-43f8-9536-d63dd3de9663 to bacula:bacula. Again bconsole reported no slots to scan. I don't understand anymore. The partition itself must also have the correct owner and permissions. It should look like: # ls -la 49299ccc-6489-43f8-9536-d63dd3de9663 drwxrwx--- 3 bacula bacula 4096 26 apr 08:10 . drwxr-xr-x 3 root root0 26 apr 08:10 .. -rw-r- 1 bacula bacula 0 26 apr 09:34 c2_0001_0001 -rw-r- 1 bacula bacula 0 26 apr 09:34 c2_0001_0002 -rw-r- 1 bacula bacula 0 26 apr 09:34 c2_0001_0003 -rw-r--r-- 1 bacula bacula 7 26 apr 09:34 index -rw-r--r-- 1 bacula bacula 1 26 apr 09:34 loaded0 Likewise, the work directory, (determined by the work_dir= in the vchanger config), should have permissions such that bacula:bacula has read/write permissions for the directory and all files within it. Finally, make sure that the vchanger config file is readable by bacula:bacula. Then the best way to test is to run as user bacula # su bacula $ vchanger /path/to/vchanger.conf list 1:c2_0001_0001 2:c2_0001_0002 3:c2_0001_0003 You may have to temporarily change /etc/passwd to allow user bacula to run in a interactive shell. -- WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Bacula vchanger
On 4/22/2011 7:37 AM, Koenraad Lelong wrote: Hi, I hope this is the right list to ask, although I did already before. This is my first real experience with bacula. I'm trying to use an RDX-drive as my backup storage, that's a removable harddisk. I think I got vchanger running on its own, I did all the tests in the how-to. Now I'm integrating it in bacula, which seems not to work. I'm trying to issue the label barcodes command in bconsole. I get this : Automatically selected Catalog: MyCatalog Using Catalog MyCatalog Automatically selected Storage: c2 Connecting to Storage daemon c2 at linux-i4d6.ace-electronics.be:9103 ... Connecting to Storage daemon c2 at linux-i4d6.ace-electronics.be:9103 ... 3306 Issuing autochanger slots command. Device usb-changer has 0 slots. No slots in changer to scan. So I think my command failed. Anyone has some ideas ? It looks like you either did not create the volumes using vchanger's INITMAG command, or else you created them as root or some other user and it is a permissions problem. The volume files must be owned by (or at least read/write) for the user that the bacula-sd daemon runs as. -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
[Bacula-users] Bacula vchanger
Hi, I hope this is the right list to ask, although I did already before. This is my first real experience with bacula. I'm trying to use an RDX-drive as my backup storage, that's a removable harddisk. I think I got vchanger running on its own, I did all the tests in the how-to. Now I'm integrating it in bacula, which seems not to work. I'm trying to issue the label barcodes command in bconsole. I get this : Automatically selected Catalog: MyCatalog Using Catalog MyCatalog Automatically selected Storage: c2 Connecting to Storage daemon c2 at linux-i4d6.ace-electronics.be:9103 ... Connecting to Storage daemon c2 at linux-i4d6.ace-electronics.be:9103 ... 3306 Issuing autochanger slots command. Device usb-changer has 0 slots. No slots in changer to scan. So I think my command failed. Anyone has some ideas ? I tried update slots but this doesn't help. I started bacula-dir and bacula-sd with -f -v -d 99, but I don't see anything meaningfull to me. Thanks, Koenraad Lelong. bconsole says version 5.0.3. This is my configuration : vchanger's c2.conf : ### /etc/bacula/c1.conf # work_dir=/var/spool/bacula changer_name = c2 virtual_drives = 1 slots_per_magazine = 3 magazine_bays = 1 automount_dir = /mnt/vchanger magazine = UUID:d23bab95-e0c9-46df-8b3b-eb1de036b29f magazine = UUID:ec13e91a-1c3b-4ce2-aa33-c6b2f93198d3 magazine = UUID:49299ccc-6489-43f8-9536-d63dd3de9663 #eof bacula-sd.conf : ### Storage { # definition of myself Name = koen-test-sd SDPort = 9103 # Director's port WorkingDirectory = /var/spool/bacula Pid Directory = /var/run Maximum Concurrent Jobs = 20 } Director { Name = koen-test-dir Password = @@SD_PASSWORD@@ } Director { Name = koen-test-mon Password = @@MON_SD_PASSWORD@@ Monitor = yes } Autochanger { Name = usb-changer Device = usb-changer-drive-0 Changer Command = /usr/local/bin/vchanger %c %o %S %a %d Changer Device = /etc/bacula/c2.conf } Device { Name = usb-changer-drive-0 # Drive Index = 0 AutoChanger = yes Device Type = File Media Type = File Archive Device = /var/lib/bacula/c2/0/drive0 RemovableMedia = No; RandomAccess = Yes; } Messages { Name = Standard director = koen-test-dir = all } bacula-dir.conf : ### Default Bacula Director Configuration file Director { Name = koen-test-dir DIRport = 9101 QueryFile = /usr/lib/bacula/query.sql WorkingDirectory = /var/spool/bacula PidDirectory = /var/run Maximum Concurrent Jobs = 1 Password = @@DIR_PASSWORD@@ Messages = Daemon } Storage { Name = c2 Address = linux-i4d6.ace-electronics.be SDPort = 9103 Password = @@SD_PASSWORD@@ Device = usb-changer Media Type = File Autochanger = yes } JobDefs { Name = DefaultJob Type = Backup Level = Incremental Client = koen-test-fd FileSet = Full Set Schedule = WeeklyCycle Storage = c2 Messages = Standard Pool = File Priority = 10 Write Bootstrap = /var/spool/bacula/%c.bsr } Job { Name = BackupClient1 JobDefs = DefaultJob } Job { Name = BackupCatalog JobDefs = DefaultJob Level = Full FileSet=Catalog Schedule = WeeklyCycleAfterBackup RunBeforeJob = /usr/lib/bacula/make_catalog_backup.pl MyCatalog RunAfterJob = /usr/lib/bacula/delete_catalog_backup Write Bootstrap = /var/spool/bacula/%n.bsr Priority = 11 } Job { Name = RestoreFiles Type = Restore Client=koen-test-fd FileSet=Full Set Storage = c2 Pool = Default Messages = Standard Where = /tmp/bacula-restores } FileSet { Name = Full Set Include { Options { signature = MD5 } File = /usr/sbin } Exclude { File = /var/spool/bacula File = /tmp File = /proc File = /tmp File = /.journal File = /.fsck } } Schedule { Name = WeeklyCycle Run = Full 1st sun at 23:05 Run = Differential 2nd-5th sun at 23:05 Run = Incremental mon-sat at 23:05 } Schedule { Name = WeeklyCycleAfterBackup Run = Full sun-sat at 23:10 } FileSet { Name = Catalog Include { Options { signature = MD5 } File = /var/spool/bacula/bacula.sql } } Client { Name = koen-test-fd Address = localhost FDPort = 9102 Catalog = MyCatalog Password = @@FD_PASSWORD@@ File Retention = 30 days Job Retention = 6 months AutoPrune = yes } Catalog { Name = MyCatalog dbname = bacula; dbuser = bacula; dbpassword = } Messages { Name = Standard mailcommand = /usr/sbin/bsmtp -h localhost -f \\(Bacula\) \%r\\ -s \Bacula: %t %e of %c %l\ %r operatorcommand = /usr/sbin/bsmtp -h localhost -f \\(Bacula\) \%r\\ -s \Bacula: Intervention needed for %j\ %r mail = root@localhost = all, !skipped operator = root@localhost = mount console = all, !skipped, !saved append = /var/spool/bacula/log = all, !skipped catalog = all } Messages { Name = Daemon mailcommand = /usr/sbin/bsmtp -h localhost -f \\(Bacula\) \%r\\ -s \Bacula daemon message\ %r mail = root@localhost = all, !skipped console = all, !skipped, !saved