11

OK, I have a laptop with an HDD drive and I also have a SSD drive. I would like to replace the former with the latter without having to reinstall everything. What I found after a bit of research was to use a live disk + an external hard drive + gparted to copy the whole Linux partition (in two steps) and then edit fstab.

Now I guess when Linux is installed, it assesses computer's hardware and therefore adjusts some software parameters. So I'm afraid doing the above may 'fool' the OS and result in sub-optimal performance w.r.t. the SSD. I don't know if this is right.

  • So your actual question is "Are there any performance settings that need changed when copying from HDD to SSD"? – psusi Jan 15 '14 at 1:33
8

When changing hardware, it's a good idea to worry about how the OS will react. For most things, you can just change the piece of hardware in the innards of your computer, then let Linux do it's magic.

Hard drives are a little different. You may copy all files, but still need to have boot instructions (grub) installed on your new drive. You also need to make sure that the identifier of your new drive matches the old one (or some drivers will be lost at sea).

Once the UUID is changed, you boot through a live-cd, copy all your precious files on your SSD, and chroot on you new drive to create the bootloader (grub).

I was going to go in details on how to do such things, but while doing a little research on the topic, I found this: http://blog.oaktreepeak.com/2012/03/move_your_linux_installation_t.html

That being said, is it a good idea? Ideally, you should reinstall from scratch. It would give the opportunity to clean all the broken files that on your drive. If you really don't want to lose your settings for all different applications, make sure you copy all hidden files in your home folder, and transfer them to your new install. If you migrate from one distro to another with the same packages, it will be no issue.

However, if time is a constraint, copying from one hard drive to another is fine, as long as you set all references from your old hard drive "pointed at" the new one. As with anything, it does have a chance to fail, but if you make backups, there is no problem with copying a drive onto another.

| improve this answer | |
  • Thank you. I understand what you say about installing from scratch but problem is that some personal settings are not stored in the home folder, like network manager's settings. I guess all such settings are stored in /etc ? – Reza Jan 15 '14 at 6:56
  • Yes, I would expect some settings to be stored off the home folder. You know, I never wondered about that. I just checked, and copying /etc/NetworkManager should get you all the connection informations. Yes, it does include the passwords. – morphheus Jan 15 '14 at 15:19
  • 1
    +1 for "Ideally, you should reinstall from scratch." – malisokan Aug 17 '14 at 17:41
  • Only answers the headline question, not the detailed question. – mjaggard Jul 24 '15 at 7:22
-1

Linux is not windows. You don't really need to worry about such things. You can just create a raw partition using dd. And after fixing UUIDs you should be just fine.

| improve this answer | |
  • How can one create partitions with dd? How would one go about "fixing UUIDs"? Can you provide specific instruction how to do that and an example please? – David Foerster Jan 28 '17 at 18:42
  • The OP in this case, can just use dd tool, if he wants to clone the whole disk. dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync where sdX is the source, and sdY is the destination. Of course the destination drive has to be same or greater in size. – Swoorup Mar 13 '17 at 12:13
  • Could you please edit your post, when you want to add information? It’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. There's also the issue of "fixing UUIDs" that you didn't clarify. Thanks. – David Foerster Mar 14 '17 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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