This should be added to the FAQ!!! :)
: # cat /dev/rsd0c > /dev/rsd2c
Are they the same size?
I use the following script for my backups, where / is the drive I want to
back up and /backup is the backup drive. I'll explain in comments:
Note that /backup already has an empty filesystem.
Also, special procedures will need to be done to make this bootable.
Read your OS's manual.
--- Start of File: backup ---
#! /bin/sh
# why use anything else?
cp /etc/nologin.backup /etc/nologin
# To prevent users from getting on! Note that it may be a better idea to
# throw users off prior to this!
umount /dev/hda3
umount /dev/hdc1
umount /dev/sbpcd
# /dev/hda3 is /dos, while /dev/hdc1 is /backup. Obviously, I don't want
# to backup backup, nor do I care about /dos, so... It's also not good
# to backup CD-ROMs. You'll have to change this to reflect your system.
cd /
find ./ > /tmp/files
# My version of 'find' will cause this to create a list of all
# files/directories/devices/links on my drive. The '.' *IS* important.
# The dot will also reference /backup/etc when the current directory
# is /backup. This is important.
mount -a
# Remount everything, including /backup (how else could I copy these files?
cpio -p -d -m --b=16 /backup < /tmp/files
# Using the list of files on the primary drive, piped through cpio. cpio
# copies the files. cpio is special in that it copys links as links, devices
# as devices, etc. This prevents problems later! Also, file dates are
# correct when using these options. Note --b=16 specifies that 16 block
# chunks will be copied. You'll probably want a different value, but this
# will work - just a little slower. The -p causes it to run in copy pass-
# through mode -- Copies from one directory tree to another. This is
# the part that needs the './whatever file'.
# The -d creates the needed directories, and -m preserves the modification
# times.
rm /tmp/files
rm /backup/tmp/files
rm /etc/nologin
# some cleanup.
echo Backup Complete!
--- End of File ---
Joel Maslak
I am Pentium of Borg.
Division is futile.
You will be approximated.