You are not logged in.

#1 2023-03-28 18:51:01

freeze_dried
Member
Registered: 2023-03-28
Posts: 6

Error installing GRUB on a GPT/BIOS System

I’m installing Arch on a x86_64 machine with BIOS.

The disk is configured GPT with a BIOS boot partition as follows:
sda1 - bios boot - 2MiB
sda2 – swap – 9 GiB
sda3 – btrfs root – 900 GiB

The disk was partitioned with gdisk and sda1 was tagged as EF02.

I’m attempting to install grub to the disk with the following command and feedback:

# grub-install –target=i386-pc /dev/sda
grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn’t exist. Please specify –target or –directory.

I also attempted to mount sda1 prior to installing grub, but this is also generating an error:

# mount /dev/sda1 /mnt
mount: /mnt: unknown filesystem type ‘swap’
dmesg(1) may have more information after failed mount system call.

Not being formatted, I understand the “unknown filesystem type” bit of the message, but not the “swap” part of the message, as sda2 is the swap partition, as confirmed by dmesg which contains a message that "swap on" has been enabled for sda2.
There is also quite a bit of information about sda3 in dsmesg, but there is no mention of sda1 so there is no further detail about the failed mount system call.

In addition to the installation instructions, I am using sections 1.1 through 1.3 of https://wiki.archlinux.org/title/User:E … figuration

Any suggestions would be appreciated.
Thanks in advance!

Last edited by freeze_dried (2023-03-29 14:27:27)

Offline

#2 2023-03-28 23:29:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,074

Re: Error installing GRUB on a GPT/BIOS System

sda1 has no file system so you can't mount it. The file that is mentioned in the error message should exist assuming you are using the Arch GRUB package. You are using the GRUB installed and trying to run this from the chroot right? What do you get from

pacman -Qikk grub

Offline

#3 2023-03-29 02:36:58

freeze_dried
Member
Registered: 2023-03-28
Posts: 6

Re: Error installing GRUB on a GPT/BIOS System

Agreed, I'm not surprised that I could not mount a partition which has no file system. I was merely trying anything that I could think of before admitting that I was out of ideas.

# pacman -Qikk grub

Name              : grub
Version            : 2:2.06.r456.965bc45963-1
Description     : GNU GRand Unified Bootloader (2)
Architecture    : x86_64
~
Installed size   : 33.25
Build date        : Fri Feb 3 17:49:2013
Install date      : Wed Mar 1 12:52:30:2023
Install reason  : Explicitly installed
Install script    : Yes
Validated by    : Signature

grub: 1113 total files, 0 altered files

Last edited by freeze_dried (2023-03-29 14:27:55)

Offline

#4 2023-03-29 10:40:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,074

Re: Error installing GRUB on a GPT/BIOS System

stat /usr/lib/grub/i386-pc/modinfo.sh
mount

?

And please use [ code ] [ /code ] tags without spaces for posting these and any future outputs. 

How are you mounting your root partition in this case? Is it a subvolume or something? I'm thinking the install script of grub gets confused because the files it intends do install are at a "weird" location. Maybe want to install grub-btrfs additionally or so.

Last edited by V1del (2023-03-29 10:41:08)

Offline

#5 2023-03-29 13:47:34

freeze_dried
Member
Registered: 2023-03-28
Posts: 6

Re: Error installing GRUB on a GPT/BIOS System

I had to shut the machine off last night. : (

I booted the machine via the installation ISO and the first thing that I did was to install grub-btrfs as this seems to be an obvious oversight on my part. Thanks! I then retraced my steps from yesterday to get the filesystem mounted as follows:

# mount -o noatime,compress=zstd,space_cache=v2,subvol=@ /dev/sda3 /mnt
# mount -o noatime,compress=zstd,space_cache=v2,subvol=@home /dev/sda3 /mnt/home
# mount -o noatime,compress=zstd,space_cache=v2,subvol=@var /dev/sda3 /mnt/var
# arch-chroot /mnt

But unlike yesterday, I can’t mount them today. The response to these commands is:

mount: /dev/mnt: can’t find in /etc/fstab

I did of course generate a fstab file yesterday, but since I can’t mount the filesystem, obviously fstab can’t be found.

So, how do I get the filesystem mounted; or do I need to start over from scratch?

Last edited by freeze_dried (2023-03-29 14:28:36)

Offline

#6 2023-03-29 14:00:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,074

Re: Error installing GRUB on a GPT/BIOS System

Remove the spaces in between the [ code ] I have to add those for illustration, if you remove them you will get codeboxes

It should not be looking into your fstab if you mount the paths explicitly like this. Double check that /dev/sda is still correct for the root drive, if you use a liveuusb there's no guarantee whether or not the USB or your root drive gets sda or sdb. Also make sure your retelling here is accurate, in the commands you posted /dev/mnt isn't mentioned yet in the error message it is, unless you accidentally passed /dev/mnt instead of /dev/sda3 /mnt that might clarify the message.

Last edited by V1del (2023-03-29 14:01:16)

Offline

#7 2023-03-29 16:36:42

freeze_dried
Member
Registered: 2023-03-28
Posts: 6

Re: Error installing GRUB on a GPT/BIOS System

Per your question(s):

# stat /usr/lib/grub/i386-pc/modinfo.sh
File: /usr/lib/grubi386-pc/modinfo.sh
Size: 2575		Blocks:8		IO Block: 4096 regular file
Device: 0,25	Inode: 2161		Links: 1
Access: (0644/-rw-r—r--)	Vid: ( 0/	root)	Gid: (	0/	root)
Access: 2023-03-29 13:15:13.165028126 +0000
Modify 2023-02-03 17:49:17.000000000 +0000
Change: 2023-03-29 13:15:03.131817441 +0000

# mount
proc on /porc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,,relatime,size=4024048k,nr_inodes=1006012,mode=755,inode64)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64
copytoram on /run/archiso/copytoram type tmpfs (rw,relatime,size=6100932k,mode=755,inode64)
cowspace on /run/archiso/cowspace type tmpsf (rw,relatimesize=262144k,mode=755,inode64)
/dev/loop0 on /run/archiso/airootfs type squashfs (ro,relatime,errors=continue,threads=single)
airootfs on /type overlay (rw,relatime,lowerdir=/run/archiso/airootfs,upperdir=/run/archiso/cowspace/persistent/ARCH_2202303/x86_64/upperdir,workdir=/run/archiso/cowspace/.persistent_ARCH_202303/x86_64/workdir)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
devpts on/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cgroup2 on /sys/fs/cgrout type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on proc/sys/fs/binfmt_misc type autofs (rw,nosuid,nodev,noexec,relatime)

BTW: there are bound to be a few typos here, so if you see something odd, just ask.


Affirmative, lsblk shows that sda is still the correct install drive.


FYI - Yesterday I booted the machine via the ISO and after checking the keyboard config, verifying that I had an Internet connection and partitioning the disk, this is the process that I followed:

# mkswap /dev/sda2
# swapon /dev/sda2
# mkfs.btrfs /dev/sda3
# mount /dev/sda3 /mnt
# btrfs subvolume create /mnt/@
# btrs subvolume create /mnt/@home
# btrfs subvolume create /mnt/@var
# umount /mnt
# mount -o noatime,compress=zstd,space_cache=v2,subvol=@ /dev/sda3 /mnt
# mkdir -p /mnt/{home,var}
# mount -o noatime,compress=zstd,space_cache=v2,subvol=@home /dev/sda3 /mnt/home
# mount -o noatime,compress=zstd,space_cache=v2,subvol=@var /dev/sda3 /mnt/var
# lsblk
# pacstrap /mnt base linux linux-firmware git vim nano amd-ucode btrfs-progs
# genfstab -U /mnt >> /mnt/etc/fstab
# cat etc/fstab
# arch-chroot /mnt

I tried to set the HW clock, but received the following error:

System has not been booted with systemd as init system (PID 1). Can’t operate.
Failed to connect to bus: Host is down

This also happened on an install I did a few days ago, but after the first reboot, of the other machine, I was able to adjust the clock.

I then set the locale, keymap, hostname, hostfile and password. I used grub to install networkmanager, mtools, dosfstools, linux-headers and some other utilities.

Then:

# grub-install --target=i386-pc /dev/sda
grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn’t exist. Please specify –target or –directory.

This morning I retraced my steps from yesterday, but I obviously didn’t re-partition the drive, nor did I reformat it. Skipping those steps, I began with mounting sda3 and I immediately ran into trouble:

# mount -o noatime,compress=zstd,space_cache=v2,subvol=@ /dev/sda3 /mnt
mount: /dev/mnt: can’t find in /etc/fstab.

Offline

#8 2023-03-30 01:48:20

alistairCookie
Member
Registered: 2023-03-27
Posts: 4

Re: Error installing GRUB on a GPT/BIOS System

strange. the only time i encountered such strangeness is when i'm doing the install in WSL.

you booted your metal in MBR right? what if you adjust your boot partition to 512MB?

Offline

#9 2023-03-30 08:13:41

freeze_dried
Member
Registered: 2023-03-28
Posts: 6

Re: Error installing GRUB on a GPT/BIOS System

Yeah, it's a bare metal (AMD / Phenom II) x86_64 machine with BIOS. The disk is configured GPT/MBR, not MSDOS/MBR. GPT/MBR doesn't use a "conventional" /boot partition like UEFI does, but it does require an additional, small unformatted partition, because grub won't fit into the MBR area of the disk. So, it's like a chain loading sorta scheme.

I know that this machine supports configuration, because I had a similar Guardia install a while back, but for some as yet unknown reason, Arch is unhappy. I suppose I may need to start over with a MSDOS/MBR configuration.

Offline

#10 2024-10-01 01:12:27

cojsolorzano
Member
Registered: 2024-10-01
Posts: 1

Re: Error installing GRUB on a GPT/BIOS System

in this case:

# grub-install --target=i386-pc /dev/sda
grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn’t exist. Please specify –target or –directory.

you only  have to check /usr/lib/grub and check folder name, and mv according you need, and voilá!

Last edited by cojsolorzano (2024-10-01 01:12:53)

Offline

#11 2024-10-01 10:12:09

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,891

Re: Error installing GRUB on a GPT/BIOS System

Thank you for trying to help, cojsolorzano .

Unfortunately this thread is over a year old and OP hasn't visited the forum since may 2023 .
The change of them seeing your reply is very small.

Please read https://wiki.archlinux.org/title/Genera … bumping%22 .

Closing this thread.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB