troubleshooting Question

What’s the most efficient way to clone a Linux hard drive?

Avatar of Dwight Baer
Dwight BaerFlag for Canada asked on
5 Comments1 Solution32 ViewsLast Modified:
I have about 20 hard disks to clone for a new student lab with identical hardware.  I’d like not to have to purchase any additional software.  I do have a hard drive dock which holds one hard disk.
Below is the procedure I just used and it worked, but I’m sure there’s a better way.
Starting with a “master” workstation running Ubuntu (Machine 1)
1.      Install linux on a different machine (Machine 2).  Just the initial installation, no configuration needs to be done.  (Hardware is identical to the 1st machine.)  I suppose all I’d actually need to do is format this hard disk.  But it’s a small format case and there isn’t a power connector for a second drive.
2.      Remove the hard disk (Hard disk 2) and place it in the hard drive dock.  Connect the hard drive dock to Machine 1 via USB.
3.      Boot Machine 1;  it sees Hard Disk 2 as /dev/sdb
4.      (as root) dd if=/dev/sda of=/dev/sdb
5.      Place Hard Disk 2 back in Machine 2 and boot.  It comes up in maintenance mode.
6.      fsck /dev/sda
7.      Now Machine 2 boots as a clone of Machine 1.
8.      Edit /etc/hostname and /etc/hosts to reflect the Machine 2’s correct name.
Dr. KlahnPrincipal Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros