Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1663473

Summary: lvresize fails to resize non-clean filesystem [rhel-7.9.z]
Product: Red Hat Enterprise Linux 7 Reporter: Ondrej <ondrej.valousek.xm>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Scripts / lvmdump / vgimportclone QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, jreznik, mcsontos, mjuricek, msnitzer, ondrej.valousek.xm, prajnoha, thornber, zkabelac
Version: 7.5Keywords: ZStream
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.187-6.el7_9.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-15 11:23:10 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 Ondrej 2019-01-04 12:56:40 UTC
Description of problem:

[root@predator test]# lvresize -r -L 10G /dev/os/root 
fsck from util-linux 2.23.2
/dev/mapper/os-root: recovering journal
/dev/mapper/os-root: Clearing orphaned inode 20120025 (uid=0, gid=0, mode=0100644, size=2429)
/dev/mapper/os-root: Clearing orphaned inode 6881804 (uid=0, gid=0, mode=040500, size=4096)
/dev/mapper/os-root: Clearing orphaned inode 6882991 (uid=0, gid=0, mode=0100600, size=0)
/dev/mapper/os-root: Clearing orphaned inode 6914113 (uid=50985, gid=1093, mode=040500, size=4096)
/dev/mapper/os-root: Clearing orphaned inode 20087595 (uid=0, gid=0, mode=0100200, size=0)
/dev/mapper/os-root: Clearing orphaned inode 6914232 (uid=0, gid=0, mode=0100600, size=405)
/dev/mapper/os-root: Adding dirhash hint to filesystem.

/dev/mapper/os-root: Inode 20087306, i_size is 192240, should be 196608.  FIXED.
/dev/mapper/os-root: Inode 20087306, i_blocks is 384, should be 392.  FIXED.
/dev/mapper/os-root: 162926/56295424 files (0.8% non-contiguous), 2802886/56270848 blocks
  Filesystem check failed.

Obviously lvresize is running fsck first (which is right thing, I have forgotten to do that manually), fsck finds and corrects a problem on the filesystem, but yet lvresize refuses to complete the operation.

Comment 2 Zdenek Kabelac 2019-01-07 15:16:27 UTC
(In reply to Ondrej from comment #0)
> Description of problem:
> /dev/mapper/os-root: Inode 20087306, i_blocks is 384, should be 392.  FIXED.
> /dev/mapper/os-root: 162926/56295424 files (0.8% non-contiguous),
> 2802886/56270848 blocks
>   Filesystem check failed.
> 
> Obviously lvresize is running fsck first (which is right thing, I have
> forgotten to do that manually), fsck finds and corrects a problem on the
> filesystem, but yet lvresize refuses to complete the operation.


fsck returns 'error'  (check failed) so this is (ATM) clear indication to stop any further action with filesystem.

As a workaround you may want to 'skip' any fsck part (so ignore any possible problem with filesystem you might have),
pass the option  --nofsck  (but then do not be surprised with various hard fs errors in the middle
of lvresize operation - usually leading to severe fs destruction).

ATM lvm2 is not recognizing errors so maybe return 'error' status 1  could be considered as the one to continue?

Not sure if this was your case - but is this what is asked here as enhancement ?

Comment 3 Ondrej 2019-01-07 15:30:42 UTC
Well, the true is that I do not know where is that message "Filesystem check failed." coming from.
I guess it must have been from the the lvresize because after I received that error, I ran fsck myself manually - it found no errors.
Then I re-run the lvresize one more time - it succeeded.

Comment 4 Zdenek Kabelac 2020-10-24 00:03:40 UTC
fsadm handles now more correctly errors and accepts  '1' from fsck as a value for corrected filesystem
through these 2 main patches:

upstream:
https://www.redhat.com/archives/lvm-devel/2020-October/msg00189.html
https://www.redhat.com/archives/lvm-devel/2020-October/msg00190.html

stable-2.02:

https://www.redhat.com/archives/lvm-devel/2020-October/msg00185.html
https://www.redhat.com/archives/lvm-devel/2020-October/msg00183.html

Comment 15 errata-xmlrpc 2020-12-15 11:23:10 UTC
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-2020:5461