What makes a Linux distro portable?

What could possibly prevent me from detaching my current hard disk from the laptop and buy a new laptop, install the disk and resume from where I left? In other words, what prevents my current Debian 9 installation from being counted as portable?

  • If Grub entries are using solid references (UUID is the correct solution instead of /dev/sdaX or (hd0,1))
  • If the new laptop’s CPU architecture supports my installation (x64 in this case)

The new laptop should boot up (and is booting in my case).

Drivers might be missing in the worst case, but my intention is creating a script called switch-to-new-hardware.sh which will install:

  • Graphics card driver (if it can, if needed)
  • NIC (eth, wifi) card driver(s) (if needed)
  • Sound card driver

What should be taken into account while switching to new hardware?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Lots of tiny details, if your grub works fine (which is easy to solve but has a huge direct can’t boot impact).

If you use default settings for boot processes, then usually you’re fine, since udev will load proper drivers for all kinds of devices, except for those super uncommon ones(not having a kernel driver installed on the disk).

Xorg need some sort of user mode DDX drivers provided by xf86-video-xxx, which is not installed for new graphic card.

The real hard to solve problem is configurations for upper layer applications, like you has a script with hard coded device names. Camera apps use hard coded camera device name. Network service use hard coded device names which doesn’t exist any more or you no longer use wireless network anymore etc. Your IP changed, so some internet services may refuse to accept your cookies and require you to re-login.

Anyway, I think if you use default distro settings and successfully boot on your new computer, and Xorg works fine, you can shot not working anymore problems one by one, don’t need to solve them until you find them.

PC is made of so many different parts mamufactured by so many companies, there’s no neat solution to write a script to switch to new PC. You need to use portable configuration as possible to make your OS portable. That’s how PC OS is designed.

Solution 2

Beside what you have already mentioned, one which comes to mind is: an “initramfs” generated specific to your old laptop which does not contain all necessary stuff to boot any other system that might prevent you to just attach your disk to a new system.

But it’s a rare case and if you have installed Debian using default options your “initramfs” is generic and contains all necessary elements.

or a customized Kernel for specific hardware which lacks drivers and modules to properly run all possible hardware.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply