[KLUG Members] backing up

Adam Williams members@kalamazoolinux.org
10 Sep 2001 21:54:42 -0400


>>>I am having a little trouble backing up.  I am using tar as follows:
>>>tar -cvzpf /dev/st0 -T /root/backup/whattobackup
>>>when I restore the files with :
>>>tar -xvzpf /dev/st0 it restores and then hangs.  When I try backup and then
>>>restore a small amount of data it completely hangs and fails on the restore. 
>>>(control c stops the hang.)
>>>The tape device is a 4mm dat.  Here is from dmesg
>>>Vendor: SEAGATE   Model: DAT    06240-XXX  Rev: 8160
>>>Type:   Sequential-Access                  ANSI SCSI revision: 03
>>>Anyone have any ideas for why it is hanging at the end of long restores and not
>>>restoring small backups at all?
>>No, but I had the EXACT same thing with the EXACT same tape drive. 
>>Fought with it forever.  A little TLC and the tape drive started eating
>>the tapes and the OEM swapped it out as a bad unit.  Works great now.
>So I should try and get it replaced then eh?
>Bummer!

Yep.  Also make sure you have the most current firmware.  On my
Netfinity servers I can go into the BIOS and do a diagnostic on the tape
drive that reports all this information,  how to get it depends on you
box and scsi card.

>>>On a side note, for network backups of files on a host without the tape drive,
>>>what is your preferred method.  I have been using tar and ssh with some luck as
>>>follows:
>>>tar -czp TEST* | ssh srv2 'cat > /BAI.unidata/BAI.accounts/TEST.tgz'
>>>but this is done to a file and not to a tape device.  Is it perfectly acceptable
>>>to do this
>>>tar -czp TEST* | ssh srv2 'cat > /dev/st0'
>>No.  You should write to the tape drive with dd so you can set the block
>>size.
>so the command would look like
>tar -czp TEST* | ssh srv2 'cat | dd of=/dev/st0 bs=32k

Why the "cat"?  Just use dd,  it reads from stdin just like cat.
 
>what block size should I use?

The size you set with "mf -f /dev/st0 setblk XYZ" in your init scripts. 
Larget blocks are faster and use space less efficiently,  and small
blocks are slower and use space more efficiently.  I set my block size
to 10248 on my 4mm drives.  Then I tell tar -b 10248 so it uses a
matching block size,  just to be on the safe side.

>Then would I still restore with
>tar -xvzf /dev/st0  ????

Other than compression in tar is evil, yes.

>>>I also noticed from man tar that you can put a hostname before a tar.   -f,
>>>--file [HOSTNAME:]F  What mechanism does this use and does it work/is it secure
>>>like with ssh.
>>rmt via rexec.  It is secure only on a Kerberos network,  on "standard"
>>networks it is hilariously not secure.