This is a copy of my two mails on scsi tape and backups with it.
If your scsi card is recognised, then watch when the system boots. It
should show what linux thinks is connected to the controller. It's
probably /dev/st0 if it's the first tape drive. At the command prompt
(logged in as root) enter:
mt -f /dev/st0 status
And check what it gives you. You can also look at:
cat /proc/scsi/scsi
to see what your controller sees.
Some of the exabytes require special commands to set density etc when
you use tar to backup. You usually enter them with the mt command.
Enter:
man mt
to see some of the commands. Some of the tape drives require setup
files, but I don't have any of those (yes!!!), so I just use mt to set
density, partitions, etc and use tar.
One thing to note, if you backup with your tape drive and need to
restore by booting the floppy and rescue disks, you might not be able
to. I hacked the rescue.img to have what I needed in it and made a new
rescue floppy. Some of the single disk rescue disks (Tom's boot disk?)
might not require this, so check some of them out and make sure you can
access the tape and do a restore to to another partition or directory to
test.
> Does anyone know of a way to make a backup image of the root drive for > recovery on
>tape.
I don't know if you can use dd to write an image to tape. I'm using tar
for backups.
At the end of this message is my program for backup to dat. The mybck
variable can be set to whatever you want it to be (I use the backup
date; 02012000). The "-n" part is just a numbering scheme. It writes
the log file to /root as whatever mybck is set to .log. 02012000-1.log
You will want to exclude things that are correct for your system (I'm
excluding /c and /d since they are win partitions). Any system created
directory (such as /proc -- you don't have to recreate anything under
/proc, but you might have to for other dirs) that is excluded must be
recreated after a restore and before you reboot, if you are restoring to
a freshly formatted partition. I backup all the "junk" in /var that you
normally wouldn't want because X writes things it needs out there. It's
easier to just back it all up since I have the room on the dat.
There are probably better ways. There are backup programs for Linux.
None of them quite did what I wanted. You can use dump and restore
which will give you incremental backups etc. It's also better to do a
complete backup under single user mode so things don't get changed, but
I don't bother since I know to stay off when I'm doing backups.
If you restore to a freshly formatted partition (booting with boot disk
and modified rescue) with this backup, you need to recreate /proc
directory and lilo. Do a chroot to where your new partition is mounted,
such as chroot /mnt/hda2. This changes you to have that device as "/".
Do the restore, then enter lilo at the prompt to write that out. If you
need to make a swap file partition also, check out the man page for
mkswap and write down what you need.
Restore would look something like:
(xxxxxx is the label name of the backup. It's the "b${mybck}" between
the "-V" and "--same-owner" on the first line of tar in the backup
sample below. I have multiple partitions and this restore would format
and restore them all, except swap. I'm typing this from memory, so there
may be mistakes here.)
> mke2fs -c /dev/hda2
> mkdir /mnt/hda2
> mount -t ext2 /dev/hda2 /mnt/hda2
> chroot /mnt/hda2
> cd /
> mke2fs -c /dev/sda5
> mke2fs -c /dev/sda6
> mkdir /mnt/sda5
> mkdir /usr
> mount -t ext2 /dev/sda5 /mnt/sda5
> mount -t ext2 /dev/sda6 /usr
> mt -f /dev/st0 rewind
> mt -f /dev/st0 compression 1
> mt -f /dev/st0 setblk 0
> tar --totals -R -V xxxxxx --same-owner -b 64 -xvpf /dev/st0 /
> mt -f /dev/st0 rewind
> mt -f /dev/st0 offline
> mkdir /proc
> mkdir /c
> mkdir /d
> lilo
reboot
backup program:
----cut here-----
#!/bin/bash
if [ $mybck = "" ]; then
echo "no mybck set... remember to set it with";
echo " declare -x mybck=whatever-n in quotes... ";
exit;
else
echo "mybck is ${mybck}"
fi
# Do the backup.
mt -f /dev/st0 rewind
mt -f /dev/st0 compression 1
mt -f /dev/st0 setblk 0
echo "backup started..." > /root/b${mybck}.log
echo `date` >> /root/b${mybck}.log
tar --totals -R -V b${mybck} --same-owner -b 64 -cvpf /dev/st0 / \
--exclude "/proc/*" --exclude "*lost+found/*" \
--exclude "/root/b${mybck}.log" --exclude "/c/*" \
--exclude "/d/*" >> /root/b${mybck}.log
mt -f /dev/st0 rewind
mt -f /dev/st0 offline
echo "backup ended..." >> /root/b${mybck}.log
echo `date` >> /root/b${mybck}.log
exit
----cut here----