I'm moving this message over to bacula-devel which is more appropriate for discussing the changes.
Other comments below > -----Original Message----- > From: Ruben Lopez [mailto:[EMAIL PROTECTED] > Sent: 14 March 2007 14:56 > To: Richard Mortimer > Cc: bacula-users@lists.sourceforge.net > Subject: Re: [Bacula-users] Bacula is not asking for DVDs > > Hi Richard, > > I will try to modify bacula by myself. Excellent. > If I make any progress I will > send you a patch Could you give me any advice on where to > start looking > at the code to concentrate on this problem? Good question. You probably need to get a decent debug log from the SD to get a good idea as to what the problem is (-d 200 is probably ok). The log snippet that you posted suggested that it was trying to write to the DVD when it failed. That is probably too late to catch the error and fail gracefully and any fix is likely to be needed in the mount code. The place to start is probably in src/stored/mount.c the mount_next_write_volume function is what will fail gracefully and ask the sysop to mount a new volume (look for dir_ask_sysop_to_mount_volume(dcr) around line 89 and line 161). I think that it will be try_autolabel that actually fails when there is no DVD. Basically I suggest that you get the SD debug log and look for any messages from mount_next_write_volume and try_autolabel. Another thing to look for is a call to the freespace command. That is probably a good place to hook into if no disk is present. As for the fix I suspect that dvd-handler needs to be modified to return a well known error code/string from the freespace command. Then the bit around mount/autolabel needs modifying to not let bacula start writing/labelling a volume if no disk is present. Richard > Could this be solved > directly in the dvd-handler script or should I modify the bacula core? > > Thanks a lot! > > Richard Mortimer wrote: > > Hi, > > > > > >> -----Original Message----- > >> From: [EMAIL PROTECTED] > >> [mailto:[EMAIL PROTECTED] On Behalf > >> Of Ruben Lopez > >> Sent: 14 March 2007 10:45 > >> To: bacula-users@lists.sourceforge.net > >> Subject: Re: [Bacula-users] Bacula is not asking for DVDs > >> > >> I'm still blocked with this problem, does anybody know at least if > >> bacula should ask me for DVD's or if the DVD must be inserted > >> into the > >> drive before issuing the backup job? > >> > >> > > It looks like you found a corner case that never got tested. I > > have tested extensively with DVDs (blank and used) in the drive > > and all works but I probably never tested without a DVD in the > > drive. > > > > You should be able to get working by inserting a DVD before starting > > a backup and ensuring that there is always a DVD in the > drive. As for > > your error it looks like we need to add a bit of code to catch the > > no DVD in drive case. I don't have time to do that at the moment so > > I suggest that you log a bug on http://bugs.bacula.org so that it > > does not get forgotten. > > > > Regards > > > > Richard > > > > > >> Thanks > >> > >> Ruben Lopez wrote: > >> > >>> Hi, > >>> > >>> We have bacula running quite well, and it's doing backups > >>> > >> to tape and > >> > >>> disk seamlessly. But when trying to use DVD's we have found > >>> > >> a problem, > >> > >>> we tried leaving the DVD drive empty, to test if bacula > >>> > >> asks for a DVD, > >> > >>> and we get this message instead: > >>> > >>> 08-Mar 10:59 wks188-sd: test-dvd-Job.2007-03-08_10.59.08 > >>> > >> Fatal error: > >> > >>> dvd.c:263 Error writing part 1 to the DVD: ERR=Error while > >>> > >> writing part > >> > >>> file: Cannot get media info from dvd+rw-mediainfo || errno > >>> > >> = 0 (Success) > >> > >>> I tried the dvd-handler directly and in fact it gives the > >>> > >> same message: > >> > >>> Cannot get media info from dvd+rw-mediainfo || errno = 0 (Success) > >>> > >>> dvd+rw-mediainfo /dev/hdc says this: > >>> > >>> INQUIRY: [HL-DT-ST][DVDRAM GSA-4167B][DL11] > >>> GET [CURRENT] CONFIGURATION: > >>> :-( no media mounted, exiting... > >>> > >>> And exits with an exit status of 1 (not 0), which makes > >>> > >> dvd-handler fail > >> > >>> also. > >>> > >>> I've the patched version of dvd+rw-tools, although it > >>> > >> doesn't really > >> > >>> matter because the patch only affects growisofs. > >>> > >>> This is my device configuration: > >>> > >>> Device { > >>> Name = "DVD-Writer" > >>> Media Type = DVD > >>> Archive Device = /dev/hdc > >>> LabelMedia = yes; # lets Bacula label > >>> > >> unlabeled media > >> > >>> Random Access = Yes; > >>> AutomaticMount = yes; # when device > opened, read it > >>> RemovableMedia = yes; > >>> AlwaysOpen = no; > >>> MaximumPartSize = 800M; > >>> RequiresMount = yes; > >>> MountPoint = /media/disk; > >>> MountCommand = "/bin/mount -t iso9660 -o ro %a %m"; > >>> UnmountCommand = "/bin/umount %m"; > >>> SpoolDirectory = /disks/wks188d1/temp; > >>> WritePartCommand = "/etc/bacula/dvd-handler %a write %e %v" > >>> FreeSpaceCommand = "/etc/bacula/dvd-handler %a free" > >>> } > >>> > >>> And this is my pool configuration: > >>> Pool { > >>> Name = "DVD_CD" > >>> LabelFormat = CD > >>> Pool Type = Backup > >>> AutoPrune = no > >>> Recycle = no > >>> } > >>> > >>> Any idea? > >>> > >>> Thanks in advance. > >>> > >>> > >>> > >> -------------------------------------------------------------- > >> ----------- > >> > >>> Take Surveys. Earn Cash. Influence the Future of IT > >>> Join SourceForge.net's Techsay panel and you'll get the > >>> > >> chance to share your > >> > >>> opinions on IT & business topics through brief > surveys-and earn cash > >>> > >>> > >> http://www.techsay.com/default.php?page=join.php&p=sourceforge > >> &CID=DEVDEV > >> > >>> _______________________________________________ > >>> Bacula-users mailing list > >>> Bacula-users@lists.sourceforge.net > >>> https://lists.sourceforge.net/lists/listinfo/bacula-users > >>> > >>> > >>> > >> -------------------------------------------------------------- > >> ----------- > >> Take Surveys. Earn Cash. Influence the Future of IT > >> Join SourceForge.net's Techsay panel and you'll get the > >> chance to share your > >> opinions on IT & business topics through brief surveys-and > earn cash > >> http://www.techsay.com/default.php?page=join.php&p=sourceforge > >> &CID=DEVDEV > >> _______________________________________________ > >> Bacula-users mailing list > >> Bacula-users@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/bacula-users > >> > >> > > > > > > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users