[Suns-at-Home] Backup
Brian P. Costello
costellob@asme.org
Sun, 24 Dec 2000 23:27:39 -0800
You can create your own script using the ufsdump command. This assumes
that your tape drive
is /dev/rmt/0
/bin/sh
mt -f /dev/rmt/0n rewind #rewind the tape
ufsdump -0uf /dev/rmt/0n / #backup / using non-rewind
ufsdump -0uf /dev/rmt/0n /usr # backup /usr using non-rewind
ufsdump -0uf /dev/rmt/0n /usr/openwin #backup /usr/openwin using
non-rewind
ufsdump -0uf /dev/rmt/0n /var # backup /var using non-rewind
ufsdump -0ouf /dev/rmt/0 /export/home # backup /export/home using
rewind, take it offline
This will first make sure the tape is rewound, then it will create 5
dump files
on the tape, one after the other. If and when ufsdump runs out of room
on one tape, it
will prompt for another. That way you really don't have to match
partition sizes up with
tape sizes. The ufsdump command will back up all character special files
like those in /dev, tar will not
The restore process is a little more involved, especially if the system
was completely hosed
and you just reformated the system disk. Assuming all the partitions are
already there and
newfs'ed, you will have cd to /, make sure the tape is set to file 0 (or
completely rewound),
then restore /
# cd /
# mt -f /dev/rmt/0n asf 0
# ufsrestore -rvf /dev/rmt/0n
At this point the partition directory names are there, cd to the next
partition to
be restored (we know this to be /usr from our script) I ALWAYS write
down the
file sequence on the tape since I am usually pretty stressed at this
point if I am
recovering from a crash. Then repeat. You don't really have to run the
mt commands
since all they do is make sure the tape is set to the correct file
number on the tape. By
using the non-rewind device the tape is already at the correct location,
but I like to
be extra careful. I have had my share of mistakes and it ain't pretty
restoring data to
the wrong partition.
# cd /usr
# mt -f /dev/rmt/0n asf 1
# ufsrestore -rvf /dev/rmt/0n
# cd /usr/openwin
# mt -f /dev/rmt/0n asf 2
# ufsrestore -rvf /dev/rmt/0n
# cd /var
# mt -f /dev/rmt/0n asf 3
# ufsrestore -rvf /dev/rmt/0n
# cd /export/home
# mt -f /dev/rmt/0n asf 4
# ufsrestore -rvf /dev/rmt/0n
# mt -f /dev/rmt/0 offline
The last mt command will rewind the tape and kick it out of the drive.
At this point you should be good to go. If you replaced the system disk
you will probably have to re-create the bootblock with the following
command:
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk
/dev/rdsk/c0t3d0s0
good luck
After using most of my contacts, friends (in this forums there's loads!)
and
relatives and using up most of my swearwords (inventing a few new ones
on he
way), I have now managed to install/cofingure a Sol8-system on my Sparc
20,
installing new PROM, processor etc etc (I am quite pleased with myself!
:-) ).
One of the few things remaining to me, is making a backup, so I can
avoid a
cock-up..if you know what I mean.. ;-)
I have access to a external 2 Gb DAT-player, and I now need a backup
script.
The computer I have is a Sparc 20, 2 internal harddisks. a 4 Gb one,
which
holds the main operating systems (4 partitions) and a 1Gb-disk for my
home-directory.
While I have a simple & rough script which may work, I really would like
to
have a script which compares the available size on the DAT-tape to the
amount of backup needed. And which copies "full" partitions on the one
tape,
avoiding the: half-partition-on-that-tape, half-partition-on-the-other
syndrome.
Any helpers out there?
Sinc: Magnus Svantesson
--
Brian P. Costello costellob@asme.org
San Francisco Bay Area http://costello.mine.nu