clone a harddrive
I just bought a new Samsung laptop, it is the same as this older one, just better processors, i5 third generation, I'm told.
I use Ubuntu, the latest LTS version. I have my old laptop set up nicely, all the things installed just as I need them. Things I can't even remember installing! Can I simply clone this hd onto the new computer's hd? Or is that not a good idea? If this is advisable, I'm thinking of removing the hd from the new laptop, putting it in my external drive and copying everything. Maybe with rsync? I use that to fetch files from my webpage. |
Quote:
If the new one is larger, you'll need to move the last partition out to the end of the drive, and then extend the file system to the end. Quote:
Example: Clone it, make sure which is which. Code:
dd if=/dev/sda of=/dev/sdb bs=1M Code:
(parted) resizepart 2 100% Code:
resize2fs /dev/sdb2 100% |
May I demur - dd is absolutely the wrong tool. Allocate some partitions and use rsync as proposed. Best option is to allocate a separate /home partition, then if a fresh install is required, settings aren't lost.
dd has no knowledge of filesystem structure, and if there are any errors will simply clone the errors as well. It has its uses (forensics say), but not a backup tool. |
Clones tend to work best on exact hardware. A general rule is to fix specific naming before you clone or you may have to adjust it later.
Will it work? Never know till you try. dd is not tech proof. I've been... I mean people have been known to bork that command. Some folks use clonezilla booted live on each to move the information over network. I'd think that to be easier than remove but ... Guess you could even use dd over netcat but that is not as safe as rsync over netcat maybe. Plenty of ways to do this. Any could fail.. Clean boot used to be the only pure way according to some distro's. |
There's also Clonezilla.
I'm inclined to think that a fresh install on the new computer, with a separate /home, then fetching the files for /home with rsync, is likely the best option (I have used a separate /home partition for many years, and have several times been very glad I do). If it were me, I'd be concerned about potential hardware conflicts in trying to restore a clone from an older machine to the newer one. Of course, you could try cloning and, if it fails, you would have a fallback plan. |
Fresh install the best option. Yes definitely. I said so in post 2.
A file system will have bad blocks, bad sectors, errors, corrupt files, sometimes even immovable data. If you clone it, you clone all of that. dd clones. Quote:
Quote:
Is there an advantage to doing it? Sure, no reconfiguring, no installing, no nothing. I did a 160GB almost full to a 500GB. Whole thing from start to rebooting the new drive was about 35 min. If you are going to do it with a 1TB drive...that's going to take a while. Also when you run some like: Code:
tune2fs -l /dev/sda2 |
All times are GMT -5. The time now is 02:40 AM. |