ZFS pool detection problem with cryptsetup

carsten2

Well-Known Member
Mar 25, 2017
249
21
58
55
I use full disk encryption with cryptsetup for the rpool disks and separate vmdate disks.
The disks are decrypted at boot time with the initramfs option in crypttab.
The boot work fine but the data pool is not recognized and imported reliably.
Only after a "partprobe" command it is imported.
It seems that the boot process is missing this probing for encrypted disks partitions anyhow.

Any idea how to solve this?
 
Interesting. If you need to do a partprobe, then the best way is to create a udev-rule.
Code:
ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="nvme[0-1]", ENV{ID_SERIAL_SHORT}=="XXXX"  RUN+="/sbin/partprobe"
Or something similar.

Edit:
I am using zfs on luks for my HDD pool, but not for the root pool. No partprobe needed.
However, I had a case when I had to use partprobe for the root device, since it was a sed drive. Using a udev rule with a script fixed this issue.
 
Last edited:
Where to I have to put this UVEV rule?

In the meantime it discovered that using partitions in a luks encrypted drive seems to be the problem.
After the system boots, lsblk gives the following picture:


Code:
nvme0n1      259:0    0 953.9G  0 disk
└─nvme0n1p1  259:1    0   400G  0 part
  └─nvme-c1  253:8    0   400G  0 crypt

After partprobe it looks like this:

Code:
nvme0n1         259:0    0 953.9G  0 disk
└─nvme0n1p1     259:1    0   400G  0 part
  └─nvme-c1     253:8    0   400G  0 crypt
    ├─nvme-c1p1 253:9    0     1G  0 part
    └─nvme-c1p2 253:10   0   200G  0 part

The subpartitions were not detected so the pool could not be imported. I then created two top partitions on nvme0n1 and make two separate luks volumes, which now seem to work.

Code:
nvme0n1      259:0    0 953.9G  0 disk
├─nvme0n1p1  259:1    0   400G  0 part
│ └─nvme-c1  253:8    0   400G  0 crypt
└─nvme0n1p2  259:2    0     1G  0 part
  └─nvme-c2  253:9    0  1022M  0 crypt
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!