ZFS datasets being mounted as read only on boot
I need some help figuring out what is wrong with my zfs datasets. I’m running arch linux 6.8.4, with zfsbootmenu and zfs 2.2.3. I’m experimenting with gpu pass through. After doing some setup and attempting to pass through one of the GPU’s my desktop crashed. While trying to restart the pc libvirt was hung and preventing shutoff. I force powered off the pc. On the next boot my datasets were being mounted as readonly. I cannot figure out why.
The pool is reporting as healthy, and a scrub reports no errors. Dmesg, system logs, and zed report no errors. I can boot an iso, import the pool, read and write to it no problem. When I boot the system normally the data sets property readonly is “on temporary”. This indicates to me something is going wrong during zfs mount. Any suggestion on how to troubleshoot this more effectively?
What does a zpool status from the command line say?
$ zpool status
pool: zroot
state: ONLINE
scan: scrub repaired 0B in 00:09:15 with 0 errors on Mon Sep 2 17:10:35 2024
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nvme-eui.e8238fa6bf530001001b448b4ebf345b-part2 ONLINE 0 0 0
nvme-eui.aca32f0375005e1a2ee4ac0000000001-part1 ONLINE 0 0 0
errors: No known data errors
$ zfs get readonly zroot/ROOT/arch
NAME PROPERTY VALUE SOURCE
zroot/ROOT/arch readonly on temporary
what does running zdb -m zroot return?
Does it mention any space map refcount mismatches?
The pool doesn’t have a cache file
Look at mount | grep zfs. Are all datasets mounted with identical options or is just zroot/ROOT/arch mounted read-only?
Did you try unmounting the affected dataset and remounting (zfs unmount zroot/ROOT/arch; zfs mount zroot/ROOT/arch)? What happens?
Is the mount point for zroot/ROOT/arch an empty directory?
All datasets are being mounted identically. For reference, there is:
zroot/ROOT/arch - mountpoint = /
zroot/home
zroot/log
zroot/libvirt
I did try a remount, it did not report any issues, though the data sets were all still mounted readonly.
I think the pool is healthy and sth is going wrong during the boot phase during the step to remount the root file system. I am not familiar enough with arch to help with details.
Maybe consult the arch setup instructions looking for deviations in your setup.
E.g. does your boot entry for some odd reason specify “ro”?
Does your dmesg have an error message in regards to a remount failure (dmesg | grep remount)?
Grepping for remount didn’t come back with anything. When looking through both sys logs and dmesg the only relevant message to mounting are normal.
Sep 03 09:03:38 hyte-arch systemd[1]: Reached target ZFS pool import target.
Sep 03 09:03:38 hyte-arch systemd[1]: Reached target ZFS startup target.
Sep 03 09:03:39 hyte-arch systemd[1]: Starting Mount ZFS filesystems…
Sep 03 09:03:39 hyte-arch systemd[1]: Finished Mount ZFS filesystems.
I have confirmed that the boot entry is set to rw. I’ll read through that guide, see if there are any discrepancies. Thank you for the help.
lol the first thing it says is read the zfs boot manager docs if using it. These layouts are incompatible. I’ve already gone through the zbm docs to see what I could find wrong, and came up short.
How about
zpool list
Make sure you don’t run out of space.
I have ~ 1.5T available
This might help.
At some point, I must have overwritten org.zfsbootmenu:commandline, adding zfs=bootfs rw to the kcl fixed the issue. Thanks for the help, much appreciated!