DISCOVER
×

How to copy ubuntu to another hard drive

Updated July 19, 2017

Ubuntu is the most popular distribution of the Linux operating system as of 2010. Ubuntu comes with and has access to a plethora of applications, games, tools and system utilities developed to be user-friendly, stable, and to appeal to a wide range of computer users. If you have a new hard drive and want to copy an already-installed version of Ubuntu from another hard drive, you can do it using a command Terminal.

Switch off your computer, plug in your new hard drive and boot into Ubuntu using the Live CD by selecting "Try Ubuntu Without Installing". This gives you access to your hard drive without using it at the same time. If you don't have a Live CD, go to "Make An Ubuntu CD" in Resources.

Open a Terminal and type "sudo fdisk -l" to obtain information about your hard drives. Your new hard drive will look like "/dev/sdb," with no partitions on it. Your old hard drive will have partitions and look something like "/dev/sda." Type "sudo cfdisk -z /dev/sdb," replacing "/dev/sdb" with the name of your new hard drive. This opens a partition program. Press "Ctrl+W," press "Enter" and type "Yes" when prompted. This writes a blank partition table to your new drive, necessary for copying Ubuntu onto it.

Type "sudo apt-get install gddrescue" to install a disk cloning application. Type "sudo ddrescue -v /dev/sda /dev/sdb," making sure that your old hard drive is listed first and the new one second. This clones Ubuntu onto the new hard drive. Note that this process can take up to an hour.

Shut off the computer and unplug the old hard drive. Boot into Ubuntu again using the Live CD. Open the partition editor (System, Administration, Partition Editor) and right-click "linux-swap" and select "Swap Off". Right-click the partition again and select "Resize/Move". Click and drag the arrow to expand the size of the partition to as large as you want it. Click "OK" and select "Apply Changes". This resizes your partition. You can now access Ubuntu on your new hard drive.

Things You'll Need

  • Ubuntu Live CD
Cite this Article A tool to create a citation to reference this article Cite this Article

About the Author

Abraham Hovey is a poet and songwriter living in Madison, Wis. He has been a working musician since 1997 and holds a bachelor's degree in history from Western Michigan University.