clone a linux drive

Posted on 2010-11-27
Last Modified: 2012-08-13
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.
Question by:md168
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Assisted Solution

robthewolf earned 100 total points
ID: 34224791
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
LVL 35

Assisted Solution

torimar earned 200 total points
ID: 34224890
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.
LVL 25

Accepted Solution

madunix earned 200 total points
ID: 34226621
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).

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.


Author Comment

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

I will try clonezilla next.  

LVL 35

Expert Comment

ID: 34233016
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.

Author Comment

ID: 34252947
I don't know why DD failed.  It wouldn't boot from the drives.  

Clonezilla is working.

thanks for the help everyone!

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSL/TLS - openssl troubleshooting 3 79
Migrating a Linux server to VMware 3 140
linux convert text file to PDF 7 70
Linux: using  awk and print inside cURL 4 48
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question