openzfs / openzfs-docs

OpenZFS Documentation
https://openzfs.github.io/openzfs-docs/
135 stars 194 forks source link

Following Arch instructions fails with /sbin/init not found. #413

Closed little-helper-001 closed 1 year ago

little-helper-001 commented 1 year ago

@ne9z, I have the following issue with the Arch Linux ZFS HOWTO:

Following the instructions to mount the root dataset does not seem to work. When I follow the instructions verbatim and GRUB loads, but init fails with the message that /sbin/init cannot be found, even though when I get dropped into the roofs-promt the mentioned file is there. I am not sure but the root dataset has an zfs mountpoint and an entry in fstab as well, maybe those are in conflict, but I am not sure.

I would be thankful for quick feedback.

ghost commented 1 year ago

Hello. I just did a test run of the guide. The cause is that Arch Linux team changed the default mkinitcpio parameters and the guide has not been updated for this.

I have added a fix in PR #410. You can view this exact fix here. With this fix I was able to boot straight to TTY login.

ghost commented 1 year ago

You also need to use an older live image. I had to use 2023.03.01 as the 04.01 build does not have compatible zfs package.

little-helper-001 commented 1 year ago

Thank you for your effort. You response was indeed very quick. I will try to follow your fix as soon as I am done with work and update this issue here if I am successful.

I realized that I needed the older live image as well. But apart from the issue I mentioned everything else seemed to work.

Thank you for actively maintaining this guide, it helps a lot and is a very good basis for more complicated setups.

little-helper-001 commented 1 year ago

@ne9z There is still an issue. Is this the load order of the modules? It says that it fails to load the dataset (rpool/archlinux/root) and after that asks me for the key to decrypt the parent dataset (rpool/archlinux)? Iam not sure tough?

boot_error_archlinux

ghost commented 1 year ago

Yes, that should be the correct order. The encryption root of root dataset rpool/archlinux/root is rpool/archlinux.

little-helper-001 commented 1 year ago

So what do I need to change, does the module order need to be "[...] zfs encryption filesystem [...]" then?

ghost commented 1 year ago

No, it should work as it is. The "encryption" hook is related to luks encryption and thus irrelevant in our use case.

Honestly I've run out of ideas now.

little-helper-001 commented 1 year ago

Maybe it is because of modifications I made, let me check.

little-helper-001 commented 1 year ago

There was indeed a mistake on my side, some error mounting the sub-datasets.

I can now boot into the system, but still encounter an error during loading: boot_error_archlinux_002

ghost commented 1 year ago

That is normal. Because the initrd is dumb and thinks ZFS pool is a disk device, which it is not. You can just ignore this message. It will not do anything.

little-helper-001 commented 1 year ago

@ne9z OK I got it figured out. Your fix, adding the ZFS entry was correct. Only thing one needs to to when using the encrypted setup is replace "encrypt filesystem fsck" with "encrypt zfs filesystem". fsck needs to be removes or it will try to run when the dataset is still encrypted.

P.S. Oh, just received you message. Great I will close this issue now, thanks for the great support!