Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.