manjaro-architect
manjaro-architect copied to clipboard
GRUB install on GPT device failed on BIOS machine
Steps to reproduce
- Use following partition script
#!/usr/bin/env bash
# use blkid or lsblck to check what disk you destroy
if [ "$(whoami)" != "root" ]; then
echo "Root privileges required"
exit 1
fi
HDD=sda
partprobe /dev/${HDD}
parted --script /dev/${HDD} print
parted --script /dev/${HDD} -- \
unit MiB \
mklabel gpt \
mkpart primary 1MiB 4MiB \
set 1 bios_grub on \
name 1 bios_grub \
mkpart primary fat32 4MiB 512MiB \
set 2 esp on \
set 2 boot on \
name 2 esp \
mkpart primary linux-swap 512MiB 8GiB \
name 3 swap \
mkpart primary ext4 8GiB 100% \
name 4 root \
print \
partprobe /dev/${HDD}
mkswap /dev/${HDD}3 -L swap
mkfs.ext4 /dev/${HDD}4 -F -L boot
- Mount
sda4as root, mountsda3as swap - Install base packages
- Try to install GRUB from menu.
Expected
GRUB installation success
Actual
GRUB installation failed
Reasons is the following line
https://github.com/Chrysostomus/manjaro-architect/blob/4402877e5894982a7169f33ab70530ac69ef847c/lib/util-base.sh#L542
GPT partition table placed in 2-32 LBAs (sectors). Thus manjaro-architect blindly erase it.
Another point is useless error message on installation (the same as in #216 )
Thank you for the excellent and concise bug report! This next on my to do list.