Page 1 of 1

So ... You bought a new replacement disk!

Posted: 17 Jul 2014 22:25
by ScottQuier
Cloning from one drive to another requires neither to be the active OS - because the files in an active OS drive will change and changing files during a clone operation is a good way to get corrupted data. Not a goodness.

Keep the old drive (I'll call it /dev/sda, you'll see why in a minute) where it's been for what seems like forever.

Mount the new drive (I call this one /dev/sdg) using a device with a USB plug on one end and a SATA data and power connectors on the other. Simple, these are all over the place and they're not expensive.

The software is simple - the 'dd' command. So ....
First - Be careful when you determine your drives (Step #3). Getting it wrong and Step #4 can over-write all data on your old drive.
  1. Physically connect the two drives as described above
  2. Boot your LiveUSB pen drive
  3. Open a command prompt and run the command

    Code: Select all

    This will help you ensure your drives are what you think they are :D You'll note that your LiveUSB is probably NOT /dev/sda. On my machine, it was /dev/sdb. The installed HDD is /dev/sda and the new drive was /dev/sdg (I have lots of hard ware options for memory sticks, etc). Note that your drives will most likely be different so run the lsblk command and be sure. Using the displayed disk size is one way to be sure.
  4. Now, run the command

    Code: Select all

    sudo dd if=/dev/sda of=/dev/sdg bs=8M
    The bs argument (no pun intended there) should match the size of the buffer on your old drive for maximum performance. Mine is/was 8M. Be patient - this could take some time.
  5. Once the copy is done, shut down the computer and remove the old drive, replacing it with the new drive.
  6. Reboot the computer from the LiveUSB
  7. Now the really fun part starts (the above was the scary part!) Start gparted from the menu. If you are running KDE, you can try the KDE partition tool, but I've less success with it getting this step right.
  8. Select /dev/sda (if it's not already selected)
  9. Right-click on the partition you need to grow and select "Resize/Move" from the menu
  10. In the new window, grab the right edge of the partition sizing tool and drag it to the right to increase the size of that partition
    Resize.jpg (22.54 KiB) Viewed 537 times
  11. When you get it to the size you want, click on the "Resize/Move" button. Now you wait .... again. But, this time you get a progress bar. :D
  12. When it's done, shut down the computer, remove the LiveUSB device, and reboot the computer.