Bug 1113679 - fsadm: --resizefs fails for LUKS encrypted LVs
Summary: fsadm: --resizefs fails for LUKS encrypted LVs
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Kozina
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1113681
TreeView+ depends on / blocked
 
Reported: 2014-06-26 15:38 UTC by Bryn M. Reeves
Modified: 2017-10-10 14:36 UTC (History)
11 users (show)

Fixed In Version: 2,02.176
Doc Type: Enhancement
Doc Text:
Clone Of:
: 1113681 (view as bug list)
Environment:
Last Closed: 2017-10-10 14:36:03 UTC
Type: Bug


Attachments (Terms of Use)

Description Bryn M. Reeves 2014-06-26 15:38:38 UTC
Description of problem:
Using --resizefs with lvextent / lvresize etc. on a LUKS encrypted LV results in:

$ sudo lvextend -L +2g --resizefs vg_hex/lv_home
fsck from util-linux 2.24.2
fsck: fsck.crypto_LUKS: not found
fsck: error 2 while executing fsck.crypto_LUKS for /dev/mapper/vg_hex-lv_home
  Filesystem check failed.


Version-Release number of selected component (if applicable):
$ rpm -q lvm2
lvm2-2.02.106-1.fc20.x86_64


How reproducible:
100%

Steps to Reproduce:
1. lvcreate -n $LV_NAME -L 8M $VG_NAME
2. cryptsetup luksFormat /dev/$VG_NAME/$LV_NAME
[...]
3. cryptsetup luksOpen /dev/$VG_NAME/$LV_NAME
4. Create a file system supported by fsadm on the LUKS volume
5. Attempt to resize the LV and its contents:
# lvextend -L +8M --resizefs $VG_NAME/$LV_NAME

Actual results:
Tries to treat LUKS as a file system:
$ sudo lvextend -L +2g --resizefs vg_hex/lv_home
fsck from util-linux 2.24.2
fsck: fsck.crypto_LUKS: not found
fsck: error 2 while executing fsck.crypto_LUKS for /dev/mapper/vg_hex-lv_home
  Filesystem check failed.

Expected results:
Handles LUKS as a special case and issues the appropriate combination of file system resize and crypsetup resize commands.

Additional info:

Comment 1 Fedora End Of Life 2015-05-29 12:13:48 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2015-06-29 21:20:34 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 Ondrej Kozina 2015-09-24 10:04:38 UTC
(for starters let's document why we won't allow resize of inactive luks container and skip awkward fsck.crypto_LUKS call)

Next step would be to investigate if it's safe to resize active luks container with known filesystem on top (but certainly no other stacking support like resize PV on top of luks on top of and so on...)

Comment 4 Peter Rajnoha 2015-09-24 10:20:40 UTC
(In reply to Ondrej Kozina from comment #3)
> (for starters let's document why we won't allow resize of inactive luks
> container and skip awkward fsck.crypto_LUKS call)

(...generally, anything on top of LV which is not an FS, but anything else in between...)

Comment 5 Ondrej Kozina 2017-10-10 14:32:23 UTC
implemented with https://sourceware.org/git/?p=lvm2.git;a=commit;h=30293baaa0f87efeab81f01f9c5d73b26869babf

Currently we support following:

a) resize (grow and shrink as long as the fs supports it) of an LV containing LUKS header of active device. We do NOT support detached LUKS headers for "lvresize -r" case. In other target LV has to host also ciphertext data for LUKS header at the beginning.

b) same as a) but instead of running "lvresize -r" comannd, user may run "fsadm --lvresize resize /dev/vg/lv..."

c) resize of any active crypt device (recognised by system cryptsetup utility) after running "fsadm --cryptresize resize /dev/mapper/unlocked_devname". It'll resize filesystem together with active crypt device.


Note You need to log in before you can comment on or make changes to this bug.