Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Can I move system disk to new hardware?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
bdz
Posts: 63
Joined: 2008-06-16 04:32

Can I move system disk to new hardware?

#1 Post by bdz »

I'm going to be assembling a new AMD Ryzen 5 5600X based system. I'm wondering if I can simply install my current system drive on the new system. I.e. not buy another ssd drive and not reinstall debian.

I'm currently running Debian 4.19.181-1 on an Intel Core i7-4790K system.

I would think that the kernel would install the correct drivers when the system is booted but I don't really know anything about how drivers are selected and loaded. I've never tried anything like this before.

Any thoughts on this would be appreciated.

thanks

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 598
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 79 times
Been thanked: 89 times

Re: Can I move system disk to new hardware?

#2 Post by wizard10000 »

bdz wrote:I would think that the kernel would install the correct drivers when the system is booted...
Depends on a lot of things. Debian will install the correct firmware and drivers if they're available so I think your biggest concern is gonna be getting the network up and running. Would be wise to insure that network firmware and drivers (and amd-ucode) for the new machine are on disk before you put the disk in the new machine. Worst case you can tether an Android device and install firmware and drivers that way.

If your video card is recent AMD you may also need firmware for that on disk.

Not positive but I think that 4.19 kernel may be a little old for a new Ryzen so I'd strongly recommend grabbing the 5.10 kernel from buster-backports.

Hope this helps -
we see things not as they are, but as we are.
-- anais nin

bdz
Posts: 63
Joined: 2008-06-16 04:32

Re: Can I move system disk to new hardware?

#3 Post by bdz »

Thanks, that clear things up.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Can I move system disk to new hardware?

#4 Post by p.H »

1) Initramfs
The initramfs includes graphic and storage drivers used at early boot to display the splash screen (if plymouth is installed), load an hibernation image and mount the root filesystem.
If the initramfs was built with MODULES=most in /etc/initramfs-tools/initramfs.conf (the default), it includes drivers which may be needed for most hardware.
If it was built with MODULES=dep to make it more compact, then it includes only drivers needed for the current hardware and may lack drivers for different hardware. So If you set MODULES=dep, I suggest to set MODULES=most and rebuild the full initramfs with

Code: Select all

update-initramfs -u -k all
2) GPU
If you are moving from an Intel GPU to an AMD GPU, you probably need to install firmware-amd-graphics.

3) Networking
The new ethernet and/or wireless interfaces may require firmwares not installed on your system.
Also, the interfaces may have different names on the new hardware, so you may need to update any config file using the interface names such as /etc/network/interfaces.

4) Boot
If you set up the system for EFI boot on the old hardware, you may need to install the boot loader in the "EFI removable device path" so that it can boot without an EFI boot entry (which was registered in the old hardware NVRAM), with :

Code: Select all

grub-install --force-extra-removable
You do not have to do this if you already select this option during installation (in expert mode). You can check it with

Code: Select all

debconf-show grub-efi-amd64
If you set up the system for BIOS/legacy boot on the old hardware and the new hardware supports it, you should not need to change anything. If the new hardware does not support legacy boot, you will have to set up the system for EFI boot, i.e. create and EFI partition mounted on /boot/efi, install grub-efi-amd64. Depending on the UEFI firmware level of brokenness, it may also require to convert the partition table from DOS/MBR to GPT (gdisk can do it).

All this assumes that your current system supports the new hardware. Othewise you may need to install a more recent kernel (from backports or testing) and possibly other software components (Xorg drivers, MESA...).
Last edited by p.H on 2021-06-25 12:46, edited 1 time in total.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 598
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 79 times
Been thanked: 89 times

Re: Can I move system disk to new hardware?

#5 Post by wizard10000 »

p.H wrote:If it was built with MODULES=dep to make it more compact...
I have a real question that probably doesn't justify its own thread so I'll ask it here. When I installed my first Linux distribution modular kernels weren't a thing yet and you *had to* support only your own hardware as the kernel had to fit on a floppy disk even if you installed it on a hard drive.

I can see where you can shave a few milliseconds off boot time and maybe save a little disk space but with modern-ish hardware is there any real advantage to using MODULES=dep? I've got a dozen-year old laptop that could use a little help but am a bit skeptical about any real-world improvement.

Your thoughts, please?

cheers -
we see things not as they are, but as we are.
-- anais nin

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Can I move system disk to new hardware?

#6 Post by p.H »

A more compact initramfs may be useful in a few specific (uncommon) situations.

- Loading the kernel and initramfs can be very slow with some BIOS and boot devices (or network link when booting from network), so trimming the initramfs may save not just milli-seconds but tens of seconds of boot time. I have seen it with USB drives used as boot device on a specific motherboard.

- Some boot loaders (LILO ?) may have a limit to the size of kernel image and initramfs they are able to load.

- When using a separate /boot partition or boot device, it may not have enough space for a given number of kernel images and full-featured initramfs. This happens quite often on systems which have been installed with an older version and upgraded, as kernel images and initramfs tend to grow bigger. Embedded systems may also have limited space for boot files.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 598
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 79 times
Been thanked: 89 times

Re: Can I move system disk to new hardware?

#7 Post by wizard10000 »

p.H wrote:A more compact initramfs may be useful in a few specific (uncommon) situations.
Ah. That makes sense, thanks :)
we see things not as they are, but as we are.
-- anais nin

Post Reply