manjaro-architect icon indicating copy to clipboard operation
manjaro-architect copied to clipboard

GRUB install on GPT device failed on BIOS machine

Open speshuric opened this issue 7 years ago • 1 comments

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 sda4 as root, mount sda3 as 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 )

speshuric avatar Aug 01 '18 02:08 speshuric

Thank you for the excellent and concise bug report! This next on my to do list.

Chrysostomus avatar Aug 01 '18 03:08 Chrysostomus