EmbeddedRelated.com
Forums

The easiest way to clone a Linux box

Started by Like2Learn January 6, 2011
I would like to clone a Linux box, which runs Fedora 12. What is the
easiest way to do so?

Is dd the easiest one? I got the following link.
http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/

Thank you!
Like2Learn wrote:
> I would like to clone a Linux box, which runs Fedora 12. What is the > easiest way to do so? > > Is dd the easiest one? I got the following link. > http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/
I really like Clonezilla for XP machines. It's Linux- based and I'm sure it would work well for Linux. Supports disk-disk, partition-partition and disk or partition imaging to and from a network share. And it's free.
On Thu, 6 Jan 2011, Jim Stewart wrote:

> Date: Thu, 06 Jan 2011 15:27:28 -0800 > From: Jim Stewart <jstewart@jkmicro.com> > Newsgroups: comp.arch.embedded > Subject: Re: The easiest way to clone a Linux box > > Like2Learn wrote: >> I would like to clone a Linux box, which runs Fedora 12. What is the >> easiest way to do so? >> >> Is dd the easiest one? I got the following link. >> http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/ > > I really like Clonezilla for XP machines. It's Linux- > based and I'm sure it would work well for Linux. > > Supports disk-disk, partition-partition and disk > or partition imaging to and from a network share. > > And it's free.
g4u? (NetBSD based).
On Thu, 06 Jan 2011 14:58:24 -0800, Like2Learn wrote:

> I would like to clone a Linux box, which runs Fedora 12. What is the > easiest way to do so? > > Is dd the easiest one?
dd is ideal if the source and destination drives have identical sizes. Otherwise, you'll need to resize the filesystem afterwards (and if the destination is smaller than the source, you need to ensure that nothing is actually stored in the portion which isn't copied). If cloning to a smaller drive, ordinarily I'd suggest: create a filesystem on the destination, copy the filesystem over with "cp -a", then install the boot loader. However, I don't know whether "cp -a" will copy SELinux attributes.
On Fri, 7 Jan 2011, Nobody wrote:

> Date: Fri, 07 Jan 2011 22:17:17 +0000 > From: Nobody <nobody@nowhere.com> > Newsgroups: comp.arch.embedded > Subject: Re: The easiest way to clone a Linux box > > On Thu, 06 Jan 2011 14:58:24 -0800, Like2Learn wrote: > >> I would like to clone a Linux box, which runs Fedora 12. What is the >> easiest way to do so? >> >> Is dd the easiest one? > > dd is ideal if the source and destination drives have identical sizes. > Otherwise, you'll need to resize the filesystem afterwards (and if the > destination is smaller than the source, you need to ensure that nothing is > actually stored in the portion which isn't copied). > > If cloning to a smaller drive, ordinarily I'd suggest: create a filesystem > on the destination, copy the filesystem over with "cp -a", then install > the boot loader. However, I don't know whether "cp -a" will copy SELinux > attributes.
actually, dd has some drawbacks, and so the dd_rescue project was created. dd_rescue is much more robust, and can survive surface defects in creating the bit-image backup. Having used Clonezilla, SystemRescue, g4u and dd_rescue (in addition to dd), I'd suggest g4u as being the simplest, and relatively fast. Though it has the ability to clone an entire disk, or just a partition over the wire onto an ftp server, I'd suggest that you use a directly connected hard drive to hard drive copy if you drive is over 100GB, or you'll be waiting for quite some time. If you copy a smaller drive to a larger one, you can then use SystemRescue (GParted) to re-size partion, or to re-allocate the unused portion of the drive. I've just cloned an XP disk this week, and so this is fresh in my mind just now ... #@$@#$#, and I blogged about the experience: http://www.controlq.com/blog/wordpress/?p=290 HTH, Rob Sciuk