Linux – How to migrate a Linux installation from HDD to SSD

disk-imagelinuxsystem-installation

I have some normal x86_64 desktop Linux installed in a single ext4 root partition on some 500GB HDD.

Now if I want to migrate this installation to a 500GB SSD (rest of the system stays the same), do I just clone the disk and run genfstab (I know that from the Arch installation guide, do I even need that?) and done?

Or is there more to it?


That is, everything is in that single partition. I do not have a swap partition, but a swap file, and my system can easily do without that too if it should be an issue.

Best Answer

After some research, I found that ext4 is apparently quite usable on SSDs, so I went with the clone approach. Here is what I did, step by step:

  1. Install the SSD
  2. Boot from a USB and clone the HDD to SSD with dd
  3. Change the UUID of the new filesystem. I missed that one at first, which caused funny results as grub and other software got confused
  4. Update the fstab on the new filesystem. I used the genfstab script from the Arch USB for that
  5. Re-generate initramfs, reinstall and reconfigure grub
  6. Move SSD to the top in boot priority, done

The above worked for me; however, I am very much a novice admin, so I'm not sure if every step is actually necessary and useful.

Related Question