clone a linux drive

What is the best way to clone a mirrored drive?

I have a server built that runs on mirrored drives. I have 10 more servers that I want identical to it?  Should I pull the drives out of the extra 10 and put them in my first system, then run dd?  Will dd let me copy a drive that I'm running from?

That is what I'm thinking of trying.  Is this the best way to do it?  The OS is Ubuntu.
Who is Participating?
Fadi SODAH (aka madunix)Connect With a Mentor Chief Information Security Officer, CISA, CISSP, CFR, ICATE, MCSE, CCNA, CCNP, CCIP, SCSC and SCECommented:
as said before you can use multiple tools to image/backup linux system  in my datacenter, i use mondo, it will do the job :

-  amanda is a great backup solution, if you're willing to spend the time to learn how to set it up and so on.  It works very well, and there's good support from their mailing list.

-Backuppc is also a nice solution for backups for a nice how to(debian) but it should work on all linux as well check out

-check bacula

Free (GPL) Software.
Filesystem supported: ext2, ext3, ext4, reiserfs, xfs, jfs of GNU/Linux, FAT, NTFS of MS Windows, and HFS+ of Mac OS. Therefore you can clone GNU/Linux, MS windows and Intel-based Mac OS, no matter it's 32-bit (x86) or 64-bit (x86-64) OS. For these file systems, only used blocks in partition are saved and restored. For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.
LVM2 (LVM version 1 is not) under GNU/Linux is supported.
Multicast is supported in Clonezilla SE, which is suitable for massively clone. You can also remotely use it to save or restore a bunch of computers if PXE and Wake-on-LAN are supported in your clients.

-mondo (imaging tools)
Mondo is comprehensive. Mondo supports LVM 1/2, RAID, ext2, ext3, ext4, JFS, XFS, ReiserFS, VFAT, and can support additional filesystems easily: just e-mail the mailing list with your request. It supports software raid as well as most hardware raid controllers. It supports adjustments in disk geometry, including migration from non-RAID to RAID. Mondo runs on all major Linux distributions (RedHat, RHEL, SuSE, SLES, Mandriva, Debian, Gentoo) and is getting better all the time. You may even use it to backup non-Linux partitions, such as NTFS.
Mondo is free! It has been published under the GPL v2 (GNU Public License), partly to expose it to thousands of potential beta-testers but mostly as a contribution to the Linux community.

On the source server: (cd / && tar -cvf - ) | nc 2000
On the destination:: nc -l -p 2000 | tar -xvf -

-Linux Hot Copy (

We use it as backup enterprise solution with a  tape library for our environment (UNIX, AIX, Linux, Windows, Oracle, MSSQL...)

soon am gonna get storix for my unix environment, storix system backup administrator (SBA) is a graphical interface for administration of various types of backups of AIX and Linux systems. Backup Administrator is available in different configurations, providing options for standalone system, and centrally network administered network backups. SBA was designed not only to backup data files to a network server, but to also provide the ability to reinstall a complete system from scratch while providing the flexibility needed to restore the backup onto a different hardware environment. SBA supports all major filesystems, Logical Volume Manger (LVM) and software RAID devices (meta-disks).

robthewolfConnect With a Mentor Commented:
I would use dd too.  It will make identical copies of the data on the disks.  
When you say you have mirrored drives do you main some sort of raid?  
I am going to assume you have 11 servers each with two disks in.  
the first server is installed how you want it and the mirrored drive is an exact copy of the master.
pull 1 drive out of each system and use dd to copy the data from your original master to a new disk.
once you have it copied place it in its original machine (server 2) and check that its working and the raid is mirroring it.  You shouldnt need to copy the second drive as the raid software/ hardware should handle it.  once you have two machine up and running i you can copy in parallel
torimarConnect With a Mentor Commented:
The Linux 'dd' command is extremely powerful and, since it does not ask for a confirmation to overwrite any kind of device with any kind of data, extremely dangerous.
(There are reasons why Linux/Unix guys have been referring to 'dd'  as signifying "disk destroyer" or "delete data")

So unless you can guarantee for yourself that you will always know what you are doing and never be distracted even for a second, I'd suggest to not use 'dd' directly, but use one of the many program tools that were created which basically apply 'dd' in the low cloning level, but provide an interface to the user which helps avoid errors and misuse.

One such program is CloneZilla:

Another famous tool is MondoRescue ( ). Basically a backup tool, it also works for restoring images to wiped drives with different disk geometry, so basically supports cloning to other systems as long as the specs are compatible:

If you wish to test Clonezilla, I suggest to use the Parted Magic live CD:
It also contains other Linux cloning tools, like G4L and partimage.
It can also be used for 'dd', 'ddrescue' and 'dd_rescue' which are best applied to unmounted disks.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

md168Author Commented:
I tried DD, but it won't boot from the new drives.  

I will try clonezilla next.  

I tried DD, but it won't boot from the new drives.

What went wrong?
I could think of two possible issues:

1. Grub errors
Unfortunately, Grub uses unique identifiers (UUID) to denominate partitions. On a new hard disk, these identifiers will change. So if your Grub refuses to boot and dumps you to the Grub prompt, you will have to manually boot the system and update Grub.

2. Problems with RAID
If encountering RAID problems, I'd suggest to test MondoRescue first (I linked to it above) because it supports both hardware and software RAID. Clonezilla, as far as I know, supports only hardware raid.
md168Author Commented:
I don't know why DD failed.  It wouldn't boot from the drives.  

Clonezilla is working.

thanks for the help everyone!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.