0

My HDD in my system recently started died so I am replacing it with a new M.2 SSD. I run Ubuntu 20.04 where my / (root) partition is on my SSD and my /home directory is on my HDD. Both are the same size at 2TB. What is the best way to seamlessly switch to the new SSD?

I can sometimes get the HDD to still work so I can boot live, mount the drive and just copy the data over. I also have a copy of my /home on a different computer that I copied over using rsync. Can I use rsync to copy all the files back to the new drive? Will any essential files be missing? i.e I sometimes get permissions errors that some files weren't able to copy.

What will I need to change in the /etc/fstab file?

  • IMO just install the OS cleanly to the new hardware. Linux is modular and easy to restore things. You keep good backups so it should be a breeze. – Nmath Jan 11 '21 at 20:22
  • UEFI or BIOS system? UEFI or BIOS install? Dual booting? If you try to copy system, you have to at minimum reinstall grub and edit fstab and any place else using UUIDs. You cannot have duplicate UUIDs, so any image copy will not work unless you unplug HDD. New install also housecleans old cruft. Good time to restore from your normal backup as then you know you have everything you need next time a drive fails. You can use rsync to copy your data from /home or into data partition(s), if you want to reorganize. – oldfred Jan 11 '21 at 20:32
  • It is a single-boot UEFI install. I found this guide: https://askubuntu.com/questions/78076/how-to-replace-my-disk-without-having-to-rebuild-my-ubuntu-install. Will the dd command work in this situation also? I know dd takes a while and 2TB might take too long. Will a clean install remove a lot of my programs and customized settings? If I'm understanding, if I want to just copy the data to the new drive, I will have to format and partition the new drive, copy the data then change the UUID in fstab to point /home at the new drive then reinstall grub? – Benjamin1029 Jan 11 '21 at 20:41
  • The dd option is about the worst way. If drive failing any bad sector prevents full copy. And it copies blank space or is very slow. If you have good backups, and decent Internet, install can be quicker. You do need to have export of list of installed apps, if you have added many. And /etc if you edited any system settings. I edit grub, but copy into /home, so backup of /home includes that change. All user settings & app settings are in /home, so if reinstalling apps they will have old settings found in /home. My install to SSD is 10min to partitioned drive. Maybe 20 more to download apps. – oldfred Jan 12 '21 at 04:10

0 Answers0