Bug 11317
Summary: | Shrinking of size is failing while trying to reduce the disk size with LVM | ||
---|---|---|---|
Product: | File System | Reporter: | Rishikesh K Rajak (risrajak) |
Component: | ext4 | Assignee: | fs_ext4 (fs_ext4) |
Status: | REJECTED INVALID | ||
Severity: | high | CC: | akpm, iranna.ankad, risrajak, sandeen |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.27-rc1 | Subsystem: | |
Regression: | --- | Bisected commit-id: |
Description
Rishikesh K Rajak
2008-08-13 00:24:51 UTC
> Latest working kernel version: 2.6.27-rc1
This means that 2.6.27-rc1 works, and also doesn't work. Please clarify.
(In reply to comment #1) > > Latest working kernel version: 2.6.27-rc1 > > This means that 2.6.27-rc1 works, and also doesn't work. Please clarify. > oops sorry, it is typo, 2.6.27-rc1 kernel does not work. -Rishi OK, so which kernel _did_ work? (In reply to comment #3) > OK, so which kernel _did_ work? > Hi Andrew, I did not test with the older kernel since ext4 patches has gone recently, but planning to test with 2.6.27-rc2 and if the problem still exist will let you know. -Rishi In the original comment, I do not see a mkfs step in the reproducer. Where was mkfs done? Off the top of my head, it looks like you are reducing the size of the block device before you are running resize2fs; that won't work... you have to shrinkg the FS, then the device it's on. [root@e326 sbin]# mount ... /dev/mapper/my_volg-vol01 on /mnt type ext4dev (rw) [root@e326 sbin]# umount /mnt/tmpmount/ [root@e326 sbin]# df -h (unfortunately current size of ext4 fs is not shown) First you slice off the end of the block device: [root@e326 sbin]# lvreduce -L 4G /dev/mynew_vg/vol01 WARNING: Reducing active logical volume to 4.00 GB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce vol01? [y/n]: y Reducing logical volume vol01 to 4.00 GB Logical volume vol01 successfully resized (bells should be going off here!) *then* you try to shrink the fs: [root@e326 sbin]# ./resize2fs /dev/mynew_vg/vol01 resize2fs 1.41-WIP (17-Jun-2008) Please run 'e2fsck -f /dev/mynew_vg/vol01' first. and it finds that your block device is smaller than your fs: [root@e326 sbin]# ./e2fsck -f /dev/mynew_vg/vol01 e2fsck 1.41-WIP (17-Jun-2008) The filesystem size (according to the superblock) is 11304960 blocks The physical size of the device is 4194304 blocks You need to resize the fs, then resize the block device it's on. This looks like user error to me. I'm not even sure why this was filed as a kernel bug, since the filesystem was unmounted at the time, and this is purely an e2fsprogs issue. It's still a user error, though, since the main issue, as Eric has correctly pointed out, is that you have to shrink the filesystem before you shrink the device. A few seconds worth of thought should make it clear why this should be obvious... BTW, e2fsprogs specific bugs, should you wish to submit them to a bug tracker, can be sent to http://sourceforge.net/projects/e2fsprogs. (Or to the Debian BTS if you are using a Debian distribution, or the Fedora bugzilla if you are using Fedora, etc.) Note also that you are using a relatively old e2fsprogs (a 1.41 pre-release), and e2fpsrogs 1.41 is already out. Please see http://ext4.wiki.kernel.org for more information about ext4. We're trying to keep it much more up to date. In particular, the Howto has up-to-date instructions on how to best use ext4. (In particular, you don't need to specify -o extents as a mount option; that's superfluous these days.) Also note the IRC and the ext4 mailing list. Those are both great resources if you need some help getting started or are puzzled about why something isn't working. Thanks, regards, |