Do I need to reinstall OS if changing motherboard?
Solution 1:
You do not need to reinstall the operating system if you are upgrading the Motherboard, and if you are using an MBR-style boot environment (for EFI/UEFI boot systems, please refer to the other answer on this question).
HOWEVER, you may need to go through and update some things afterwards:
- First, your drivers for your graphics card (if an integrated card) will need updated. This is to make sure you have the right grahpics drivers for your graphics card.
- Network settings for the ethernet adapter, if it's integrated, may need to be changed. If your network and ethernet settings require to be set up statically, you may need to update your settings after changing the motherboard, because the ethernet card might get a new identifier (like
eth1
instead ofeth0
or something). - Drivers for any peripheral devices in expansion slots. If your motherboard has slots on it which have additional devices (such as a separate graphics card, wireless adapter card, etc.) you may want to verify the drivers are installed and identified correctly. Especially if there's new items installed.
For (1) and (3), you can likely run through the 'Additional Drivers' tool, which would then check your hardware and the non-free proprietary packaging sets to identify non-free drivers you may need to work with your computer.
For (2), you'll have to manually reconfigure your settings if they're a static configuration defined in /etc/network/interfaces
, or configured manually in Network Manager.
Solution 2:
If you replace an UEFI motherboard, you will need to add paths of your OS loaders to UEFI.
It can be done by efibootmgr
utility. You will need to boot from Ubuntu LiveUSB, find your EFI partition and add the records.
The EFI partition can be easily found. It is a small fat32 partition, that has a boot
flag in many cases.
EFI loaders are files located at your EFI partition. Ubuntu has two loaders grubx64.efi
and shimx64.efi
. The latter is signed with Microsoft key to be able to boot with Secure Boot on. But in most cases either one works. You can safely add only shimx64.efi
.
These loaders are located at /boot/EFI/ubuntu
.
So to add a record to UEFI you will need to run
sudo efibootmgr -c -l "\EFI\UBUNTU\SHIMX64.EFI" -L ubuntu -d /dev/sdX -p N
where /dev/sdX
is the disk where EFI partition is located and N
the number of that partition. For example for /dev/sdb2
it will look this way
sudo efibootmgr -c -l "\EFI\UBUNTU\SHIMX64.EFI" -L ubuntu -d /dev/sdb -p 2
/dev/sda1
is default. If you have your EFI partition there, you can skip -d
and -p
parameters.
-c
parameter is to create an UEFI record.
-l
is a path to the loader in Windows format starting with \EFI
for some reason.
-L
is a label. You will see it in your bios as a boot option. You can change it to something else, but I am not sure that update-grub
will not change it to ubuntu
back.
If you run sudo efibootmgr -v
, you will see all your records with paths and labels.
You can remove a wrongly added record by running
sudo efibootmgr -Bb nnnn
where nnnn
is the record number.
More information regarding efibootmgr
utility can be obtained by
man efibootmgr
You can add records for other OSes like Windows the same way. But I can't give more details on what files and what paths they are located at.