How to avoid reinstalling the OS when moving hard drive to a new machine
A couple times I have gotten some new hardware --- a newer motherboard, CPU, RAM, and/or graphics card --- but kept the hard drives I had because they still worked, and backing up and restoring all my data would take a while. Except Fedora has pretty much always run slower, occasionally freezing, or other weird things happened, until I just reinstalled from scratch. I'm wondering if there's a way to avoid having to do that.
I know that when you install Fedora, Anaconda detects the available hardware and slightly changes the installation to accommodate. Is there any way to do something like that after the fact --- an easy way to detect and install packages for the new hardware?
Or, we could may go after one component at a time: I feel like the process of finding and installing drivers for the graphics card is relatively well documented. If I were moving from a BIOS to a UEFI motherboard, I could make sure to install and configure grub2-efi
. Wifi drivers can be tricky, if Anaconda doesn't automagically set it up for you, but some people have to manually install those anyway. But I've never even heard of any motherboard or CPU driver packages, even though it seems like that must be part of the issue when moving an existing installation to a new machine.
In my experience as long as you don't have binary, proprietary drivers enabled (Nvidia, AMD) it will simply work. I've had full installs on USB HDDs that I've used on a bunch of different setups. You can install all the *-firmware packages if you want to help with rarer components. Unless you come across rare, old GPUs you shouldn't have an issue.
If you move it to a different HDD you will need to change the
/etc/default/fstab
file (plain text) though as it uses UUIDs to mount partitions instead of /dev/sda1 etc. Perhaps the slowness was due to the swap partition not being mounted?