LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Write / Read a DAT (DDS 3 / 4) tape label (https://www.linuxquestions.org/questions/linux-software-2/write-read-a-dat-dds-3-4-tape-label-618956/)

Zxarr 02-05-2008 08:42 PM

Write / Read a DAT (DDS 3 / 4) tape label
 
Greetings,

I have two tape devices:

/dev/st0 DDS4 SCSI DAT drive 20/40
/dev/st1 DDS3 SCSI DAT drive 12/24

I have used them both successfully under Fedora 8 with tar, no real issues reading / writing files to the device, have a simple little script that shows me what was written to the tape, etc, etc.

What I am wondering is if there is any way to 'label' a tape? I know that software like Veritas writes its own format, with a label at the beginning. Is there any particular format I can use to label tapes?

Will just doing the following work?

Code:

touch /tmp/LABEL-Tape02-LABEL
tar -cf /dev/nst0 /tmp/LABEL_Tape02_LABEL

<rest of backup script>  (/dev/st0)

Then to check a tape, I just do a

Code:

tar -tf /dev/st0 | grep 'LABEL*LABEL'
and it should find the first file on a tape with the name LABEL*LABEL?

The whole reason to label a tape for me, is to be able to search the files that were written to a tape and grab the correct tape. My current backup script does a tar -tf on the tape device, redirecting the output to a log file, which is then gzipped.

Anyway, thanks. :)

jlinkels 02-06-2008 08:36 PM

Writing to /dev/nst0 causes the tape NOT to rewind after writing the backup. So you correctly assumes that you first write the label file, and append it with you regular backup.

However, when you read back your label file you should do that also from /dev/nst0, not from /dev/st0. If you want to read back your regular backup, the tape should be positioned at the second block, not the first one.

You can also read from /dev/st0 so you can eject the tape after label reading, and then position the tape with the "mt asf" command. To avoid errors, it is recommended to give a rewind command to the tape drive anyway.

For years I have been backing up multiple partitions in different backup data sets using nst0. Unfortunately my tape drive became too unreliable, but until that moment it was ok.

jlinkels


All times are GMT -5. The time now is 04:21 AM.