Subject: Re: Just one file on SCSI Tapes possible?
To: None <netbsd-users@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-users
Date: 12/17/2001 12:32:58
On Mon, Dec 17, 2001 at 12:04:35PM +0100, Christoph Kaegi wrote:
> Fellow NetBSDers
> 
> I recently upgraded a Linux server to a NetBSD 1.5.2 one.
> 
> There is a HP1533A DDS-2 DAT tape drive in this machine. I
> used to do a full save at the beginning of the tape and then,
> three days later, an incremental one behind the fullsave.
> 
> While rewriting the scripts and testing them out, I realized,
> that it wasn't possible to write more than one file to the 
> tape.
> 
> The output of "mt status" always was:
> 
>  -------------------------------------- 8< --------------------------------------
>  winterthur# mt -f /dev/nrst0 status
>  SCSI tape drive, residual=0
>  ds=3<Mounted>
>  er=0
>  blocksize: 0 (0, 0, 0, 0)
>  density: 19 (0, 0, 0, 0)
>  current file number: 0
>  current block number: 0
>  -------------------------------------- 8< --------------------------------------

I think this is a bug in mt, or in ioctl handling in the kernel.
But 1.5.2 definitively can write several files to a tape, I do it quite
often on a hexabyte 8500 these days.

> 
> When I wrote the first fullsave with:
> 
>  cat /etc/backup.tape.conf | pax -w -vzf /dev/nrst0
> 
> the status was exactly the same.
> 
> If I did:
> 
>  cat $DataFile | pax -w -vf /dev/rst0
>  /bin/mt -f /dev/nrst0 fsf 1
>  cat $DataFile | pax -w -vzf /dev/nrst0 -T $TimeSpec
> 
> there was no error.
> Restoring of the first file proceeded without problems:
> 
>  -------------------------------------- 8< --------------------------------------
>  Winterthur# pax -vf /dev/nrst0
>  ...
>  -rwx------  1 ckagi   wheel      75210 Sep  7  1990 home/ckagi/pchome/tools/nort/mft.exe
>  -rwx------  1 ckagi   wheel     187344 Jul 17  1990 home/ckagi/pchome/tools/nort/ndd.exe
>  -rwx------  1 ckagi   wheel     115664 Jul 17  1990 home/ckagi/pchome/tools/nort/sd.exe
>  -rwx------  1 ckagi   wheel     135652 Jul 17  1990 home/ckagi/pchome/tools/nort/si.exe
>  -rw-r--r--  1 ckagi   wheel     984958 Nov 28  1998 home/ckagi/pchome/wrd97cnv.exe
>  drwx------  2 ckagi   wheel          0 Dec  1 23:23 home/ckagi/netlogon
>  -r-x------  1 ckagi   wheel        577 Dec  1 23:23 home/ckagi/netlogon/startup.bat
>  -rw-r-----  1 ckagi   wheel          8 Dec  1 20:45 home/ckagi/.history
>  pax: Waiting for tape drive close to complete...done.
>  pax: ustar vol 1, 1514 files, 57395200 bytes read, 0 bytes written in 128 secs (448400 bytes/sec)
>  -------------------------------------- 8< --------------------------------------
> 
> Then, when I tried to restore the second one:
> 
>  -------------------------------------- 8< --------------------------------------
>  winterthur# pax -vf /dev/nrst0
>  pax: End of archive volume 1 reached
>  pax: Waiting for tape drive close to complete...done.
> 
>  ATTENTION! pax archive volume change required.
>  /dev/nrst0 ready for archive tape volume: 1
>  Load the NEXT TAPE on the tape drive
>  Type "y" to continue, "." to quit pax, or "s" to switch to new device.
>  If you cannot change storage media, type "s"
>  Is the device ready and online? > y
>  pax: Cannot identify format. Searching...
>  pax: Cpio file name length 11826 is out of range
>  pax: Invalid header, starting valid header search.
>  pax: Cpio file name length 36580 is out of range
>  pax: Cpio file name length 42814 is out of range
>  pax: Cpio file name length 8285 is out of range
>  pax: Cpio file name in header is corrupted
>  pax: Cpio file name length 9126 is out of range
>  pax: Cpio file name length 64276 is out of range
>  pax: Cpio file name length 16617 is out of range
>  pax: Cpio file name length 60960 is out of range
>  pax: Cpio file name length 55739 is out of range
>  pax: Cpio file name length 51102 is out of range
>  pax: Cpio file name length 41396 is out of range
>  pax: Cpio file name length 33945 is out of range
>  pax: Cpio file name length 47186 is out of range
>  pax: Cpio file name length 6065 is out of range
>  -------------------------------------- 8< --------------------------------------
> 
> Can it really be, that NetBSD 1.5.2 can't write more than one file
> to a tape? 
> 
> I was very surprised that it seems like NetBSD doesn't support writing
> more than one file to a tape.
> Please tell me that I am doing something wrong!

I'm not sure what the problem is. I use dump, not pax.
Maybe try a 'mt rewind; mt fsf 1' between the two pax reading the tape ?

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--