Quick 'n' dirty backup of a system

Gavin Hemphill yellowdog-general@lists.terrasoftsolutions.com
Sun Oct 12 12:04:02 2003


It is quite simple really.  Lets say you have a system with a root (/) 
on /dev/hda12 and a home (/home) partition on /dev/hda13.  I've done 
backups from my TiPB to a firewire drive, remote system and a tape.
For the firewire drive (see the howto's on getting it mounted and note 
that the 2.4.20-8d works with firewire as long as you don't have the 
firewire device plugged in at boot and you have the rescan-scsi-bus.sh 
script, while the 2.4.22-2a that comes with Yellowdog 3.0.1 does not 
work well at all) have two choices: if the drive is larger than your 
root and home partitions combined you can make root and home parititions 
the same size as your internal ones on the firewire drive using pdisk; 
if it is smaller but at least 60% of the size of the combined root and 
home partitions just make one large partition.  In the first case after 
you have mkfs'd the partitions (e.g., mkfs -j /dev/sda2) and mounted 
them on a mountpoint in /mnt (e.g., /mnt/sda2  and /mnt/sda3 ) you 
simply (as root) do: cd /;tar clpf - . | (cd /mnt/sda2; tar xpf -) for 
the root partition and cd /home; tar clpf - . | (/mnt/sda3; tar xpf -) 
for the home partition.

In the second case you want to make compressed tar images on the single 
partition you created.  cd /; tar czlpf /mnt/sda2/root.tgz . and cd 
/home; tar czlpf /mnt/sda2/home.tgz .

I've just used backups similar to this to restore my YDL 3.0 system 
today after installing YDL 3.0.1 and discovering its no different than 
an uptodate 3.0 install and the the new kernel doesn't handle firewire 
properly.

To back up to tape is quite easy. Assuming you have a scsi tape 
connected to the machine and you have the same two partitions as before
you (as root) cd /; tar clpf /dev/nst0 . and then cd /home; tar clpf 
/dev/nst0 .  That will give you two files on tape containing the root 
and home partitions.

Remote systems and tapes are just more of the same see the man pages.

I've used the install disk to do recoveries by booting into the install 
then switching consoles (ctrl-option-F2) creating and mounting the new 
partitions, restoring the contents running ybin (read the man pages 
etc.).  Works like a charm.

Note: If you are putting your backup back on clean disk you will need to 
make a boot partiton for yaboot as well as the partitions for your root 
and home.  After restoring the files you will have to use the rescue 
mode and ybin to get the boot set up properly.

	G++

Alexander Holst wrote:
> Hi,
> 
> just two questions:
> 
> 1]
> Which would be the best, most simple and easiest method to backup a
> freshly installed and configured system to tape: tar or dump (or maybe
> something I haven't heared of as of yet)?
> 
> My goal is to get an image of a completely installed and custom
> configured system on tape, so I can restore it very quickly, preferably
> by booting from the YDL install CD (so I have all means of easily
> partitioning and formatting new disks).
> 
> The system in question does not see a lot of incremental stuff to be
> backed up at all (except for the log files, which would be affordable to
> loose) - all I need is an initial image of the system.
> 
> Is tar or restore available from a shell when booted off the install CD?
> I would like to be able to just boot (whatever CD), insert the tape and
> issue some commandline stuff and have my system back online.
> 
> The system I am talking about is a custom YDL 3.0 installation on an ANS
> 700/200 being used as an AppleTalk / IP router and print spooler for our
> design department here - so basically if it goes down it needs to be
> back online as quickly as possible ;) In case I shouldn't be available,
> someone else should be able to simply follow a few well documented steps
> and get the system back to its initial state in order to avoid time
> consuming point of failure detection, as well as enabling a person
> without indepth knowledge of Linux/YDL to restore the machine.
> 
> 
> 2]
> I did some testing today: is it possible that the HP DAT drive that came
> on the ANSes only performs at ~353KB/sec (that's ~20MB/min) when writing
> to it, although the SCSI bus is a fast SCSI bus, set to at least
> 10MB/sec? 353KB/sec is the number dump spit out after a test dump.
> Considering the the time it took and the amount of data written to tape,
> the quoted number seems to be accurate.
> 
> Any ideas, help or info appreciated!
> 
> Alex
> 
>