Home | News | Download | Packages | Forum | Wiki | Github

/usr/bin/runit-init does not exist ZFS+LUKS

(xforce) #1

I’m trying to boot void linux from an LUKS encrypted zfs file system.
I used mkinitcpio to build the initramfs, tried dracut before, but it made no difference.

My system correctly asks for the encryption key, encrypts the drive and then tries to import the zfs pool

the zfs pool is mounted in new_root, but the /usr and /bin folders are empty, so it can’t find runit-init and I’m getting this error

:: running hook [zfs]
ZFS: Importing pool zroot.
SPL using hostid 0x00000000
:: running late hook [zfs]
no pools available to import
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /usr/bin/runit-init does not exist.

Does anyone have any idea why /usr is not imported correctly but the rest is?



the is a little more information needed than that. You should import the pool from another system/stick/cd and do a ‘zfs list -r pool’ on it and check the mountpoints. It seems they are not propely set.

There are basically two ways to get it to work:

Set the mountpoint using zfs:

$ zfs set mountpoint=/ your/ROOT/dataset

Set your /bin, /var and so on dirs via inheritance or manually. When you are done you may check if they are set properly by using the ‘zfs list -r pool’ or ‘zfs get mountpoint pool’ commands.

Or use the traditional fstab and the zfs legacy option:

$ zfs set mountpoint=legacy your/ROOT/dataset
$ cat /etc/fstab
# System
rpool/ROOT/void           /         zfs       rw,relatime,xattr,noacl  0 0
rpool/ROOT/void/var       /var      zfs       rw,relatime,xattr,noacl  0 0
rpool/ROOT/void/boot      /boot     zfs       rw,relatime,xattr,noacl  0 0

# Swap
/dev/mapper/swap_crypt  swap      swap      defaults                 0 0

# tmpfs
tmpfs                   /tmp      tmpfs     defaults,nosuid,nodev    0 0

In this case you have to make sure that your fstab is included in your initrd.

Good luck!

(xforce) #4

thanks for your help,
I only managed now to retry installing void linux with zfs+luks, I think I made some small progress.

I used a efi shell to test the commands, and it seems I got the right ones,
dracut boots void linux, asks for a password and encrypts the drive then mounts the zfs pool
but i’m getting this error

dracut: ZFS: Importing pool zroot.
SPL: using hostid 0x00000000
dracut: ZFS: Mounting dataset zroot/ROOT/default
dracut: Mounted root filesystem zroot/ROOT/default
dracut: switching to root
switch_root: cannot access /sbin/init: No such file or directory
switch_root: failed to execute /sbin/init: No such file or directory

I am going to try using fstab, maybe that will make a difference, it seems to be working with your setup
I don’t use grub though