Bug 480022
Summary: | fsadm fails growing fs with block size != 1K | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Bryn M. Reeves <bmr> | ||||
Component: | lvm2 | Assignee: | Milan Broz <mbroz> | ||||
Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | low | ||||||
Version: | 4.7 | CC: | agk, cmarthal, dwysocha, edamato, heinzm, jbrassow, mbroz, prockai, pvrabec, tao | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 480023 (view as bug list) | Environment: | |||||
Last Closed: | 2009-05-18 20:10:59 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: | |||||||
Attachments: |
|
Description
Bryn M. Reeves
2009-01-14 16:14:45 UTC
Computation of the size to pass to the child fsadm invocation from LVM2 code is in bytes, not file system blocks (which is expected; the LVM2 tools don't have any idea what content is on the device nor should they): do_resizefs_reduce(): if (dm_snprintf(size_buf, SIZE_BUF, "%" PRIu64, (uint64_t) lp->extents * vg->extent_size / 2) < 0) { log_error("Couldn't generate new LV size string"); return 0; } But fsadm is expecting an argument in blocks: new_size — Absolute number of filesystem blocks to be in the filesystem Created attachment 329026 [details]
fix units passed to fasdm in lvresize
The units used to calculate the new fs size are kilobytes (extents * extent_size) so tell fsadm that by adding a "K" suffix to the size strings built in lvresize.c.
Using the patch from comment #2 I can now grow 1k/2k/4k block size ext2/3 file systems: # (lvremove -f t0/l0; lvcreate -n l0 -L 400M t0; mke2fs -b4096 -j /dev/t0/l0; mount /dev/t0/l0 /mnt; umount /mnt; e2fsck -f /dev/t0/l0) &> /dev/null # fsadm --lvresize resize /dev/t0/l0 1G fsck 1.35 (28-Feb-2004) e2fsck 1.35 (28-Feb-2004) /dev/mapper/t0-l0: clean, 11/102400 files, 7394/102400 blocks Extending logical volume l0 to 1.00 GB Logical volume l0 successfully resized resize2fs 1.35 (28-Feb-2004) Resizing the filesystem on /dev/mapper/t0-l0 to 262144 (4k) blocks. The filesystem on /dev/mapper/t0-l0 is now 262144 blocks long. # (lvremove -f t0/l0; lvcreate -n l0 -L 400M t0; mke2fs -b2096 -j /dev/t0/l0; mount /dev/t0/l0 /mnt; umount /mnt; e2fsck -f /dev/t0/l0) &> /dev/null # fsadm --lvresize resize /dev/t0/l0 1G fsck 1.35 (28-Feb-2004) e2fsck 1.35 (28-Feb-2004) /dev/mapper/t0-l0: clean, 11/102544 files, 11757/204800 blocks Extending logical volume l0 to 1.00 GB Logical volume l0 successfully resized resize2fs 1.35 (28-Feb-2004) Resizing the filesystem on /dev/mapper/t0-l0 to 524288 (2k) blocks. The filesystem on /dev/mapper/t0-l0 is now 524288 blocks long. # (lvremove -f t0/l0; lvcreate -n l0 -L 400M t0; mke2fs -b1024 -j /dev/t0/l0; mount /dev/t0/l0 /mnt; umount /mnt; e2fsck -f /dev/t0/l0) &> /dev/null # fsadm --lvresize resize /dev/t0/l0 1G fsck 1.35 (28-Feb-2004) e2fsck 1.35 (28-Feb-2004) /dev/mapper/t0-l0: clean, 11/102400 files, 23472/409600 blocks Extending logical volume l0 to 1.00 GB Logical volume l0 successfully resized resize2fs 1.35 (28-Feb-2004) Resizing the filesystem on /dev/mapper/t0-l0 to 1048576 (1k) blocks. The filesystem on /dev/mapper/t0-l0 is now 1048576 blocks long. In lvm2-2.02.42-2.el4. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-0967.html |