To demonstrate the problem with manual ejection of tape, this is what
I did:
- start with a fresh database
- start bconsole
- add a volume to the Default pool
- run two backup jobs
- quit bconsole
- * manually eject tape without unmounting
- * re-insert tape
- start bconsole
- without unmounting/mounting try to run a job (fails)
- do an unmount/mount
- try to run a job (fails)
The transcript of the session is attached to the end of this mail.
Actually, I tried out a couple of variations. In some cases, bacula
seemed to be able to run jobs after re-inserting the tape. It would
even list them as completed jobs. But then, when I tried to restore,
it had problems accessing the tape. These are the dangers I am
afraid of. Are there any rescue methods in such cases? Again thank
you very much for the help.
- Sarath
On Thu, 21 Sep 2006, Kern Sibbald wrote:
> On Thursday 21 September 2006 19:08, Sarath Jayewardena wrote:
> > Hi,
> >
> > I am experimenting to see whether bacula would be a good system for me to
> > backup our department's servers. I am running bacula director and storage
> > daemon on a Debian (sarge) machine which has a scsi DLT tape drive
> > attached to it. The version of bacula is 1.36.2. It looks promising,
> > except for one annoying, and in my view, serious problem:
> >
> > The tape drive allows me to eject the tape by pressing an 'unload'
> > button. However, afterwards, when I re-insert the tape, bacula cannot read
> > it, so all the backup data is useless. (Of course, if I have 'unmounted'
> > the tape from within bconsole before ejecting, bacula has no problem
> > accessing the data afterwards.) The question is, is there any way to make
> > bacula accept the tape if the tape was accidientally, 'improperly'
> > ejected?
>
> As long as Bacula is not writing on the tape at the moment you ejected the
> tape, the data is fine and can be read by Bacula.
>
> However, when you eject a tape without unmounting the storage device first,
> Bacula will not know or except that you have changed the tape until you
> unmount and re-mount the storage device.
>
> >
> > I have browsed the mailing list archive and seen the advice that I could
> > use AlwaysOpen = no and OfflineOnUnmount = yes to guarantee that
> > bacula unmounts the tape after each backup. But the advice comes with
> > the warning that for each backup bacula will be rewinding and
> > re-positioning the tape consuming a lot of time, so leaving the default
> > behaviour is really preferred.
> >
> > If someone knows that this problem does not exist in newer versions of
> > bacula, I could upgrade to the version (1.38.11) in the Debian testing
> > distribution.
> >
> > I would greatly appreciate any help regarding this. Thanks.
> >
> > - Sarath
> >
> >
> >
> > -------------------------------------------------------------------------
> > 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
> >
>
===========================================================
Transcript of the session follows:
Script started on Fri Sep 22 10:48:09 2006
csci485b:~# bconsole
Connecting to Director csci485b:9101
1000 OK: csci485b-dir Version: 1.36.2 (28 February 2005)
Enter a period to cancel a command.
*stat dir
Using default Catalog name=MyCatalog DB=bacula
csci485b-dir Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 0 Jobs run since started.
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 23-Sep-06 01:05 CSCI485bFiles *unknown*
Incremental Backup 10 23-Sep-06 01:05 CSCI251Files *unknown*
Incremental Backup 10 23-Sep-06 01:05 CSCIfaiFiles *unknown*
Full Backup 11 23-Sep-06 01:10 BackupCatalog *unknown*
====
Running Jobs:
No Jobs running.
====
No Terminated Jobs.
====
*stat sto
Automatically selected Storage: DLTDrive
Connecting to Storage daemon DLTDrive at csci485b:9103
csci485b-sd Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 0 Jobs run since started.
Running Jobs:
No Jobs running.
====
No Terminated Jobs.
Device status:
Device "/dev/nst0" is mounted with Volume "NetBackupVol0001"
Total Bytes Read=0 Blocks Read=0 Bytes/block=0
Positioned at File=0 Block=0
*list media
Pool: Default
No results to list.
*add
You probably don't want to be using this command since it
creates database records without labeling the Volumes.
You probably want to use the "label" command.
Automatically selected Pool: Default
Automatically selected Storage: DLTDrive
Enter number of Volumes to create. 0=>fixed name. Max=1000: 1
Enter base volume name: NetBackupVol
Enter the starting number: 1
1 Volumes created in pool Default
*list media
Pool: Default
+---------+------------------+-----------+----------+----------+--------------+---------+------+-----------+-----------+-------------+
| MediaId | VolumeName | VolStatus | VolBytes | VolFiles | VolRetention |
Recycle | Slot | InChanger | MediaType | LastWritten |
+---------+------------------+-----------+----------+----------+--------------+---------+------+-----------+-----------+-------------+
| 1 | NetBackupVol0001 | Append | 0 | 0 | 31536000 |
1 | 0 | 0 | DLT | 0 |
+---------+------------------+-----------+----------+----------+--------------+---------+------+-----------+-----------+-------------+
*run
A job name must be specified.
The defined Job resources are:
1: CSCI485bFiles
2: CSCI251Files
3: CSCIfaiFiles
4: BackupCatalog
5: RestoreFiles
Select Job resource (1-5): 1
Run Backup job
JobName: CSCI485bFiles
FileSet: Full Set
Level: Incremental
Client: csci485b-fd
Storage: DLTDrive
Pool: Default
When: 2006-09-22 10:49:38
Priority: 10
OK to run? (yes/mod/no): yes
Job started. JobId=1
*
You have messages.
*mess
22-Sep 10:49 csci485b-dir: Created new FileSet record "Full Set" 2006-09-22
10:49:42
22-Sep 10:49 csci485b-dir: No prior Full backup Job record found.
22-Sep 10:49 csci485b-dir: No prior or suitable Full backup found. Doing FULL
backup.
22-Sep 10:49 csci485b-dir: Start Backup JobId 1,
Job=CSCI485bFiles.2006-09-22_10.49.40
22-Sep 10:49 csci485b-sd: Wrote label to prelabeled Volume "NetBackupVol0001"
on device "/dev/nst0"
22-Sep 10:49 csci485b-dir: Bacula 1.36.2 (28Feb05): 22-Sep-2006 10:49:48
JobId: 1
Job: CSCI485bFiles.2006-09-22_10.49.40
Backup Level: Full (upgraded from Incremental)
Client: csci485b-fd
FileSet: "Full Set" 2006-09-22 10:49:42
Pool: "Default"
Storage: "DLTDrive"
Start time: 22-Sep-2006 10:49:42
End time: 22-Sep-2006 10:49:48
FD Files Written: 974
SD Files Written: 974
FD Bytes Written: 1,739,550
SD Bytes Written: 1,840,000
Rate: 289.9 KB/s
Software Compression: None
Volume name(s): NetBackupVol0001
Volume Session Id: 1
Volume Session Time: 1158947281
Last Volume Bytes: 1,866,397
Non-fatal FD errors: 0
SD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Backup OK
22-Sep 10:49 csci485b-dir: Begin pruning Jobs.
22-Sep 10:49 csci485b-dir: No Jobs found to prune.
22-Sep 10:49 csci485b-dir: Begin pruning Files.
22-Sep 10:49 csci485b-dir: No Files found to prune.
22-Sep 10:49 csci485b-dir: End auto prune.
*stat dir
csci485b-dir Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 1 Job run since started.
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 23-Sep-06 01:05 CSCI485bFiles
NetBackupVol0001
Incremental Backup 10 23-Sep-06 01:05 CSCI251Files
NetBackupVol0001
Incremental Backup 10 23-Sep-06 01:05 CSCIfaiFiles
NetBackupVol0001
Full Backup 11 23-Sep-06 01:10 BackupCatalog
NetBackupVol0001
====
Running Jobs:
No Jobs running.
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
========================================================================
1 Full 974 1,739,550 OK 22-Sep-06 10:49 CSCI485bFiles
====
*stat storage
Automatically selected Storage: DLTDrive
Connecting to Storage daemon DLTDrive at csci485b:9103
csci485b-sd Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 1 Job run since started.
Running Jobs:
No Jobs running.
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
======================================================================
1 Full 974 1,840,000 OK 22-Sep-06 10:49 CSCI485bFiles
====
Device status:
Device "/dev/nst0" is mounted with Volume "NetBackupVol0001"
Total Bytes=1,866,397 Blocks=29 Bytes/block=64,358
Positioned at File=1 Block=0
*run
A job name must be specified.
The defined Job resources are:
1: CSCI485bFiles
2: CSCI251Files
3: CSCIfaiFiles
4: BackupCatalog
5: RestoreFiles
Select Job resource (1-5): 2
Run Backup job
JobName: CSCI251Files
FileSet: Full Set
Level: Incremental
Client: csci251-fd
Storage: DLTDrive
Pool: Default
When: 2006-09-22 10:50:46
Priority: 10
OK to run? (yes/mod/no): yes
Job started. JobId=2
*
You have messages.
*mess
22-Sep 10:50 csci485b-dir: No prior Full backup Job record found.
22-Sep 10:50 csci485b-dir: No prior or suitable Full backup found. Doing FULL
backup.
22-Sep 10:50 csci485b-dir: Start Backup JobId 2,
Job=CSCI251Files.2006-09-22_10.50.48
22-Sep 10:50 csci485b-dir: Bacula 1.36.2 (28Feb05): 22-Sep-2006 10:50:56
JobId: 2
Job: CSCI251Files.2006-09-22_10.50.48
Backup Level: Full (upgraded from Incremental)
Client: csci251-fd
FileSet: "Full Set" 2006-09-22 10:49:42
Pool: "Default"
Storage: "DLTDrive"
Start time: 22-Sep-2006 10:50:50
End time: 22-Sep-2006 10:50:56
FD Files Written: 1,009
SD Files Written: 1,009
FD Bytes Written: 1,380,871
SD Bytes Written: 1,485,410
Rate: 230.1 KB/s
Software Compression: None
Volume name(s): NetBackupVol0001
Volume Session Id: 2
Volume Session Time: 1158947281
Last Volume Bytes: 3,379,193
Non-fatal FD errors: 0
SD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Backup OK
22-Sep 10:50 csci485b-dir: Begin pruning Jobs.
22-Sep 10:50 csci485b-dir: No Jobs found to prune.
22-Sep 10:50 csci485b-dir: Begin pruning Files.
22-Sep 10:50 csci485b-dir: No Files found to prune.
22-Sep 10:50 csci485b-dir: End auto prune.
*stat dir
csci485b-dir Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 2 Jobs run since started.
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 23-Sep-06 01:05 CSCI485bFiles
NetBackupVol0001
Incremental Backup 10 23-Sep-06 01:05 CSCI251Files
NetBackupVol0001
Incremental Backup 10 23-Sep-06 01:05 CSCIfaiFiles
NetBackupVol0001
Full Backup 11 23-Sep-06 01:10 BackupCatalog
NetBackupVol0001
====
Running Jobs:
No Jobs running.
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
========================================================================
1 Full 974 1,739,550 OK 22-Sep-06 10:49 CSCI485bFiles
2 Full 1,009 1,380,871 OK 22-Sep-06 10:50 CSCI251Files
====
*quit
csci485b:~# exit
Script done on Fri Sep 22 10:51:33 2006
***** At this point I am manually ejecting and
***** re-inserting the tape
Script started on Fri Sep 22 11:11:49 2006
csci485b:~# bconsole
Connecting to Director csci485b:9101
1000 OK: csci485b-dir Version: 1.36.2 (28 February 2005)
Enter a period to cancel a command.
*stat dir
Using default Catalog name=MyCatalog DB=bacula
csci485b-dir Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 3 Jobs run since started.
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 23-Sep-06 01:05 CSCI485bFiles
NetBackupVol0001
Incremental Backup 10 23-Sep-06 01:05 CSCI251Files
NetBackupVol0001
Incremental Backup 10 23-Sep-06 01:05 CSCIfaiFiles
NetBackupVol0001
Full Backup 11 23-Sep-06 01:10 BackupCatalog
NetBackupVol0001
====
Running Jobs:
No Jobs running.
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
========================================================================
1 Full 974 1,739,550 OK 22-Sep-06 10:49 CSCI485bFiles
2 Full 1,009 1,380,871 OK 22-Sep-06 10:50 CSCI251Files
====
*stat storage
Automatically selected Storage: DLTDrive
Connecting to Storage daemon DLTDrive at csci485b:9103
csci485b-sd Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 2 Jobs run since started.
Running Jobs:
No Jobs running.
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
======================================================================
1 Full 974 1,840,000 OK 22-Sep-06 10:49 CSCI485bFiles
2 Full 1,009 1,485,410 OK 22-Sep-06 10:50 CSCI251Files
====
Device status:
Device "/dev/nst0" is mounted with Volume "NetBackupVol0001"
Total Bytes=3,379,193 Blocks=53 Bytes/block=63,758
Positioned at File=2 Block=0
*run
A job name must be specified.
The defined Job resources are:
1: CSCI485bFiles
2: CSCI251Files
3: CSCIfaiFiles
4: BackupCatalog
5: RestoreFiles
Select Job resource (1-5): 3
Run Backup job
JobName: CSCIfaiFiles
FileSet: Full Set
Level: Incremental
Client: cscifai-fd
Storage: DLTDrive
Pool: Default
When: 2006-09-22 11:14:34
Priority: 10
OK to run? (yes/mod/no): yes
Job started. JobId=3
*
You have messages.
*mess
22-Sep 11:14 csci485b-dir: No prior Full backup Job record found.
22-Sep 11:14 csci485b-dir: No prior or suitable Full backup found. Doing FULL
backup.
22-Sep 11:14 csci485b-dir: Start Backup JobId 3,
Job=CSCIfaiFiles.2006-09-22_11.14.37
22-Sep 11:14 csci485b-sd: CSCIfaiFiles.2006-09-22_11.14.37 Error: block.c:552
Write error at 2:1 on device /dev/nst0. ERR=Input/output error.
22-Sep 11:14 csci485b-sd: CSCIfaiFiles.2006-09-22_11.14.37 Error: Backspace
record at EOT failed. ERR=Input/output error
22-Sep 11:14 csci485b-sd: End of medium on Volume "NetBackupVol0001"
Bytes=3,443,705 Blocks=54 at 22-Sep-2006 11:14.
22-Sep 11:14 csci485b-sd: Job CSCIfaiFiles.2006-09-22_11.14.37 waiting. Cannot
find any appendable volumes.
Please use the "label" command to create a new Volume for:
Storage: DLT
Media type: DLT
Pool: Default
*umount
Automatically selected Storage: DLTDrive
3001 Device "/dev/nst0" unmounted.
*mount
Automatically selected Storage: DLTDrive
3905 Device /dev/nst0 open but no Bacula volume is mounted.
If this is not a blank tape, try unmounting and remounting the Volume.
*stat dir
csci485b-dir Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 3 Jobs run since started.
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 23-Sep-06 01:05 CSCI485bFiles *unknown*
Incremental Backup 10 23-Sep-06 01:05 CSCI251Files *unknown*
Incremental Backup 10 23-Sep-06 01:05 CSCIfaiFiles *unknown*
Full Backup 11 23-Sep-06 01:10 BackupCatalog *unknown*
====
Running Jobs:
JobId Level Name Status
======================================================================
3 Full CSCIfaiFiles.2006-09-22_11.14.37 is waiting for an appendable
Volume
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
========================================================================
1 Full 974 1,739,550 OK 22-Sep-06 10:49 CSCI485bFiles
2 Full 1,009 1,380,871 OK 22-Sep-06 10:50 CSCI251Files
====
*stat stoer[K[Krage
Automatically selected Storage: DLTDrive
Connecting to Storage daemon DLTDrive at csci485b:9103
csci485b-sd Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 2 Jobs run since started.
Running Jobs:
Full Backup job CSCIfaiFiles JobId=3 Volume="" device="/dev/nst0"
Files=55 Bytes=122,017 Bytes/sec=1,099
FDReadSeqNo=434 in_msg=293 out_msg=5 fd=8
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
======================================================================
1 Full 974 1,840,000 OK 22-Sep-06 10:49 CSCI485bFiles
2 Full 1,009 1,485,410 OK 22-Sep-06 10:50 CSCI251Files
====
Device status:
Device "/dev/nst0" open but no Bacula volume is mounted.
Device is BLOCKED waiting for appendable media.
Total Bytes Read=0 Blocks Read=0 Bytes/block=0
Positioned at File=0 Block=0
*umount
Automatically selected Storage: DLTDrive
3001 Device "/dev/nst0" unmounted.
*mount
Automatically selected Storage: DLTDrive
3905 Device /dev/nst0 open but no Bacula volume is mounted.
If this is not a blank tape, try unmounting and remounting the Volume.
*stat sto
Automatically selected Storage: DLTDrive
Connecting to Storage daemon DLTDrive at csci485b:9103
csci485b-sd Version: 1.36.2 (28 February 2005) alpha-unknown-linux-gnu debian
3.1
Daemon started 22-Sep-06 10:48, 2 Jobs run since started.
Running Jobs:
Full Backup job CSCIfaiFiles JobId=3 Volume="" device="/dev/nst0"
Files=55 Bytes=122,017 Bytes/sec=890
FDReadSeqNo=434 in_msg=293 out_msg=5 fd=8
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
======================================================================
1 Full 974 1,840,000 OK 22-Sep-06 10:49 CSCI485bFiles
2 Full 1,009 1,485,410 OK 22-Sep-06 10:50 CSCI251Files
====
Device status:
Device "/dev/nst0" open but no Bacula volume is mounted.
Device is BLOCKED waiting for appendable media.
Total Bytes Read=0 Blocks Read=0 Bytes/block=0
Positioned at File=0 Block=0
*quit
csci485b:~# exit
Script done on Fri Sep 22 11:17:03 2006
-------------------------------------------------------------------------
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