Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-05-2008, 09:42 PM   #1
LQ Newbie
Registered: Sep 2005
Location: Ontario, Canada
Distribution: Fedora 8
Posts: 21

Rep: Reputation: 0
Write / Read a DAT (DDS 3 / 4) tape label


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?

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

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.
Old 02-06-2008, 09:36 PM   #2
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,191

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
hp usb dds tape pau_kacang Slackware 8 04-20-2006 09:54 AM
Installation of internal HP DAT 40i DDS internal tape drive netkepala Linux - Hardware 3 11-08-2004 01:22 PM
How to use a DDS-2 tape on Linux??? NeoY2k Linux - Hardware 1 10-24-2003 01:13 PM
RH9: formatting a DDS tape cleaner416 Linux - Hardware 0 09-21-2003 01:23 PM
installing a DDS/4 Tape drive dokkk_d Linux - Newbie 0 09-19-2002 09:02 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration