Hide Forgot
Description of problem: In some cases, e.g. LUKS on an NVMe partition, the order in which lsblk returns entries changes when using --pairs: $ lsblk /dev/nvme0n1 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme0n1 259:0 0 20G 0 disk |-nvme0n1p1 259:1 0 1M 0 part |-nvme0n1p2 259:2 0 127M 0 part |-nvme0n1p3 259:3 0 384M 0 part /boot `-nvme0n1p4 259:4 0 19.5G 0 part `-root 253:0 0 19.5G 0 crypt /sysroot $ lsblk --pairs /dev/nvme0n1 NAME="root" MAJ:MIN="253:0" RM="0" SIZE="19.5G" RO="0" TYPE="crypt" MOUNTPOINT="/sysroot" NAME="nvme0n1" MAJ:MIN="259:0" RM="0" SIZE="20G" RO="0" TYPE="disk" MOUNTPOINT="" NAME="nvme0n1p1" MAJ:MIN="259:1" RM="0" SIZE="1M" RO="0" TYPE="part" MOUNTPOINT="" NAME="nvme0n1p2" MAJ:MIN="259:2" RM="0" SIZE="127M" RO="0" TYPE="part" MOUNTPOINT="" NAME="nvme0n1p3" MAJ:MIN="259:3" RM="0" SIZE="384M" RO="0" TYPE="part" MOUNTPOINT="/boot" NAME="nvme0n1p4" MAJ:MIN="259:4" RM="0" SIZE="19.5G" RO="0" TYPE="part" MOUNTPOINT="" Notice how the root LUKS device is listed first. This makes it unusable for scripts that want to go down the hierarchy starting from the bottom of the stack. Version-Release number of selected component (if applicable): util-linux-2.32.1-24.el8.x86_64 How reproducible: 100% Steps to Reproduce: 1. Set up LUKS on NVMe. 2. Run `lsblk --pairs` Actual results: The "leaf" LUKS container is listed before the partition it's sitting on. Expected results: The "leaf" LUKS container is listed after the partition it's sitting on. Additional info: We've hit this multiple times in RHCOS and have had to work around it: https://github.com/coreos/coreos-installer/pull/453 https://bugzilla.redhat.com/show_bug.cgi?id=1934174#c4
Should be fixed by upstream commit https://github.com/karelzak/util-linux/commit/529b51706ef06611a8165023f14e6593e06901de.
Yes, confirmed working with the same setup as in comment 0: ``` [root@cosa-devsh ~]# lsblk /dev/nvme0n1 --pairs NAME="root" MAJ:MIN="253:0" RM="0" SIZE="15.5G" RO="0" TYPE="crypt" MOUNTPOINT="/sysroot" NAME="nvme0n1" MAJ:MIN="259:0" RM="0" SIZE="16G" RO="0" TYPE="disk" MOUNTPOINT="" NAME="nvme0n1p1" MAJ:MIN="259:1" RM="0" SIZE="1M" RO="0" TYPE="part" MOUNTPOINT="" NAME="nvme0n1p2" MAJ:MIN="259:2" RM="0" SIZE="127M" RO="0" TYPE="part" MOUNTPOINT="" NAME="nvme0n1p3" MAJ:MIN="259:3" RM="0" SIZE="384M" RO="0" TYPE="part" MOUNTPOINT="/boot" NAME="nvme0n1p4" MAJ:MIN="259:4" RM="0" SIZE="15.5G" RO="0" TYPE="part" MOUNTPOINT="" [root@cosa-devsh ~]# rpm -Uvh *.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:libuuid-2.32.1-28.el8 ################################# [ 8%] 2:libblkid-2.32.1-28.el8 ################################# [ 17%] 3:libfdisk-2.32.1-28.el8 ################################# [ 25%] 4:libmount-2.32.1-28.el8 ################################# [ 33%] 5:libsmartcols-2.32.1-28.el8 ################################# [ 42%] 6:util-linux-2.32.1-28.el8 ################################# [ 50%] Cleaning up / removing... 7:util-linux-2.32.1-27.el8 ################################# [ 58%] 8:libfdisk-2.32.1-27.el8 ################################# [ 67%] 9:libmount-2.32.1-27.el8 ################################# [ 75%] 10:libblkid-2.32.1-27.el8 ################################# [ 83%] 11:libuuid-2.32.1-27.el8 ################################# [ 92%] 12:libsmartcols-2.32.1-27.el8 ################################# [100%] [root@cosa-devsh ~]# lsblk /dev/nvme0n1 --pairs NAME="nvme0n1" MAJ:MIN="259:0" RM="0" SIZE="16G" RO="0" TYPE="disk" MOUNTPOINT="" NAME="nvme0n1p1" MAJ:MIN="259:1" RM="0" SIZE="1M" RO="0" TYPE="part" MOUNTPOINT="" NAME="nvme0n1p2" MAJ:MIN="259:2" RM="0" SIZE="127M" RO="0" TYPE="part" MOUNTPOINT="" NAME="nvme0n1p3" MAJ:MIN="259:3" RM="0" SIZE="384M" RO="0" TYPE="part" MOUNTPOINT="/boot" NAME="nvme0n1p4" MAJ:MIN="259:4" RM="0" SIZE="15.5G" RO="0" TYPE="part" MOUNTPOINT="" NAME="root" MAJ:MIN="253:0" RM="0" SIZE="15.5G" RO="0" TYPE="crypt" MOUNTPOINT="/sysroot" ``` Thanks a lot Karel!
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (util-linux bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4490