Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got a new hard disk for my laptop and I want to move my Gentoo installation from old HDD to new.

Most simple guides recommend use of dd to copy the whole partition byte by byte.

I'm moving to the new drive because I don't have enough space on the old drive, so I don't want to simply clone the partition. Instead I need the destination partition to be bigger. Would dd work well in that case?

Assuming that I use same partition types on the new drive, would I be able to use simple cp with appropriate settings?

share|improve this question
up vote 2 down vote accepted

DD makes an identical copy and can't do partition resizing.

You can copy whole existing partitions to new, bigger ones using cpio, but my favourite way to do this is to use Clonezilla to make backup copies of the original partition/s and then restore them to the new drive, using the option to resize the destination partitions during the process - of course you need somewhere to store the image you make, so you either need a enough space on the original disk, an external drive or a network location.

The benefits of this method are that you take a backup copy of your original disk first, there's less risk of doing something horrendous with the DD command and (subject to how you make the backup), you can process the original drive, remove it and then fit the replacement - no need to have both drives fitted simultaneously, which may not be possible in the laptop anyway.

I use a liveCD version of Parted Magic as it contains a lot of other useful tools as well as Clonezilla.

share|improve this answer
How would the cpio method work? I don't have anywhere where I could store the existing partitions. – AndrejaKo May 4 '11 at 19:38
Summed up nicely here: Might be worth getting a cheap USB case for the new drive so you can attach it to the laptop for the copy operation (using cpio or Clonezilla) – Linker3000 May 4 '11 at 21:40
Looks good. I won't have any problems with copy, since I have a laptops with 2 HDD bays (one was empty). – AndrejaKo May 4 '11 at 21:47
It seems to be working fine for now. Thanks a lot! – AndrejaKo May 4 '11 at 22:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .