Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Good way to recover Linux server


You didn't specify the conditions under which you are willing to set up the
recovery mechanism. Here are a few ideas based on using a live Linux CD
(like Knoppix) to image a hard drive. I do this when there is a possibility
of really screwing up a system that I am working on. This gives me a way to
put the system back to where it was when I started to work on it and enable
me to start over. These mechanisms do require me to take down the system in
order to do the imaging -- I don't know if you have that luxury.

In all scenarios, you boot from the live CD but do not mount any partitions
from the source or destination hard drive. The commands given will have to
be modified to reflect your setup and environment.

Image hard drive to remote ssh server:

dd if=/dev/hda | ssh user at remotehost /bin/dd of=/tmp/mypc_hda.img

or, using compression

dd if=/dev/hda | gzip --fast -c | ssh user at remotehost /bin/dd

Restore hard drive from remote ssh server:

ssh user at remotehost cat /tmp/mypc_hda.img | dd of=/dev/hda

or, with a compressed image

ssh user at remotehost zcat /tmp/mypc_hda.img.gz | dd of=/dev/hda

Image hard drive to Windows/Samba share:

[mount the windows/samba share]

dd if=/dev/hda | split -b 100000000 - /mnt/remote_share/mypc_hda.img.

(note the period on the end is significant! the splitting gives a series of
100MB files and guards against some systems inability to deal with files
greater than 2GB in size (and yes, you could specify a size bigger than
100MB and feed the output of the dd into a compress and then into split))

Restore hard drive from Windows/Samba share:

[mount the windows/samba share]

cat /mnt/remote_share/mypc_hda.img.* | dd of=/dev/hda

Note: There is some potential benefit to imaging the MBR and the partitions
separately. The above methods get the whole disk, including the MBR and the
partition information. If you wanted to restore the images to a larger disk,
using the whole disk method above would result in partitions like the
original disk. By backing up the MBR and partitions separately, you can skip
the MBR restore (thereby maintaining any new partitioning scheme) and
restore the partition images to larger partitions on the new disk.

Hope this gives you some ideas.

Best regards,

Ted Swoyer
tswoyer at

Computer Support, Consulting and Training
for Businesses and Individuals
(978) 667-8558

----- Original Message ----- 
From: "snagao" <snagao at>
To: <discuss at>
Sent: Thursday, August 11, 2005 9:40 AM
Subject: Good way to recover Linux server

> I am looking for a good way to recover a server - especially in a DR
scenario.  For my AIX servers, I use the mksysb utility to make a bootable
image of the OS.
> I know Linux doesn't have anything equivalent to AIX's mksysb command, but
can someone please recommend a tool or method for me to back up the OS and
recover it quickly for DR testing?
> My thanks in advance to all those who respond.
> - sharon
> _______________________________________________
> Discuss mailing list
> Discuss at

BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!

Boston Linux & Unix /