Bug 2165691
| Summary: | should the LV be extended when --fs resize is used and an inactive LUKS device exists on top, causing the fs check to fail? | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | David Teigland <teigland> |
| lvm2 sub component: | Changing Logical Volumes | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | unspecified | CC: | agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, teigland, zkabelac |
| Version: | 9.2 | Keywords: | Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.03.21-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-11-07 08:53:27 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Corey Marthaler
2023-01-30 19:14:13 UTC
> # lvextend --yes --fs resize -L +446M resize_matrix/resize_lv
> Rounding size to boundary between physical extents: 448.00 MiB.
> Size of logical volume resize_matrix/resize_lv changed from 30.00 GiB (7680 extents) to <30.44 GiB (7792 extents).
> Cannot find active LUKS dm-crypt device using resize_matrix/resize_lv.
> File system extend error.
> Logical volume resize_matrix/resize_lv successfully resized.
> # echo $?
> 5
This is not ideal and can be improved.
lvextend --resizefs should fail in the case where crypto_LUKS is seen on the LV, but the crypt device is missing.
Failing is correct because the user requested resizefs, but lvextend is unable to do it. (It's unable to even look for a fs when the crypt device is missing, but we assume there would be a fs there since the user has requested resizing it.)
In the example above, lvextend would ideally fail before extending the LV. That's not always possible for resizefs, but when it is possible it's the preferred behavior. In this case we can easily do that, and with that fixed, the example looks like this:
$ echo "Str0ngP455w0rd###" | cryptsetup luksFormat /dev/test/foo
$ echo "Str0ngP455w0rd###" | cryptsetup luksOpen /dev/test/foo foocr
$ cryptsetup luksClose foocr
$ lvextend -L+32M --resizefs test/foo
LUKS dm-crypt device must be active for fs resize.
$ echo $?
5
fixed in main https://sourceware.org/git/?p=lvm2.git;a=commit;h=d9f8acb65a78c20ac806efaeb7a1e39208e1a443 *** Bug 2165771 has been marked as a duplicate of this bug. *** Marking Verified:Tested in the latest rpms. kernel-5.14.0-306.el9 BUILT: Sat Apr 29 05:45:15 PM CEST 2023 lvm2-2.03.21-1.el9 BUILT: Fri Apr 21 02:33:33 PM CEST 2023 lvm2-libs-2.03.21-1.el9 BUILT: Fri Apr 21 02:33:33 PM CEST 2023 lvcreate --yes --type striped -n resize_lv -L 30G -i 2 resize_matrix Using default stripesize 64.00 KiB. Wiping crypto_LUKS signature on /dev/resize_matrix/resize_lv. Wiping crypto_LUKS signature on /dev/resize_matrix/resize_lv. Logical volume "resize_lv" created. 'echo "Str0ngP455w0rd###" | cryptsetup luksFormat /dev/resize_matrix/resize_lv' 'echo "Str0ngP455w0rd###" | cryptsetup luksOpen /dev/resize_matrix/resize_lv resize_luks' 'echo "Str0ngP455w0rd###" | cryptsetup luksClose resize_luks' deactivating LV resize_lv on grant-01.6a2m.lab.eng.bos.redhat.com lvchange --yes -an resize_matrix/resize_lv Adding additional space to resize_matrix/resize_lv on grant-01.6a2m.lab.eng.bos.redhat.com lvextend --yes --fs resize -L +420M resize_matrix/resize_lv Logical volume resize_matrix/resize_lv must be active for file system resize. activating LV resize_lv -ay on grant-01.6a2m.lab.eng.bos.redhat.com lvchange --yes -ay resize_matrix/resize_lv Adding additional space to resize_matrix/resize_lv on grant-01.6a2m.lab.eng.bos.redhat.com lvextend --yes --fs resize -L +519M resize_matrix/resize_lv LUKS dm-crypt device must be active for fs resize. PRE:31457280.0 POST:31457280.0 lvremove -f resize_matrix/resize_lv Logical volume "resize_lv" successfully removed. Works in the latest build as well. Marking VERIFIED. kernel-5.14.0-306.el9 BUILT: Sat Apr 29 05:45:15 PM CEST 2023 lvm2-2.03.21-2.el9 BUILT: Thu May 25 12:03:04 AM CEST 2023 lvm2-libs-2.03.21-2.el9 BUILT: Thu May 25 12:03:04 AM CEST 2023 ------------------------------------------------------------ lvcreate --yes --type raid1 -n resize_lv -L 30G -m 2 resize_matrix Wiping crypto_LUKS signature on /dev/resize_matrix/resize_lv. Wiping crypto_LUKS signature on /dev/resize_matrix/resize_lv. Logical volume "resize_lv" created. lvconvert --yes --raidintegrity y resize_matrix/resize_lv Using integrity block size 512 for unknown file system block size, logical block size 512, physical block size 4096. Logical volume resize_matrix/resize_lv has added integrity. 'echo "Str0ngP455w0rd###" | cryptsetup luksFormat /dev/resize_matrix/resize_lv' 'echo "Str0ngP455w0rd###" | cryptsetup luksOpen /dev/resize_matrix/resize_lv resize_luks' 'echo "Str0ngP455w0rd###" | cryptsetup luksClose resize_luks' deactivating LV resize_lv on grant-01.6a2m.lab.eng.bos.redhat.com lvchange --yes -an resize_matrix/resize_lv Adding additional space to resize_matrix/resize_lv on grant-01.6a2m.lab.eng.bos.redhat.com lvextend --yes --fs resize -L +602M resize_matrix/resize_lv Logical volume resize_matrix/resize_lv must be active for file system resize. activating LV resize_lv -ay on grant-01.6a2m.lab.eng.bos.redhat.com lvchange --yes -ay resize_matrix/resize_lv Adding additional space to resize_matrix/resize_lv on grant-01.6a2m.lab.eng.bos.redhat.com lvextend --yes --fs resize -L +557M resize_matrix/resize_lv LUKS dm-crypt device must be active for fs resize. PRE:31457280.0 POST:31457280.0 lvremove -f resize_matrix/resize_lv Logical volume "resize_lv" successfully removed. 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 (lvm2 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-2023:6633 |