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'm in the process of cloning my hard disk in order to test some unstable software.

One of the partitions is Linux-swap. From my understanding, it can be used by the os as additional ram. So this does not need to be cloned right?

Additionally: The disk I have has a capacity ~120 GB, while my original drive is ~250GB (though only about 70 GB are used). Since I can not dd, I created the partitions manually and I'm currently using rsync to "clone" the partitions. Is this the best way to do it? How do I make it bootable?

share|improve this question

It doesn't need to be cloned. It simply contains whatever was at certain memory locations when you unmounted that swap partition (or it may have been wiped for security). It doesn't contain any sensitive information.

As for the migration question, you can resize the partitions on the original disk first (you can do that with gparted) so that it fits in the new disk, making sure it still works (boot the system), and then dd'ing that to the new disk. (I highly recommend you make a per-bit backup of the 250 GB disk before you resize the partitions on it.. Better yet, resize the partition on the backup.)

Otherwise, rsync may work (and be a little safer in that it doesn't require you to fiddle with the existing system) but indeed your new drive won't be bootable. You'll then need to reinstall the bootloader (I'm assuming grub); this can simply be done by booting on your favorite LiveCD and running grub-install on the correct device (grub-install /dev/sdX)

share|improve this answer
That's what I thought; also because I never see swap partitions mounted anywhere. But won't copying /boot to the first partition and making that partition bootable work? – Nate Jan 30 '12 at 13:51
That won't copy the MBR, so when it starts it won't know where to look for the boot information. – Rob Jan 30 '12 at 15:26

You must log in to answer this question.

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