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 already have a linux running on my laptop.Is it possible to port the entire system to a portable hard drive by copy all the file to the hard drive with the existing folder structure and reinstall the bootloader?

added: In fact, I'm more interested in whether my method mentioned above works.

share|improve this question
up vote 2 down vote accepted

dd should do what you're looking for - dd reads raw data from one source and writes it to the other. Simple.

dd if=/dev/sda of=/dev/sdb bs=32M

This command would make an exact copy of the input file /dev/sda and write it to the output file /dev/sdb, provided that /dev/sdb is large enough to contain all of /dev/sda's data. This will copy absolutely everything, including the bootloader and partition tables, so you won't have to re-install the bootloader or anything like that - both hard disks will be exact copies of each other. Be very careful with this command, though. One small typo and you could destroy data.

share|improve this answer
will these action cause broken partition table since the portable drive have larger or smaller size? – NStal Jul 21 '12 at 8:20
If the portable drive is larger, this won't cause a problem at all - you'll just end up with unused space on the portable drive. If the portable drive is smaller, I'm honestly not sure what will happen, but I wouldn't try it. – Huskehn Jul 21 '12 at 23:57

Yes, it is possible to copy your hard drive partitions to removable media and then restore them on another machine using something like Clonezilla live or PING (Partimage Is Not Ghost).

However bear in mind that if you have different hardware on the destination machine then some things may not work. You may also have issues with devices being renumbered (though this is less of an issue than it used to be).

If possible it would be better to separate your user files from the operating system files by for example by having a separate /home partition. Then you could reinstall the operating system on the destination machine and just back up and restore the /home partition to get your files back.

share|improve this answer

You must log in to answer this question.

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