You are not logged in.

#1 2025-05-20 20:59:58

kevdog
Member
Registered: 2013-01-26
Posts: 107

zfs-on-root - Grub unknown file system on boot

So this thread is kind of a continuation of the problem I've posted about here: https://bbs.archlinux.org/viewtopic.php … 3#p2241263

I'm running Arch linux in a virtualized environment with the xcp-ng hypervisor
The virtual disk has two partitions using a GPT partition table using a MBR layount
Partitions are as follows:

xvda    202:0    0   200G  0 disk
├─xvda1 202:1    0     2M  0 part
└─xvda2 202:2    0   200G  0 part

xvda1 is the bios_grub partition
xvda2 is zfs

I'm using grub as the boot loader with the following set:

cmdpath'(hd0)'
prefix='(hd0,gpt2)/sys/arch/ROOT/default@/boot/grub'
root='(hd0,gpt2)'

I have an arch install CD setup with the zfs modules added to the install disk.
I can boot the install disk, mount the /dev/xvda2 partition to /mnt, and import the zpool (which is known as zroot):  This process is done via:

root@archiso / # mount /dev/xvda2 /mnt
mount: /mnt: unknown filesystem type 'zfs_member'.
       dmesg(1) may have more information after failed mount system call.
32 root@archiso / # zpool import -R /mnt zroot

Some setup tasks as mentioned in the Wiki(https://wiki.archlinux.org/title/ZFS#Installation):

m /mnt/etc/zfs/zpool.cache
rm /mnt/etc/hostid
zpool set cachefile=/etc/zfs/zpool.cache tank
systemctl enable zfs.target —root=/mnt
systemctl enable zfs-import-cache —root=/mnt
systemctl enable zfs-mount —root=/mnt
systemctl enable zfs-import.target —root=/mnt
arch-chroot /mnt zgenhostid $(hostid)

I get an interactive arch-chroot

arch-chroot /mnt

# zfs mount
zroot/sys/arch/ROOT/default     /
zroot/data                      /data
zroot                           /zroot
zroot/backup/bitwarden-postgres-backup  /mnt/bitwarden-postgres-backup
zroot/sys/arch/var/lib          /var/lib
zroot/data/databases            /data/databases
zroot/var                       /zroot/var
zroot/sys                       /zroot/sys
zroot/data/databases/bitwardenrs-sqlite  /data/databases/bitwardenrs-sqlite
zroot/data/databases/bitwardenrs-postgresql  /data/databases/bitwardenrs-postgresql
zroot/sys/arch/var/lib/postgres  /var/lib/postgres
zroot/var/lib                   /zroot/var/lib

At this point I'm not exactly sure what to do to procede to make the system bootable. 
Things I've tried have boiled down to:
1. Regenerate the initramfs from within the chroot
2. Regenerate grub config from within chroot

In terms of the initramfs, I'm using mkinitcpio with following configuration:

# vim:set ft=sh
MODULES=(zfs)
BINARIES=()
FILES=()
HOOKS=(base udev autodetect microcode modconf block keyboard zfs filesystems fsck)

In terms of grub -- it's pretty simple. from within the arch-chroot:

grub-mkconfig -o /boot/grub/grub.cfg

When booting I'm still stuck with:

Welcome to GRUB!

error: unknown filesystem.
Entering rescue mode...
grub rescue>

Offline

#2 2025-05-20 21:29:08

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,820
Website

Re: zfs-on-root - Grub unknown file system on boot

Mod note: moving to AUR Issues as zfs is not officially supported by Arch.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB