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).

 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?


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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

627 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