Convertire un'installazione Debian da Legacy BIOS a UEFI
=Riferimenti= *Convert a disk from MBR to GPT+UEFI, in Linux. · GitHub
| Attenzione questo articolo è ancora incompleto. Sentiti libero di contribuire cliccando sul tasto edit. |
Before starting, make sure you have a backup, and make sure to have a linux live boot ready to rescue your system. It’s easy to mess this up!
Use gdisk to convert the partition table to GPT. >
gdisk /dev/sdaCreate the “BIOS boot” partition that GRUB needs. >
nto create a new partition. Needs to be about 1MB. You can probably squeeze this in from sectors 34-2047. UseLorlto look up the code for “BIOS boot” (ef02).Write the new partition table. >
wReload the partition table. >
partprobe /dev/sdaRe-install the GRUB boot loader using the new partition scheme. >
grub-install /dev/sdaOptionally reboot to verify it’s working. If you just need GPT and not UEFI, you can stop here.
Use gdisk to add an “EFI System” partition (ESP with code ef00). Officially should be 100-500MB, but mine only used 130kB. Can be anywhere on the disk, so consider putting it at the end if you’re using non-resizable media like a physical disk. >
gdisk /dev/sdaand usento create the partition.Give the ESP a distinctive label without whitespace like
EFIwth menu itemcbecause we’ll reference the partition label in fstab.Write the partition table. >
wReload the partition table. >
partprobe /dev/sdaBuild the filesystem for the ESP. >
mkfs -t vfat -v /dev/disk/by-partlabel/EFI-systemCreate the ESP mount point. >
mkdir /boot/efiAdd the ESP to
/etc/fstab. It should look like this: > /dev/disk/by-partlabel/EFI-system /boot/efi vfat defaults 0 2Mount the ESP. >
mount /boot/efiInstall the GRUB EFI package. >
apt install grub-efiInstall the GRUB EFI bootloader onto the disk. >
grub-install --target=x86_64-efi /dev/sdaReboot.
Change the BIOS from BIOS boot to UEFI boot.
Use the one-time boot menu to force boot the disk. You may have to navigate to the disk ->
EFI->ubuntu->grubx64.efi.Re-install GRUB’s EFI bootloader to update the UEFI boot selector. >
grub-install
Resources
- The author of
gdiskhas a verbose description of MBR, GPT, and UEFI. - https://serverfault.com/questions/765778/clonezilla-restore-mbr-disk-to-4tb-disk-convert-to-gpt-linux-not-windows covers the first part of the process.