Link to home
Start Free TrialLog in
Avatar of rdelrosario
rdelrosario

asked on

Need Disk Cloning Software for Linux. Specifically want to clone Trixbox/Asterisk Servers

I need a Linux "ghosting" program for Disaster Recovery.   We use Ghost for our Windows environment, but it doesn't quite work well with linux.   Specifically we are building linux Trixbox/Asterisk servers.   We've used ghost and it seemed to work, but we had a few goofy errors come up in the restored image that we can't seem to get rid of.

I'm looking for tried and proven Linux cloning software (shareware preferred, but not required.. if its worth its cost.).   We've tried Acronis Disk Cloning with no luck, Ghost 11 and all version prior.   My last resort is to using a RAID card setup as Raid 1.   Pop the mirrored drive out and put it on the shelf then have the box re-mirror to a new drive.   I'd rather have a software cloning program setup.

Users with real world experience with linux cloning only reply.   Please don't list sited of links to software that you've googled.   I'd like to hear your experiences and recommendations.

Thanks
Avatar of ravenpl
ravenpl
Flag of Poland image

1. ghost was working well with linux for me(ghost run from bootable cd).
2. since ghost is not free, currently I use following approaches. I'm not saying they are easy as click and done, but are woring fine for me.
If You look for really easy restore procedure, don't follow.

backup is done with simply taring/gziping whole filesystem. Restore requires partitioning, formatting, untaring, possibly fstab grub.conf changes, reinstalling grub.
This however have one limitation, backup lasts a while, therefore it's inconsistent(usually does not matter).
Where I could, I have configured LVM snapshot feature. snapshot are mounted in new directory tree, then backup is done. However restoring such backup is more tricky as requires additional LVM setup step.

Also beside tar/gzip You can use rsync to another server.
Avatar of rdelrosario
rdelrosario

ASKER

not my cup of tea.
If your drive geometry is absolutely the same (i.e. you'll replace a crashed drive with the same model), you can just use dd to do a low-level copy of the drive and pipe the results through gzip to compress the image.
I think 2 comments is too earlier to determine that there really isn't a product out there that does this already.  C'mon,  linux has been around for a long time and there are dozens of cloning products for NTFS.   I'm still holding my hat for more people to chime in.

However, regarding m1tk4's response.   Can you give me exact instructions on how to use dd and piping through gzip.   I'm talking about exact syntax and procedures.  I can give it a try to see if its worthwhile.   I do have identical drives.
dd will not work if it's live system! The image is going to be corrupted!
In case of tar/rsync it can happen that one file is newer than the other(as backup is done one file after another) - usually fine.

I undestand that booting into single uer mode, or running liveCD to just bakup Your system is not an option...
The syntax would be like

dd if=/dev/hda conv=sync,noerror bs=64k | gzip -c /path/to/output/file/hda.img.gz

replace the /dev/hda with the your HDD device. Note that you'll need to backup everything, including the partition table, so you need to do /dev/hda and not /dev/hda1, /dev/hda2 and so on.

2 other things to remember -

- the drive should be unmounted when you do dd. dd and gzip are typically on rescue disks so you can boot from the CD in recovery mode, unmount all partitions on the drive and create an image. Imaging the currently working drive would work too, but most likely you'll end up with slightly corrupt ext2/3 filesystem since your partition/node list will be imaged about 5 minutes prior to the actual files and your log files and other files that are written during imaging will be corrupt.

- obviously, the created image file needs to be on another drive.

the reverse procedure is

gzip -x /our/backup/file.img.gz | dd of=/dev/hda conv=sync,noerror bs=64K

BE VERY CAREFUL WITH DD - YOU CAN EASILY WIPE OUT YOUR WHOLE DRIVE IF YOU MIX UP THE PARAMETERS!
If it's an option to boot to a livecd I'd use g4l.  I've been using it for a while with good luck.  If that's not an option I'm not sure what to suggest.  There's a program for windows that I've used a little called SelfImage that could clone a live drive.  The author has expressed interest in porting it to Linux but I don't know how far he is.
ASKER CERTIFIED SOLUTION
Avatar of PCMAC
PCMAC

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

  Depending on exactly what you want to do, there are several options.

  I use BackupPC (http://backuppc.sourceforge.net) to do live backups of production servers.

  If you're doing disaster recovery, you can boot to any boot disk with the appropriate drivers and try:

Identical size drives, or the destination is larger than the source:

cat /dev/hda > /dev/hdb

identical sized partitions:

cat /dev/hda1 > /dev/hdb1

Replace the source and destination with the appropriate devices.

The cat method is roughly the same as the dd method mentioned in another comment, but it's easier to remember.

If you want to make an image of a drive for later restoration, you can tar it.  In the following example, /dev/hda1 is the drive you want an image of.  /dev/hdc1 is another drive with enough space for the entire image of the first device.

mkdir /mnt/hda1
mkdir /mnt/hdc1
mount /dev/hda1 /mnt/hda1
mount /dev/hdc1 /mnt/hdc1

cd /mnt/hda1
tar cvpzf /dev/hdc1/my_drive_image.tar.gz .

To restore this, format a destination disk, and then do:

mkdir /mnt/hda1
mkdir /mnt/hdc1
mount /dev/hda1 /mnt/hda1
mount /dev/hdc1 /mnt/hdc1
cd /mnt/hda1
tar xvpzf /mnt/hdc1/my_drive_image.tar.gz

You'll probably need to rewrite the MBR as appropriate for your boot loader.  For lilo, I'd do:
lilo /mnt/hda1/sbin/lilo -r /mnt/hda1

I've also used the Trinity Rescue Kit (http://trinityhome.org) with some good success on failing drives.  In particular, I had a customer machine, where the drive was clicking.  The above cat method would fail when it encountered the bad spot on the disk.  The TRK has some good utilities that gracefully recover from these errors, although the data in those spots will be missing or corrupt.  In this customer case, it was a WinXP Professional machine I was trying to save.  It was successful.  The customer was very happy, and even more so that we went from an old 20Gb drive to a 250Gb drive.  Instructions for the TRK method are available on their site.

In any case of what you decide, try it out BEFORE you need to do it.  It's good to practice it in advance of a disaster, so you will be comfortable with the method when the time comes.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm using g4u with a lot of success so I haven't been considering  any other cloning tool for a long time.

http://fbim.fh-regensburg.de/~feyrer/g4u/

Anything that other experts are recommending would probably do the trick. g4l sounds interesting. Googling around I found some interesting thing:

http://www.feyrer.de/g4u/g4l.html
Just a response to the last question.  I believe the latest release of g4l clears that up.  When you boot it has a screen covering some of those points and it sounds like it's been largely rewritten but it does specifically mention g4u.
Many mentione of Acronis software... as mentioned in my initial post... used it with NO LUCK.  It is very picky on hardware and external USB hd which we tried to image to.  Other re-occuring themes in responses to my post is "what I'm trying to do or want".....  What I'd like is a bootcd where I can boot to and image the entire hd to another internal hd or external hd.... just like ghost.   You image the source drive click click click and your done.   I was just wondering if the linux world had a graphical imaging tool (besides acronis) that already does this.

I'm again suggest looking at g4l.  No, it does have have mouse support.  I don't think it does at least.  However it's all menu driven except for startup.  By default it boots you to the command line and tells you that you can type g4l to run it.  Type g4l, hit enter and your in the application.  After that it's all menu driven.  I've used it successfully both to clone internal drives as well as to clone to a usb drive and via FTP to an image on a network share.  This is all done using the intuitive menuing system.
What you want is mkcdrec from sourceforge -- you have to get all the recordings and extra stuff off the asterisk box so it will fit on a dvd.  Still, I think it's easier to break the mirror and restore it on exact duplicate systems.  http://sourceforge.net/projects/mkcdrec/
After hearing many posts on how well Acronis works... and hearing that there was a problem with the version we were using... we went ahead and bought the latest version and for whatever reason this version works great.   However, when restoring the image to another system (almost identical) it re-detects the NIC cards even though they are identical (same motherboard) each and every time.  It still works though.  If someone knows how to properly address the CONFIGURE, IGNORE, REMOVE popup screen when going through new hardware detect.. that would be cool.

To be fair... I split the points to the first two who mentioned acronis.