I’ve just bought a new laptop HP Notebook 15 and spent an hour installing Arch linux on it. Modern computer presses on UEFI boot even more intensely. So it has to be given a try. Turned out to be easy on a fresh installation though.

Here’s what I did:

  1. Created a GPT partition table instead of MBR
  2. Allocated a partition for EFI: wiki page
  3. Ensured it’s mounted under /boot
  4. Installed systemd-boot with bootctl install
  5. Configured the arch loader.

It worked like a charm on a new laptop. But then I faced a temptation to convert my Xiaomi mi notebook air from MBR/grub legacy boot to UEFI. Ideally without loosing data or needing to reinstall the system. It happened to be easy too. Luckily I had a 8 GB swap partition at the beginning of the storage space.

These were my steps:

  1. Dumped partition table for reference
  2. Created a new partition table GPT
  3. Created data partition with the same start/end as it was in MBR
  4. Created an EFI 512 MB partition at the beginning of the storage
  5. Created a 7.5 GB swap partition
  6. Tweaked file systems, /etc/fstab
  7. Proceeded to the systemd-boot installation
  8. Finally, removed grub from the system

It seems this setup is more modern and robust.

$ LANG=en_US.UTF-8 sudo parted /dev/sda print
Model: ATA SAMSUNG MZNTY128 (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name  Flags
 2      1049kB  538MB   537MB   fat32                 boot, esp
 3      538MB   8591MB  8053MB  linux-swap(v1)
 1      8591MB  128GB   119GB   ext4