You are not logged in.

#1 2015-11-15 23:36:32

avi9526
Member
Registered: 2015-05-15
Posts: 107

Install on ZFS over LUKS

Trying to install Arch on ZFS over LUKS. Can't make it load. Have WM with 1 disk 512MB (/dev/disk/by-id/virtio-boot in WM) and 3 disks with 16GB (/dev/disk/by-id/virtio-z1 .. z3 in WM).

Using bunch of scripts https://bitbucket.org/avi9526/install-raidz/src/ written mostly from wiki:
https://wiki.archlinux.org/index.php/ZFS
https://wiki.archlinux.org/index.php/In … nux_on_ZFS
https://wiki.archlinux.org/index.php/Ex … g_with_ZFS

It's setting-up nicely but fail to boot. grub.cfg:

set timeout=2
set default=0

# (0) Arch Linux
menuentry "Arch Linux" {
    search --no-floppy --label --set=root zroot
    linux /vmlinuz-linux zfs=zroot rw zfs_force=1 zfs.zfs_arc_max=536870912
    initrd /initramfs-linux.img

it's not booting.
Tried another grub.cfg

set timeout=2
set default=0

# (0) Arch Linux
menuentry "Arch Linux" {
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  144acb2f-bae0-412d-9452-70b3e0761686
        else
          search --no-floppy --fs-uuid --set=root 144acb2f-bae0-412d-9452-70b3e0761686
        fi
    linux /vmlinuz-linux root=ZFS=zroot rw zfs_force=1 zfs.zfs_arc_max=536870912
    initrd /initramfs-linux.img
}

where is 144acb2f...86 is my boot partition UUID. Not working… print Failed to mount /sysroot

Anyone have any ideas? Thanks!

Offline

#2 2015-11-17 13:16:19

seiichiro0185
Member
From: Leipzig/Germany
Registered: 2009-04-09
Posts: 226
Website

Re: Install on ZFS over LUKS

You write in the title you are using ZFS on Top of LUKS. if so, both of your bootloader-configs are missing the kernel parameters for decrypting the luks-partitions. Please post how your HDDs / Partitions are set up.

e.g. for my laptop it's like this:

-SSD 1
  |-> Partition 1 (boot), ext2
  |-> Partition 2 (LUKS-Encrypted)
         |-> ZFS Pool system


My System: Dell XPS 13 | i7-7560U | 16GB RAM | 512GB SSD | FHD Screen | Arch Linux
My Workstation/Server: Supermicro X11SSZ-F | Xeon E3-1245 v6 | 64GB RAM | 1TB SSD Raid 1 + 6TB HDD ZFS Raid Z1 | Proxmox VE
My Stuff at Github: github
My Homepage: Seiichiros HP

Offline

#3 2015-11-17 19:35:27

avi9526
Member
Registered: 2015-05-15
Posts: 107

Re: Install on ZFS over LUKS

Individual LUKS headless encryption for each disk, head and key stored in /boot/luks

/dev/vda → LUKS → /dev/mapper/z1_crypt | 
/dev/vdb → LUKS → /dev/mapper/z2_crypt |→ zfs raidz1 - "zroot" (/, /etc, /var, …)
/dev/vdc → LUKS → /dev/mapper/z3_crypt | 

/dev/vdd → MBR → /dev/vdd1 → ext4 →  /boot

Last edited by avi9526 (2015-11-17 19:36:06)

Offline

#4 2015-11-23 18:35:00

avi9526
Member
Registered: 2015-05-15
Posts: 107

Re: Install on ZFS over LUKS

I was playing around regular zfs installation (no LUKS). For 3 days was having failed installation until recheck video tutorial and wiki and found out that zfs won't boot if "systemd" hook specified in mkinitcpio.conf:

base udev autodetect modconf block keyboard zfs filesystems fsck

works fine

base udev systemd autodetect modconf block keyboard zfs filesystems fsck

not booting (failed to switch root, and infinite failures to launch emergency shell)

But I need "systemd" hook in order to further use of "sd-encrypt" hook for LUKS support (and sd-lvm2).

I kinda lost in this. Could someone clarify this?

Offline

#5 2015-12-01 21:24:21

mabra
Member
From: Brühl
Registered: 2015-10-05
Posts: 22

Re: Install on ZFS over LUKS

Hi !

I am facing a similar problem (not booting, emergency shell). Bu I have setup my ZFS to use
other pathes then "usual". Do you have used standard system directories as zfs-filesystems
and have not used "mountpoint=legacy" and even put the into "fstab" ??

Best regards,

Manfred

Offline

#6 2015-12-01 22:32:46

avi9526
Member
Registered: 2015-05-15
Posts: 107

Re: Install on ZFS over LUKS

I tried this (with fstab for legacy mountpoints)
zfs set mountpoint=/ zroot
zfs create zroot/home -o mountpoint=/home
zfs create zroot/var -o mountpoint=legacy -o xattr=sa -o acltype=posixacl
zfs create zroot/srv -o mountpoint=legacy
zfs create zroot/etc -o mountpoint=legacy
zfs create zroot/db -o mountpoint=legacy -o recordsize=8K -o primarycache=metadata -o logbias=throughput

didn't try anything else yet. I tried to not using "systemd" hook, but "encrypt" hook can't easily handle headless luks containers (with headers on external USB drive), unlike "sd-encrypt"…

Offline

#7 2015-12-02 00:07:30

mabra
Member
From: Brühl
Registered: 2015-10-05
Posts: 22

Re: Install on ZFS over LUKS

Hi !

What you've done is just from docs, so far I remember.
Strange.

BTW, I have a running version now (ZFS on boot), but just only the rootpool, nothing else.
The wroking grub is like this:

menuentry "ArchLinux Grid (on grid-1)" {
	set root=(hd0,1)
	linux /vmlinuz-linux zfs=syspool rw zfs_force=1
	initrd /initramfs-linux.img
}

I have NO >systemd< in 'kminitcpio.conf'.

Best regards,

Manfred

Offline

#8 2015-12-02 15:19:50

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: Install on ZFS over LUKS

You can't use the systemd hook as there is no “sd-zfs” equivalent of the zfs hook. To use systemd you'll have to write your own hook and a systemd equivalent of the zfs runscript.

Offline

#9 2015-12-07 06:38:54

NVS
Member
Registered: 2007-12-30
Posts: 29

Re: Install on ZFS over LUKS

ukhippo is correct, in that you cannot use the systemd hook with ZFS.  Also avi9256, you mention a desire to use remote LUKS headers. Look at https://wiki.archlinux.org/index.php/Dm … crypt_hook, which does exactly what you want, and is what I also use in my LUKS/ZFS setup.

Offline

#10 2015-12-07 20:18:06

avi9526
Member
Registered: 2015-05-15
Posts: 107

Re: Install on ZFS over LUKS

Editing of the encrypt hook is seems to be a simple solution. But how to handle this in case of raidz1, where you have 3 luks partitions with own headers and keys?

Offline

Board footer

Powered by FluxBB