Tape manipulation under Linux? Q's about mt and tar

Tape manipulation under Linux? Q's about mt and tar

Post by Andrew Pa » Sun, 30 Jun 1996 04:00:00



Hello!  I've recently bought and installed an HP Colorado T1000 (using
the FDC) on my system, for the purpose of doing full backups and bulk
archiving under both Win95 and Linux (using separate cartridges, of
course :).  The drive came with software for dos and windows, but as
usual, was left to my own devices (no pun intended :) as far as using
it under Linux was concerned.

I've read up on the Ftape HOWTO, and can work with the tape via the
'mt' and 'tar' commands.  'mt' successfully erases, rewinds, and
retensions the tape, and tar can read/write data from the drive just
fine.  However, I cannot seem to get the drive to store multiple
archives.  'mt -f /dev/nftape fsf(m) [some number]'  doesn't get any
sort of response from the tape (isn't it supposed to seek out the
beginning of the next file or end of the current file, respectively?).
It doesn't give an error, but just sits there, and I get the shell
prompt back after a second or so.  But whenever I tar a file to it,
it'll seem to erase the previous file, because I can never retrieve
more than one file from the cartridge.  Ie. I'd tar a small file to
the drive, to a 'mt -f /dev/nftape fsfm 1" (no response from the tape)
and then tar another file.  Then I rewind the tape.  But whenever I
extract from the tape, I always get the LAST file I put on there, as
if it is overwritting the previous file(s).

Any advice or pointers to helpful advice would be appreciated!  Thank
you!

Andrew

 
 
 

Tape manipulation under Linux? Q's about mt and tar

Post by Andrew Pan » Tue, 02 Jul 1996 04:00:00


Quote:

> : I've read up on the Ftape HOWTO, and can work with the tape via the
> : 'mt' and 'tar' commands.  'mt' successfully erases, rewinds, and
> : retensions the tape, and tar can read/write data from the drive just
> : fine.  However, I cannot seem to get the drive to store multiple
> : archives.  'mt -f /dev/nftape fsf(m) [some number]'  doesn't get any
> : sort of response from the tape (isn't it supposed to seek out the

> Make sure you've done an mt erase on the tape and it *should* work.

I have erased the tape -- it erases fine, and like I said, I can
read/write one tar file to the tape just fine.  I just can't seem to get
mt to position it.  I'm using an HP Colorado T1000, if it helps any, and
this is under Red Hat 3.0.3, Kernel 2.0.0, ELF.

Quote:> However, there are numerous posts by people saying they can't position
> the tape, but I don't know how many of these have erased the tape.

Well, maybe it's the syntax?  I have a /dev/ftape, which is a link to
something like /dev/nrftape and a /dev/nftape.  Can't be exact at this
time, as I'm not on my Linux system.  I had done a "mt -f /dev/nftape
erase" and the drive whirred back and forth a few times, then stopped.  
So I'm guessing that it worked, since erasing under dos does the same thing.

In a way, this doesn't really affect my ability to do a full backup under
Linux, but I *would* like to be able to do incremental backups and
archiving, too.  Any additional help would be greatly appreciated.  Thanks!

Andrew

 
 
 

Tape manipulation under Linux? Q's about mt and tar

Post by Philippe Troi » Tue, 02 Jul 1996 04:00:00


[Followups redirected to comp.os.linux.setup only as this is a purely
linux-related]

[snip]

    Andrew> I've read up on the Ftape HOWTO, and can work with the
    Andrew> tape via the 'mt' and 'tar' commands.  'mt' successfully
    Andrew> erases, rewinds, and retensions the tape, and tar can
    Andrew> read/write data from the drive just fine.  However, I
    Andrew> cannot seem to get the drive to store multiple archives.
    Andrew> 'mt -f /dev/nftape fsf(m) [some number]' doesn't get any
    Andrew> sort of response from the tape (isn't it supposed to seek
    Andrew> out the beginning of the next file or end of the current
    Andrew> file, respectively?).  It doesn't give an error, but just
    Andrew> sits there, and I get the shell prompt back after a second
    Andrew> or so.  But whenever I tar a file to it, it'll seem to
    Andrew> erase the previous file, because I can never retrieve more
    Andrew> than one file from the cartridge.  Ie. I'd tar a small
    Andrew> file to the drive, to a 'mt -f /dev/nftape fsfm 1" (no
    Andrew> response from the tape) and then tar another file.  Then I
    Andrew> rewind the tape.  But whenever I extract from the tape, I
    Andrew> always get the LAST file I put on there, as if it is
    Andrew> overwritting the previous file(s).

This is typically what I do:

        mt -f  /dev/nftape erase                # erase the tape
        mt -f  /dev/nftape rewi                 # rewind (unnecessary)
        tar cf /dev/ftape <...>                   # Tar some stuff
        mt -f  /dev/nftape eom                  # Go to end of media
        tar cf /dev/ftape <...>                   # Tar some stuff
        mt -f  /dev/nftape eom                  # Go to end of media    
etc...

Notice that:

1) I use mt eom with the non-rewinding device to go to the end of the
tape. The way the driver is written, the tape doesn't actually seek
immediately, the seek will take place before the next read or write.

2) I use the rewinding device so that after writing to the tape, the
headers are immediately updated with the new eof marks. Theorically,
it's not mandatory, but I had enough problems with non-updated
headers...

Hope that helps.

Phil.