Bug 801640

Summary: [RFE] the error reported by resize2fs-M need to be more clear
Product: Red Hat Enterprise Linux 6 Reporter: Mohua Li <moli>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: leiwang, qguan, qwan, wshi
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.16.31-2.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:38:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mohua Li 2012-03-09 04:28:57 UTC
Description of problem:
the error reported by libguestfs api resize2fs-M is wrong,

without trace,

><fs> resize2fs-M /dev/vda1
libguestfs: error: resize2fs_M: you need to run e2fsck with the correct and/or forceall options first


with trace, can see it's cause by the size of the disk,

><fs> resize2fs-M /dev/vda1
libguestfs: send_to_daemon: 60 bytes: 00 00 00 38 | 20 00 f5 f5 | 00 00 00 04 | 00 00 01 19 | 00 00 00 00 | ...
guestfsd: main_loop: proc 304 (e2fsck) took 0.16 seconds
guestfsd: main_loop: new request, len 0x38
resize2fs -M /dev/vda1
resize2fs 1.41.12 (17-May-2010)
resize2fs: Not enough space to build proposed filesystem while trying to resize /dev/vda1
Please run 'e2fsck -fy /dev/vda1' to fix the filesystem
after the aborted resize operation.
guestfsd: error: you need to run e2fsck with the correct and/or forceall options first
guestfsd: main_loop: proc 281 (resize2fs_M) took 0.04 seconds
libguestfs: recv_from_daemon: 120 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 19 | 00 00 00 01 | 00 12 34 1a | ...
libguestfs: error: resize2fs_M: you need to run e2fsck with the correct and/or forceall options first


i think libguestfs need to return different error message according to resize2fs's error message, but not all " you need to run e2fsck with the correct and/or forceall options first"

Version-Release number of selected component (if applicable):
libguestfs-1.16.8-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.guestfish -N -fs 
2.resize2fs-M /dev/vda1
3.
  
Actual results:


Expected results:
show the resize2fs error " Not enough space to build proposed filesystem while trying to resize /dev/vda1" instead " resize2fs_M: you need to run e2fsck with the correct and/or forceall options first"

Additional info:

Comment 2 Richard W.M. Jones 2012-03-09 18:15:33 UTC
I posted a fix upstream, but it is far too invasive for 6.3.

https://www.redhat.com/archives/libguestfs/2012-March/msg00049.html

Moving this bug to 6.4.

Comment 5 RHEL Program Management 2012-07-10 06:19:38 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2012-07-11 00:01:27 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 8 Wei Shi 2012-11-01 09:42:30 UTC
Reproduced:
libguestfs-1.16.19-1.el6.x86_64

# guestfish -N fs
><fs> resize2fs-M /dev/vda1
libguestfs: error: resize2fs_M: you need to run e2fsck with the correct and/or forceall options first
><fs> 



Verified:
libguestfs-1.16.32-2.el6.x86_64

# guestfish -N fs
><fs> resize2fs-M /dev/vda1
libguestfs: error: resize2fs_M: resize2fs 1.41.12 (17-May-2010)
resize2fs: Not enough space to build proposed filesystem while trying to resize /dev/vda1
Please run 'e2fsck -fy /dev/vda1' to fix the filesystem
after the aborted resize operation.
><fs>

Comment 10 errata-xmlrpc 2013-02-21 08:38:07 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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0324.html