You are not logged in.

#1 2016-04-20 21:52:27

null
Member
Registered: 2009-05-06
Posts: 398

[solved] syslinux: can't get cryptsetup and zfs to boot

Hi,

I just got a new SSD harddrive for my laptop (t520) and wanted to migrate my existing installation to a zfs pool on it. Here's what I did:

1. Created msdos partition table (the t520 Bios got problems with gpt..)
- createt 1G, ext4 /boot in sdb1 and
- created empty partition on sdb2 with everything else.

2. Created an encrypted zpool on sdb2:

cryptsetup --hash=sha512 --cipher=twofish-xts-plain64 --offset=0 --key-size=512 open --type=plain /dev/sdb2 zroot
zpool create zroot /dev/mapper/zroot

3. Created all my zfs volumes, booted from a usb stick, mounted everything and made `rsync -a /old/disk/ /new/zfs`:

NAME                   USED  AVAIL  REFER  MOUNTPOINT
zroot                 77,7G   380G    19K  none
zroot/ROOT            3,65G   380G    19K  none
zroot/ROOT/default    3,65G   380G  3,65G  /mnt
zroot/home            72,0G   380G  8,17G  /mnt/home
zroot/home/jonas      63,9G   380G  63,9G  /mnt/home/jonas
zroot/opt             2,80M   380G  2,80M  /mnt/opt
zroot/var             2,03G   380G   176M  /mnt/var
zroot/var/cache       1,48G   380G  1,48G  /mnt/var/cache
zroot/var/db          22,5K   380G  22,5K  /mnt/var/db
zroot/var/log          389M   380G   389M  /mnt/var/log
zroot/var/tmp           29K   380G    29K  /mnt/var/tmp

So far so good. Already saved me ~10G with transparent lz4 compression. Nice.
(the /mnt prefix just comes from a `zpool import -R /mnt zpool`, the real mountpoints are without it)

4: Added zfs to /etc/mkinitcpio.conf and `mkinitcpio -p linux`:

HOOKS="base udev autodetect modconf block keyboard encrypt zfs filesystems"

5: Changed the syslinux entry and installed it to sdb with `/usr/bin/syslinux-install_update -i -a -m` from chroot.

LABEL arch
    MENU LABEL Arch Linux
    LINUX ../vmlinuz-linux
    APPEND cryptdevice=/dev/disk/by-id/wwn-0x5001b444a4403fe6-part2:zroot crypto=sha512:twofish-xts-plain64:512:0: zfs=zroot rw init=/usr/lib/systemd/systemd
    INITRD ../intel-ucode.img,../initramfs-linux.img

But now I'm stucked for the last two hours:
Every time I try to boot from sdb it's the same. Here's the output (typed):

Non-LUKS encrypted device found...

A password is required to access the zroot volumen...
Enter passphrase:
Verify passphrase:                           (This "verify" seems very odd. Never had it on any other encrypted boot.)
:: running hook [zfs]
ash: 1: unknown operand
cannot open 'zroot': no such pool
ZFS: Importing pool zroot.
:: running late hook [zfs]
no pools available to import

then the complaining of not having a root device and I find myself in the kernel shell.
In there the probably-not-really-decrypted /dev/mapper/zroot exists and `zpool import` is just telling me that there are no available zpools.
If I try to `cryptsetup close zroot` it won't work because of ioctl complains about zpool being used.

Decrypting and importing works without any problems from my old drive.


Edit: I'm using the demz-repo-core repository for the zfs modules.

Last edited by null (2016-04-22 11:37:00)

Offline

#2 2016-04-22 11:38:55

null
Member
Registered: 2009-05-06
Posts: 398

Re: [solved] syslinux: can't get cryptsetup and zfs to boot

Switched to LUKS encryption. The zpool import worked fine there.

But the zfs= in syslinux acutally needed to point to my root partition, not the zpool. It booted fine with zfs=zroot/ROOT/default.

Offline

Board footer

Powered by FluxBB