Ask Your Question

How to avoid reinstalling the OS when moving hard drive to a new machine

asked 2017-08-18 01:08:17 -0600

terrycloth gravatar image

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.

edit retag flag offensive close merge delete


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?

rookieoz gravatar imagerookieoz ( 2017-08-20 19:03:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-18 02:16:53 -0600

hedayat gravatar image

Well, usually all you need to do is to re-generate the initramfs image used to boot the system with running dracut. The only remaining part might be to install some additional packages, but I'm pretty sure that Anaconda does not selectively install packages for you hardware. It certainly doesn't happen when you install from a Fedora Live disk. Therefore, the only thing I can suggest, which is also usually required when Fedora doesn't boot with default kernel and you are forced to select the rescue kernel, is to run dracut. I'm not aware of any other hardware dependent setup in Fedora.

edit flag offensive delete link more


You don't think Anaconda selectively installs graphics drivers, depending on whether you have an Nvidia or Radeon card?

terrycloth gravatar imageterrycloth ( 2017-08-18 20:27:17 -0600 )edit

As far as I know, not. For example, my system uses an intel GPU, but I have many Xorg drivers already installed: nouveau, ati & openchrome installed (the kernel is installed completely anyway, containing all kernel drivers). Not all Xorg drivers are installed, but I'm pretty sure that Anaconda won't install them either, specially in Live images. Actually, all what Anaconda installs in a live image is to completely copy the filesystem image of the live .iso to the target device. It doesn't install any extra .rpms, and I'm pretty sure that it don't remove any either.

hedayat gravatar imagehedayat ( 2017-08-19 03:46:57 -0600 )edit

From what I remember it never installs propretary drivers for Nvidia and AMD but it does have the open source ATI/AMD/Nvidia/Intel/VESA drivers ready to use on any system, there tiny. You can check a certain folder, I think it's /usr/lib/xorg/modules/drivers but I'm not at my Fedora computer at the moment.

rookieoz gravatar imagerookieoz ( 2017-08-21 03:29:43 -0600 )edit

Yes, I didn't consider proprietary drivers, since they are never installed automatically by Fedora and I considered them out of scope of this question :)

Anyway, for drivers you can also check the list of xorg-x11-drv-* packages.

hedayat gravatar imagehedayat ( 2017-08-21 15:24:13 -0600 )edit

Question Tools

1 follower


Asked: 2017-08-18 01:08:17 -0600

Seen: 167 times

Last updated: Aug 18 '17