Fedora Linux Support Community & Resources Center
  #1  
Old 16th June 2005, 10:44 PM
tony Offline
Registered User
 
Join Date: Jan 2005
Posts: 11
Angry SCSI Tape Drive

Hi,

I have a Compaq DL380 R01 server with a HP Surestore DAT40 sat in it.

I am running Fedora Core 4.

Basicaly i cant see any mention of the SCSI or tape drive anywhere in the dmesg or anywhere. I know the drive is working because it is picked up when the system boots.

Also when i put a tape in it reads it, then sits there and waits.

I am getting really frustrated and i ave spent the last 4 hours trying to work out what to do with it.

Can anyone help?

Kind Regards

Tony
__________________
Tony
tony@ukcube.com
www.ukcube.com
Reply With Quote
  #2  
Old 18th August 2005, 10:20 PM
The_Mentor Offline
Registered User
 
Join Date: Aug 2005
Posts: 5
Can this help you???

How to use your Tapedrive
Several of our Linux workstations are equiped with a tape drive. Tapes are normally used to exchange data, for backups Netbackup is the preferred solution. See How to install Netbackup.
• Devices
• Samples with tar
• Multiple files on the same tape
• Backup across multiple tapes
• Using cpio
• find the content of a tape
________________________________________

All tapedrives are attached over a SCSI-controller. To access a tape, choose the right devicenode:
• /dev/st0 Linux 2.2 / D-PHYS1, first tapedrive, rewinds when closed
• /dev/nst0 Linux 2.2 / D-PHYS1, first tapedrive, leaves tape when closed
Currently all machines equiped with a tapedrive are running Linux 2.2. Come back to this tutorial after our upgrade of those workstations!

To save and restore data on tape, we use tar, mt and cpio. dump is not discussed here - it should not be used in Linux >= 2.4 against a mounted filesystem.
________________________________________

Now put a fresh cartdrige of the right type in your tapedrive and go through this tutorial:
check if the tape is online
me@host:~$ mt -f /dev/st0 status
drive type = Generic SCSI-2 tape
drive status = 318767104
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 0 bytes. Density code 0x13 (DDS (61000 bpi)).
Soft error count since last status=0
General status bits on (45010000):
BOT WR_PROT ONLINE IM_REP_EN

A cartdrige is inserted and ready to write. Because we used /dev/st0, the tape is now positioned at the beginning.
save the content of a directory
We have a directory sample in our home containing several files. Lets put them on the tape:

me@host:~$ tar cvf /dev/st0 sample
sample/
sample/picture.jpeg
sample/text.txt
sample/source.c
list the files on the tape
me@host:~$ tar tvf /dev/st0
drwxr-xr-x me/mygroup 0 2003-10-31 12:54:22 sample/
-rw------- me/mygroup 54864 2003-10-31 12:53:56 sample/picture.jpeg
-rw-r--r-- me/mygroup 1297 2003-10-31 12:54:03 sample/text.txt
-rw-r--r-- me/mygroup 58 2003-10-31 12:54:22 sample/source.c

eject the cartdrige
me@host:~$ mt -f /dev/st0 rewoffl

The cartdrige will be rewinded and ejected by the tapedrive. It's now time to lable your cartdrige. It's really difficult to extract the information about a tape without knownlege how it was written! May be that it's also the time to write protect the cartdrige.
restore the files
Reinsert the cartdrige in the tapedrive.
me@host:~$ tar xvf /dev/st0
sample/
sample/picture.jpeg
sample/text.txt
sample/source.c

We have now restored the content of the archive on tape.
restore a single file
me@host:~$ tar xvf /dev/st0 sample/source.c
sample/source.c

Only the file source.c was restored. Be careful - you need to give the exact filname(s) to tar and it takes often a long time to scan the tape until tar find the right file.
________________________________________

Now some more sophisticated exemples. A cartdrige may contain more then one file. So you may put more then one backup on the same cartdrige. Now we use no longer /dev/st0 which rewinds the tape after usage, instead we use /dev/nst0 which leaves the tape on the position when closed.
check if the tape is online
me@host:~$ mt -f /dev/st0 status
drive type = Generic SCSI-2 tape
drive status = 318767104
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 0 bytes. Density code 0x13 (DDS (61000 bpi)).
Soft error count since last status=0
General status bits on (45010000):
BOT WR_PROT ONLINE IM_REP_EN
save a directory
me@host:~$ tar cvf /dev/nst0 sample
sample/
sample/picture.jpeg
sample/text.txt
sample/source.c

This is now our first file on the tape. Because we used /dev/nst0, tape is now positioned at the end of this file.
save another directory
me@host:~$ tar cvf /dev/nst0 moresample
moresample/
moresample/source.c
moresample/binary

This is now our second file on the tape.
eject the cartdrige
me@host:~$ mt -f /dev/st0 rewoffl

Now it's the time to lable the cartdrige. There is now way to "see" how many files are on a tape.
restore the files
Restore from the first backup is simple. But we restore now the files from the second :-)
me@host:~$ mt -f /dev/nst0 fsf 1
me@host:~$ tar xvf /dev/nst0
moresample/
moresample/source.c
moresample/binary
me@host:~$ mt -f /dev/nst0 rewind

First we forward the tape to the second file. Then we restore the data and at the end we rewind the tape. See the manpage of mt for all options how to forward / rewind a tape.
________________________________________

Often, a cartdrige is too small to hold all the data you want to save. tar knows about "multivolume" with the command line option -M and will prompt you for the next tape:

me@host:~$ tar cvfM /dev/st0 bigdir
bigdir/
bigdir/ae
bigdir/arch
bigdir/ash
...
Prepare volume #2 for `/dev/st0' and hit return:
bigdir/ln
bigdir/loadkeys
...

To list or restore such an archive, you need to give tar the option -M. So be sure to lable the cartdrige.
________________________________________

Some people prefer to write their backups with cpio. I don't. cpio is a very feature rich command, on the other hand I always need the manpage when I want to create or expand an archive. cpio expects a filelist on STDIN and creates the archive on STDOUT or expects the archive for restoring on STDIN. To save data with cpio, you allways need find to create the filelist.
save the content of a directory
me@host:~$ find sample | cpio -ov -H newc > /dev/st0
sample
sample/picture.jpeg
sample/text.txt
sample/source.c
112 blocks
list the files on the tape
me@host:~$ cpio -itv < /dev/st0
drwxr-xr-x me/mygroup 0 2003-10-31 12:54:22 sample/
-rw------- me/mygroup 54864 2003-10-31 12:53:56 sample/picture.jpeg
-rw-r--r-- me/mygroup 1297 2003-10-31 12:54:03 sample/text.txt
-rw-r--r-- me/mygroup 58 2003-10-31 12:54:22 sample/source.c

restore the files
me@host:~$ cpio -ivd < /dev/st0
sample
sample/picture.jpeg
sample/text.txt
sample/source.c
112 blocks

See the manpage of cpio for all options.
For the last time: lable the cartdrige because the format of cpio and tar are not compatible.
________________________________________

Now worst case. You have an unlabeled cartdrige in front of you and you don't know which data is on it. There are some tricks to find it out. Insert the cartdrige and find out the type of archive on it:

me@host:~$ file - < /dev/nst0
standard input: GNU tar archive

The first file on this tape is a tar archive.

me@host:~$ mt -f /dev/nst0 fsf 1

Forward tape to the next file.

me@host:~$ file - < /dev/nst0
standard input: POSIX tar archive

The second file is also a tar archive - but it seems to be created on a UNIX like Solaris.

me@host:~$ mt -f /dev/nst0 fsf 1

Forward tape to the next file.

me@host:~$ file - < /dev/nst0
standard input: ASCII cpio archive (SVR4 with no CRC)

The third file on this tape is a cpio archive.

me@host:~$ mt -f /dev/nst0 fsf 1

Forward tape to the next file.

me@host:~$ file - < /dev/nst0
standard input: file: read failed (Input/output error).

OK, it's the end of the tape.

me@host:~$ mt -f /dev/nst0 rewind

Now we write down our seen files:
1 GNU tar archive
2 Posix tar archive
3 cpio archive

To see the content of each file on the tape, we use now the approriate command to extract the archives:

me@host:~$ tar tvf /dev/nst0
...
me@host:~$ tar tvf /dev/nst0
...
me@host:~$ cpio -itv < /dev/st0
...

After that, you are able to lable the cartdrige :-)
Reply With Quote
Reply

Tags
drive, scsi, tape

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
scsi tape drive thedude Using Fedora 0 24th December 2006 09:23 AM
SCSI Tape Drive - DL380 tony Servers & Networking 1 20th June 2005 10:54 PM
help on scsi card for tape drive talkstock888 Hardware & Laptops 1 30th April 2005 07:50 PM


Current GMT-time: 08:19 (Sunday, 26-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat