[comp.unix.sysv386] Best way to backup SCO Xenix/UNIX

aris@tabbs.UUCP (Aris Stathakis) (03/29/91)

The title says it all.  What *IS* the best way to do a backup?  At the 
moment all I do is make sure I keep all important data on a seperate
filesystem, then periodically backup up that filesystem using tar.
If I ever had a crash, i'd have to re-install the Operating System
(Xenix 386 2.3.3) then restore my data from tape.

I'd like to know the best way to do a backup so that I can recover from
a FULL crash i.e. having to re-install on a different machine from 
a tape backup.  I'm sure there are lots of ways to do it, like using
the standard backup proggram SCO give you, but find it too inflexible.

There are several commercial programs that do this kind of thing for
you (ctar, Lone tar), but they cost money :-)

I'm basically looking for the best way(s) to do a secure backup for
a quick recovery from a crash.  Any other interesting information
on backup methodology would also be appreciated.  If it helps, I'm
backing up to a 150 meg tape drive.

Post here or mail me direct, i'll post a summary if there is any
interest.

Thanks

Aris

-- 
 Aris Stathakis | Bang: ..!uunet!ddsw1!olsa99!tabbs!aris or aris@tabbs.UUCP
        - First time, it's a KLUDGE - The second, a trick. -  
            - Later, it's a well-established technique! -
                               -- Mike Broido, Intermetrics

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (04/02/91)

In article <aris.670179095@tabbs> aris@tabbs.UUCP (Aris Stathakis) writes:

| I'd like to know the best way to do a backup so that I can recover from
| a FULL crash i.e. having to re-install on a different machine from 
| a tape backup.  I'm sure there are lots of ways to do it, like using
| the standard backup proggram SCO give you, but find it too inflexible.

  Since you say Xenix and I've been running a bunch of these for years,
I would first say don't use tar, it skips empty directories, and they
may be needed to make things work. A new version might have cured that,
but there are other reasons.

  First, of course, you use mkdev fd to create a bootable floppy with
your current kernel and devices. When you make a new kernel for any
reason, make a new disk (don't rewrite the old one).

  For each partition take a level zero dump using the error correcting
tape device. I suggest making two and verifying them if you're paranoid.
I am, and I store one copy off site. Then take regular level one dumps
to pick up the changes. Dump saves the data a lot faster than tar, and
restores slower. Since these are disaster backups you won't restore
much, and if you do you will want reliability rather than speed.

  When/if the level one dumps get large, switch to level two. At that
point I take another level zero, and save one of my original level zero
dumps. This gives you a good full restore capability, and since it's
Xenix you have the X option to allow slow but reliable restore of
selected files.

  As an alternative for the incrementals, create a file via touch after
the level zero, and then use find and cpio to save the modified files.
The only advantage is that if you have to restore individual file often
this is a more convenient and faster way to do it. You can also use the
-mtime and/or -ctime options on find to select files. This allows taking
the level zero dumps of each individual partition, then taking one
incremental for all filesystems (if it will fit on a single tape) to
save time.

  If you use cpio use the -depth option, as it will insure correct time
modified on directories when restoring. Just in case you need it.

Summary:
  - always level zero dump
  - then level one dump or cpio
  - dump saves faster, restores slower, needs one tape/filesys
  - cpio is convenient, save all files on one tape

Example:
  from floppy boot, single user mode:
	dump 0ufk /dev/erct0 55000 /dev/hd0root
	dump 0ufk /dev/erct0 55000 /dev/ru

  incremental, single user mode highly preferred!
	(five days after level zero)
	find / \( -mtime -5 -o -ctime -5 \) -depth -print |
	cpio -oBc > /dev/erct0

Hope this isn't a lot more detail than you wanted!
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me

macleod@cmllab.rgb.sub.org (Connor MacLeod) (04/05/91)

In article <aris.670179095@tabbs>
aris@tabbs.UUCP (Aris Stathakis) wrote:

| The title says it all.  What *IS* the best way to do a backup?  At the 
| moment all I do is make sure I keep all important data on a seperate
| filesystem, then periodically backup up that filesystem using tar.
| If I ever had a crash, i'd have to re-install the Operating System
| (Xenix 386 2.3.3) then restore my data from tape.

Well... I don't know if the way I use is the best but it's ok for me.
I'm using cpio to backup my system. The advantage in using cpio instead
of tar is that cpio is able to backup special devices, too.

The syntax for using cpio is: 
cd /path_to_backup; find ./ -print | cpio -oB >/dev/rct0

I'm using 150/250 MB tapes according to the usage of my filesystems.
Make sure to use "find ./" to get a backup with relative paths. The
cpio has no option -A like tar to suppress the leading / when restoring.

The command for the restore is:
cd /path_to_restore_to; cpio -iBvdum </dev/rct0

Have a look at the various options of cpio. The ones mentioned above
are ok with me. You might change the blocksize or something else.

The tape you get when doing the backup with cpio is your complete system.
So you only have to install the basic OS - it's N1 B1 and B2 for Xenix -
and then restore your tape.

You can decide to create a bootable filesystemfloppy containing the
tools you need to set up a new harddisk so you could use this "blaster"
to build a bootable filesys on your hd in case you've had a "final" crash.

I never had a blaster disk for Xenix 'cause it's only N1 B1 and B2 to
install the basic OS but I have one for SCO Unix. To install the basic OS
of SCO Unix it'll take half an hour and a lotta disks! The blaster set
contains only of two: a bootfloppy and a filesystemfloppy with the tools
to bring up a bootable filesys (or more) on a new hd.

Rgds

-- 
Uwe Obst             # {connor|macleod}@cmllab.rgb.sub.org
(aka Connor MacLeod) # "Trust me, I know what I'm doing!" -- Sledge Hammer

ronald@robobar.co.uk (Ronald S H Khoo) (04/07/91)

macleod@cmllab.rgb.sub.org (Connor MacLeod) writes:

> The advantage in using cpio instead
> of tar is that cpio is able to backup special devices, too.

Well, one of the advantages, anyway.  Yes, cpio is a good choice.

> Have a look at the various options of cpio. The ones mentioned above
> are ok with me. You might change the blocksize or something else.

If you're running SCO Xenix 2.3.x, you'll get more cpio options if you
install SLS xnx 155b a.k.a. UFM.  Available for anon UUCP from sosco,
anon FTP from uunet.uu.net, or from whoever sells you support, I guess.

This new cpio is taken from Sys V R3.2 (in fact I think it's actually a
COFF executable) and has nice options like how big your tape is,
and lets you use huge buffers to make your tape stream nicely.  If you're
running a cartridge tape drive, there's also an improved device driver
in that update which makes multivolume backups a lot easier.

-- 
Ronald Khoo <ronald@robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)