Re: [Bacula-users] bconsole restore error

2007-03-29 Thread Arno Lehmann
Hi,

On 3/28/2007 6:34 PM, Rui Goncalves wrote:
> 
> Dear Arno,
>  
> Thanks for your kind reply.
>  
> 
> The test was made with others Volumes in autochanger
>  
> After executed yours suggestions I think that it is all good with the 
> autochanger(/dev/sg0) and the drive(/dev/nst0) .

Good... then I suspect the tape drive needs more time to recognize the 
tape. Use the function wait_for_drive (or similar...) in mtx-changer if 
possible, or try a longer wait time after loading the tape. DLT can take 
up to some minutes.

> Only commands that seem does not run well is:
>  mt -f /dev/nst0 rewind - It finishes immediately

That's interesting... are you sure it returns immedeiately even if the 
tape is not already rewound? When you always test with the rewinding 
devices, the above observation would be expected, but doing a 'mt -f 
/dev/nst0 fsf 200' you should see a higher block positio with 'mt 
status', and rewinding should take some time.

>  mt -f /dev/nst0 retension - It finishes immediately. It would have to 
> take some time

There are tape drives that don't support retensioning, because the 
manufacturesrs decided these tapes don't need to be retensioned... 
mostly the single-reel technology.

Arno

>  TESTING
>  
>  mt -f /dev/nst0 status
>  
> SCSI 2 tape drive:
> File number=-1, block number=-1, partition=0.
> Tape block size 0 bytes. Density code 0x0 (default).
> Soft error count since last status=0
> General status bits on (5):
>  DR_OPEN IM_REP_EN
>  
>  mtx -f /dev/sg0 status
>  
>   Storage Changer /dev/sg0:1 Drives, 9 Slots ( 0 Import/Export )
> Data Transfer Element 0:Empty
>   Storage Element 1:Full :VolumeTag=UG2029L1
>   Storage Element 2:Full :VolumeTag=UG2004L1
>   Storage Element 3:Full :VolumeTag=UG2038L1
>   Storage Element 4:Full :VolumeTag=UG2039L1
>   Storage Element 5:Full :VolumeTag=UG2043L1
>   Storage Element 6:Full :VolumeTag=UG2035L1
>   Storage Element 7:Full :VolumeTag=UG2040L1
>   Storage Element 8:Full :VolumeTag=UG2041L1
>   Storage Element 9:Full :VolumeTag=UG2042L1
>  
>  mtx -f /dev/sg0 load 1
>  
>  mtx -f /dev/sg0 status
>  
>   Storage Changer /dev/sg0:1 Drives, 9 Slots ( 0 Import/Export )
> Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = 
> UG2029L1   
>   Storage Element 1:Empty:VolumeTag=
>   Storage Element 2:Full :VolumeTag=UG2004L1
>   Storage Element 3:Full :VolumeTag=UG2038L1
>   Storage Element 4:Full :VolumeTag=UG2039L1
>   Storage Element 5:Full :VolumeTag=UG2043L1
>   Storage Element 6:Full :VolumeTag=UG2035L1
>   Storage Element 7:Full :VolumeTag=UG2040L1
>   Storage Element 8:Full :VolumeTag=UG2041L1
>   Storage Element 9:Full :VolumeTag=UG2042L1
>  
>  mt -f /dev/nst0 status
>  
> SCSI 2 tape drive:
> File number=0, block number=0, partition=0.
> Tape block size 0 bytes. Density code 0x40 (DLT1 40 GB, or Ultrium).
> Soft error count since last status=0
> General status bits on (4101):
>  BOT ONLINE IM_REP_EN
>  
> 
>  mtx -f /dev/sg0 unload 1
> Unloading Data Transfer Element into Storage Element 1...done
>  
>  mtx -f /dev/sg0 status
>  
>   Storage Changer /dev/sg0:1 Drives, 9 Slots ( 0 Import/Export )
> Data Transfer Element 0:Empty
>   Storage Element 1:Full :VolumeTag=UG2029L1
>   Storage Element 2:Full :VolumeTag=UG2004L1
>   Storage Element 3:Full :VolumeTag=UG2038L1
>   Storage Element 4:Full :VolumeTag=UG2039L1
>   Storage Element 5:Full :VolumeTag=UG2043L1
>   Storage Element 6:Full :VolumeTag=UG2035L1
>   Storage Element 7:Full :VolumeTag=UG2040L1
>   Storage Element 8:Full :VolumeTag=UG2041L1
>   Storage Element 9:Full :VolumeTag=UG2042L1
>  
>  mt -f /dev/nst0 status
>  
> SCSI 2 tape drive:
> File number=-1, block number=-1, partition=0.
> Tape block size 0 bytes. Density code 0x0 (default).
> Soft error count since last status=0
> General status bits on (5):
>  DR_OPEN IM_REP_EN
>  
>  ./mtx-changer /dev/sg0 load 1 /dev/nst0 0
>  
>  mtx -f /dev/sg0 status
>  
>   Storage Changer /dev/sg0:1 Drives, 9 Slots ( 0 Import/Export )
> Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = 
> UG2029L1   
>   Storage Element 1:Empty:VolumeTag=
>   Storage Element 2:Full :VolumeTag=UG2004L1
>   Storage Element 3:Full :VolumeTag=UG2038L1
>   Storage Element 4:Full :VolumeTag=UG2039L1
>   Storage Element 5:Full :VolumeTag=UG2043L1
>   Storage Element 6:Full :VolumeTag=UG2035L1
>   Storage Element 7:Full :VolumeTag=UG2040L1
>   Storage Element 8:Full :VolumeTag=UG2041L1
>   Storage Element 9:Full :VolumeTag=UG2042L1
>  
>  mtx -f /dev/sg0 unload 1
> Unloading Data Transfer Element into Storage Element 1...done
>  
>  mtx -f /dev/sg0 status
>  
>   Storage Changer /dev/sg0:1 Drives, 9 Slots ( 0 Import/Export )
> Data Transfer Element 0:Empty
>   Storage Element 1:Full :VolumeTag=UG2029L1
>   Storage Element 2:Full :VolumeTag=

Re: [Bacula-users] bconsole restore error

2007-03-28 Thread Arno Lehmann
Hi,

On 3/28/2007 11:08 AM, Rui Goncalves wrote:
> 
> 
> Please Help!
>  
> Bacula 1.38.2 on Linux RedHat.
>  
> During a bconsole restore a get this msg:
>  
> 26-Mar 17:48 lis-backup-sd: Please mount Volume "UG2027L1" on Storage 
> Device "Drive-1" (/dev/nst0) for Job RestoreFiles.2007-03-26_17.47.15
>  
> Then I give the command  mount storage= HP but the job ends with error.
>  
> The mount command is correct? If not which is the right form.
>  
> The required volume was loaded from autochanger (/dev/sg0) to the drive 
> (/dev/nst0)

According to your job output below, the SD could not use the device as 
expected.

I'd check that the tape you want to use really gets loaded and is 
usable. The output you present is a little unclear to me... the tape 
from slot 1 should be in Drive-1, but it can't be rewound. This might be 
a configuration problem (like you use a tape drive which is not in the 
autochanger you use, or you have the drive numbers / device names 
wrong), but it could also be a hardware problem.

Try, on the shell, the following: (unmount the device from Bacula first)
- use mtx to make sure tapes are loaded as expected.
- check that mtx-changer works as it should.
- Then, load the tae in question (from slot 1) using mtx-changer
- Try to get the drive status using mt: 'mt -f /dev/nst0 status'
- Check for errors in the system log

Arno

> Thanks for the help.
>  
> Rui Goncalves
>  
> 
> BACULA-DIR.conf CONFIGURATION
>  
> Storage {
>   Name = "HP"
>   Maximum Concurrent Jobs = 4
>   Device = Drive-1  # must be same as Device in 
> Storage daemon
>   Media Type = DLT-8000
>   Address = lis-backup# N.B. Use a fully qualified name here
>   SDPort = 9103
>   Password = "XXX"  # password for Storage daemon
>   AutoChanger = yes
> }
>  
> 
> BACULA-SD.CONF CONFUGURATION
>  
> Autochanger {
>   Name = Autochanger
>   Device = Drive-1
>   Changer Command = "/etc/bacula/mtx-changer %c %o %S %a %d"
>   Changer Device = /dev/sg0
> }
>  
> Device {
>   Name = Drive-1  #
>   Drive Index = 0
>   Media Type = DLT-8000
>   Archive Device = /dev/nst0
>   AutomaticMount = yes;   # when device opened, read it
>   AlwaysOpen = yes;
>   RemovableMedia = yes;
>   RandomAccess = no;
>   AutoChanger = yes
> #  # Enable the Alert command only if you have the mtx package loaded
>   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
>  
> == bconsole EXECUTION LOG
>  
> *restore
> Using default Catalog name=MyCatalog DB=bacula
>  
> First you select one or more JobIds that contain files
> to be restored. You will be presented several methods
> of specifying the JobIds. Then you will be allowed to
> select which files from those JobIds are to be restored.
>  
> To select the JobIds, you have the following choices:
>  1: List last 20 Jobs run
>  2: List Jobs where a given File is saved
>  3: Enter list of comma separated JobIds to select
>  4: Enter SQL list command
>  5: Select the most recent backup for a client
>  6: Select backup for a client before a specified time
>  7: Enter a list of files to restore
>  8: Enter a list of files to restore before a specified time
>  9: Find the JobIds of the most recent backup for a client
> 10: Find the JobIds for a backup for a client before a specified time
> 11: Enter a list of directories to restore for found JobIds
> 12: Cancel
> Select item:  (1-12): 3
>  
> Enter JobId(s), comma separated, to restore: 7235
> You have selected the following JobId: 7235
>  
> Building directory tree for JobId 7235 ...  
> 
> 1 Job, 7,650 files inserted into the tree.
>  
> You are now entering file selection mode where you add (mark) and
> remove (unmark) files to be restored. No files are initially added, unless
> you used the "all" keyword on the command line.
> Enter "done" to leave this mode.
>  
> cwd is: /
> $
>  
> $ ls
> C:/
> K:/
> $ cd K:/
> cwd is: K:/
> $ ls
> 40abda4f950fb75ba5/
> System Volume Information
> $ mark *
> 3 files marked.
> $ lsmark
> *40abda4f950fb75ba5/
> *%temp%dd_msxml_retMSI.txt
> *System Volume Information
> $
>  
> 
> Bootstrap records written to 
> /var/bacula/working/lis-backup-dir.restore.*Console*.2007-03-26_17.42.12.bsr 
> 
>  
> The job will require the following Volumes:
>  
>UG2027L1
>  
> 
> 3 files selected to be restored.
>  
> Defined Clients:
>  1: lis-backup-fd
>  2: ffranco-fd
>  3: matou-fd
>  4: rg-fd
>  5: mail-fd
>  6: fileserver-fd
>  7: egtfilesrv-fd
>  8: lxdc-fd
>  9: clp-0937-fd
> 10: clp-0961-fd
> 11: proxy-fd
> 12: clp-0967-fd
> 13: lxmail-fd
> 14: printserver-fd
> 15: dezdc-fd
> 16: logtec-fd
> 17: owa-fd
> 18: mssql-fd
> 19: compta-vpn-fd
> 20: faxserver-fd
> 21: remedy-fd
> 22: dnsdominio-fd
> 23: smtp-fd
> 24: www-fd
> 25