I have a disk with Ubuntu 12.04 installed that boots via UEFI and grub (probably grub2). I've tried to use it to boot a physically different, but otherwise absolutely identical system (motherboard, CPU and BIOS version), and the BIOS fails to find a bootable operating system.

I presume that either some knowledge of the bootable FS has to be written to the motherboard NVRAM, or that some motherboard serial number has to be written to the disk. However it isn't at all obvious where the error lies, or how to fix it.

Being able to swap motherboards is very useful if a system suffers from a motherboard failure (or even a suspected one). Especially when an identical system can be substituted.

I can boot off an install image (actually 13.04) and run efibootmgr - it doesn't show a Linux/Ubuntu entry for that disk. A simple efibootmgr -d /dev/sdb -c made no difference.

Motherboard is an Intel DQ77KB.

  • ... Ubunto, eufi ... This site is about Ubuntu. – Radu Rădeanu Sep 26 '13 at 16:48

I know for example about grub and UUID's for harddisks. I just learned they are generated differently on another Mainboard if what i was reading is true. So you need to replace the UUIDS for your harddisks in /etc/fstab with the actual divices /dev/sd* most likely.

You could look into the outputs of this and figure out how to put the new UUID's in if they changed

sudo fdisk -l
sudo blkid
cat /etc/fstab

Show us the output of this if your stuck. Also look into custom grub files if you have any then do a update-grub on the disk after you mounted it. You might need to chroot on that disk as well. Or run some grub repair stuff from the livecd or use superbootdisk/supergrubdisk? or something like that. But i am not sure if they are fixing the fstab.

Why would you expect that everything just works fine? Ubuntu is configured to that old main-board and probably need to be configured in a different way for the new one.

A live CD/DVD will probably work because it detects hardware on boot without loading any specific settings.

I would just backup the old system, and install a fresh ubuntu, and overwrite some settings from the old system (maybe just the entire home folder and something in /etc ...)

  • The new and old motherboards are identical, so all the drivers (etc) are correct. The only obvious difference will be the ethernet MAC addresses. In any case I'm not even getting as far as loading grub. – David Laight Sep 26 '13 at 9:37

UEFI machines have two boot mechanisms: 1) NVRAM has a list of choices for the internal hard disk and 2)Removable media, which uses /EFI/Boot/bootx64.efi. You can add your Ubuntu to the NVRAM by running grub-install again (check the man page for switches for your specific situation, --uefi***something (secure boot for instance). And/Or copy grubx64.efi/shim.efi (depending on if you use secure boot) to /EFI/Boot/bootx64.efi. If you had been using the disk to boot before, it should still work with the same uuids (which are filesystem dependent, and you have the same filesystems).

You can avoid using any NVRAM by setting up an EFI partition on a USB boot device, with a grub using the hard disk installation. Another "fallback" boot mechanism is to set up the /EFI/Boot/bootx64.efi on the hard disk as shim, and put a copy of grubx64.efi there too. Then under some conditions, when a boot fails, that is attempted before the next entry in the boot order.

  • Reading the source of grub-install it looks like I only need to run the 'efibootmgr' command at the end. I think this is: ` efibootmgr -c -d /dev/sda -p 1 -w -L ubuntu -l "\\EFI\\UBUNTU\GRUBX64.EFI"` However that fails silently ($? is 1). ptrace shows it reading the GPT table then doing: ` open("/sys/firmware/efi/vars/new_var", O_WRONLY) = 3 write(3, "B\0o\0o\0t\0000\0000\0000\0000\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2084) = -1 ENOSPC (No space left on device)` – David Laight Sep 26 '13 at 11:49
  • How do I stop the above being converted to flowed text? – David Laight Sep 26 '13 at 12:02
  • Looks like I've also hit bug 1167622 / 1173433 (EUFI anti-brick bug) when using the 13.04 install media to fix the system. – David Laight Sep 26 '13 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.