Re: [SLUG] backup and restore with dd?

From: Bob File (rfile@innet.com)
Date: Sun Dec 08 2002 - 10:37:28 EST


I am not an expert in this topic, but I am glad to see this topic started as I
have been experimenting with backups also.
One of the problems with using dd to do this is that it would copy empty bytes
as well as data, so one would need as much storage space for the image file
as the partition being backed up.
I have found a program out there called partiton image :
http://www.partimage.org/
This program will save an image of a partition into compressed files of a size
that you get to designate. It only copies data and not empty space.
This means you can set it up to save 700 meg files for storing on CD's or 95
meg for storing on zips or whatever. As of version 0.6.2 I believe that it
saves MBR as well. The partition that is to be saved is unmounted. The
storage area for the saved files is mounted. I believe this is true of both
partimage and dd. I have been saving master boot records with dd for some
time now and it seems to work just fine:
dd if=/dev/hdb of=mbr_hdb.img bs=512 count=1
Note that it is the device (hdb) and not one of the partitions on hdb.
The partition image docs recomend that you do this as well, plus save a list
of the other (extended) partitions with sfdisk:
sfdisk -d /dev/hda > backup-hda.sf
This produces a small dump file that can be fed back to sfdisk to get the
partitions sized correctly if you have to start over with an empty disk.

Partition image also works over the network. I comes with a server demon, but
so far I have only managed to get it to segfault ;-} . However, if ones boots
from the CD rom image that is available from them (partimage.org), one can
start the network and mount a directory via NFS. I tried this last night when
the server wouldn't work and saved an image to my main box from the test box.
This is a bit of work - you have to start the network from the command line.
It goes something like this:
modpobe tulip (network card driver)
ifconfig eth0 192.168.0.10 (or whatever) up
route add 192.168.0.20 eth0 (route to server for storage)
mount -t nfs 192.168.0.20:/usr/local/storage (or whatver storage path you have
configured via nfs on 192.168.0.20).
I gets a bit convlouted, but it does work. You still need to start the network
device and add a network config (ifconfig) if you use partimaged (the
server).
I am using partimage from a bootable CD. This works out well because then only
the partitions that need to be mounted are mounted after initial boot.

Hope this answers some of you questions; and if anyone sees any mistakes in
the above information, PLEASE advise.

Also check out Mondo Rescue for backups:
http://www.microwerks.net/~hugo/index.html
This program does something similar. It will backup everything including mbr
or a subset of data. It compresses data and will write to CD-RW or CD-R media
if you CD is set up correctly. I have full backup on several CD's plus I made
a script that backups my home directory, mysql databases, htdocs and /etc to
one CD-RW disk.
I haven't tried the "nuke" option yet, but I may move my writer to the
experimantal machine just to see...
Anyone else using Mondo for backups?



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:52:10 EDT