[zfs-discuss] ubuntu + zfs + luks

Andrew Barnes barnes333 at gmail.com
Mon Jun 13 22:53:25 EDT 2016


Not sure but might be worth a look at this commit:

https://github.com/zfsonlinux/zfs/commit/d2f3e292dccab23e47ade3c67677a10f353b9e85

Think grub is running zpool to get the device paths, but zpool by default
doesn't output the full path and grub does not try enough prefixes on the
results, if that commit is in your version, then you can define this
environment variable to get zpool to output full paths:
ZPOOL_VDEV_NAME_PATH=1

To check if you have commit (should see full paths):

ZPOOL_VDEV_NAME_PATH=1 zpool status

If so you can do:

ZPOOL_VDEV_NAME_PATH=1 grub-whatevs ....

Hope that helps,

Andrew

On Tue, 14 Jun 2016, 8:22 AM James via zfs-discuss <
zfs-discuss at list.zfsonlinux.org> wrote:

> Hi,
>
> Hoping I could get some help with a (seemingly) relatively simple
> setup that I'm struggling to complete.
>
> I have a server with 6 identical drives; I've encrypted all drives via
> LUKS and created a zpool using the crypto devices. The disks are
> partitioned identically:
>
> # fdisk -l /dev/sda
> Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: gpt
> Disk identifier: 9BF6F9E5-863F-4A8E-A9EC-82E24670ADC3
>
> Device        Start      End  Sectors Size Type
> /dev/sda1      2048 41906175 41904128  20G Solaris /usr & Apple ZFS
> /dev/sda2  41906176 41924607    18432   9M BIOS boot
> /dev/sda9  41924608 41943006    18399   9M Solaris reserved 1
>
> ~# ls /dev/disk/by-id/*CRYPT*
>
> /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-2da63c7ccee346d2af57ce887eeb8411-crypto-d
>
> /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-6a338a713b224c129ea6b26ceb90b499-crypto-a
>
> /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-70c5772bf8c14f3a8480acdffee86afd-crypto-b
>
> /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-7af8ecc364304c369fb7de9d9ff9709d-crypto-e
>
> /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-a88a6d8e7d02427c94e7ebd1ade1e5ed-crypto-f
>
> /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-c5fa340070064c1ba8195618998ba58b-crypto-c
>
>
> ~# zpool status
>   pool: rpool
>  state: ONLINE
>   scan: none requested
> config:
>
> NAME
> STATE     READ WRITE CKSUM
> rpool
> ONLINE       0     0     0
>  raidz2-0
> ONLINE       0     0     0
>    dm-uuid-CRYPT-LUKS1-2da63c7ccee346d2af57ce887eeb8411-crypto-d
> ONLINE       0     0     0
>    dm-uuid-CRYPT-LUKS1-6a338a713b224c129ea6b26ceb90b499-crypto-a
> ONLINE       0     0     0
>    dm-uuid-CRYPT-LUKS1-70c5772bf8c14f3a8480acdffee86afd-crypto-b
> ONLINE       0     0     0
>    dm-uuid-CRYPT-LUKS1-7af8ecc364304c369fb7de9d9ff9709d-crypto-e
> ONLINE       0     0     0
>    dm-uuid-CRYPT-LUKS1-c5fa340070064c1ba8195618998ba58b-crypto-c
> ONLINE       0     0     0
>
> errors: No known data errors
>
> Using a live CD I've debootstrapped a Ubuntu 16.04 Xenial into my
> pool, shown below as rpool/root/ubuntu.
>
> ~# zfs list
> NAME                     USED  AVAIL  REFER  MOUNTPOINT
> rpool                   2.79G  54.3G   170K  /mnt/ubuntu
> rpool/home               383K  54.3G   170K  /mnt/ubuntu/home
> rpool/home/root          213K  54.3G   213K  /mnt/ubuntu/root
> rpool/root               675M  54.3G   170K  /mnt/ubuntu
> rpool/root/ubuntu        675M  54.3G   675M  /mnt/ubuntu
> rpool/root/ubuntu/boot   170K  54.3G   170K  /mnt/ubuntu
> rpool/swap              2.13G  56.4G   114K  -
>
> This is where things get fuzzy: I've configured all the basic OS-level
> constructs: fstab (empty because zfs does this for me), network,
> timezone, users, etc. Things blow up when I attempt to install GRUB:
>
> /# grub-install /dev/sda
> Installing for i386-pc platform.
> The /dev/zfs device is missing and must be created.
> Try running 'udevadm trigger' as root to create it.
> grub-install: error: failed to get canonical path of `rpool/root/ubuntu'.
>
> I came across a hack found on various tutorials online where all
> crypto devices are symlinked from /dev/disk/by-id/* to /dev. This did
> _not_ address my problem.
>
> At this point I'm completely out of ideas. I am not sure if this is a
> problem with GRUB or my partitioning scheme, but after trying a few
> I'm at a complete loss.
>
> Any thoughts, ideas or pointers greatly appreciated.
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss at list.zfsonlinux.org
> http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20160614/1742b245/attachment.html>


More information about the zfs-discuss mailing list