Skip to contentSkip to conversation

lvm2 and partition shringkin: superblock/filesystem size mismatch

linux-lvm Johannes Graumann 2 participants 6 messages Dec 1, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

I'm running debian testing and "/home" is an ext3 fs. I run the following order of commands to shrink the fs and the corresponding partition:

e2fsck -f /dev/mapper/mygroup-home resize2fs /dev/mapper/mygroup-home 55329357 lvreduce -L 208.5g /dev/mapper/mygroup-home

The latter was supposed to be .5g bigger than necessary (paranoia regarding the data integrity kicking in).

"e2fck /dev/mapper/mygroup-home" now stops with superblock/filesystem size mismatch, but I can't grow the fs into the new partition size, as "resize2fs" wants "e2fsck" (stopping with the mismatch) first.

The fs is mountable and everything seems allright otherwise.

Any pointers on how to update the superblock's size statement?

Thanks, Joh

#1 lore raw
Quoted 8 lines · Johannes Graumann

Hi,

I'm running debian testing and "/home" is an ext3 fs. I run the following order of commands to shrink the fs and the corresponding partition:

e2fsck -f /dev/mapper/mygroup-home resize2fs /dev/mapper/mygroup-home 55329357 lvreduce -L 208.5g /dev/mapper/mygroup-home

"""
The size parameter specifies the requested new size of the filesystem. If no units are specified, the units of the size parameter shall be the filesystem blocksize of the filesystem.
"""

assuming 4k block size,
55329357 * 4k Byte == 221317428 kB
221317428 / 1024 / 1024

	==> 211.some GiB

You reduced to 208.5, you truncated the file system. Unless I did get it wrong myself ;)

Quoted 10 lines

The latter was supposed to be .5g bigger than necessary (paranoia regarding the data integrity kicking in).

"e2fck /dev/mapper/mygroup-home" now stops with superblock/filesystem size mismatch, but I can't grow the fs into the new partition size, as "resize2fs" wants "e2fsck" (stopping with the mismatch) first.

The fs is mountable and everything seems allright otherwise.

Any pointers on how to update the superblock's size statement?

Resize to >= 212g, preferably with the same logical extents mapping to the same physical extents (look at your meta data backups). Then fsck again. You may be lucky enough that nothing really was stored in those truncated 3Gig, or that the PEs have not yet been recycled, you are able to map them back, and the data that was there is still there...

Signature · 5 lines
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD� and LINBIT� are registered trademarks of LINBIT, Austria.
#2 lore raw

[linux-lvm] [SOLVED]: lvm2 and partition shringkin: superblock/filesystem size mismatch

In reply to Johannes Graumann

mke2fs -b 4096 -t ext3 -S /dev/mapper/mygroup-home

on the unmounted file system solved my issue.

Joh

Quoted 27 lines · Johannes Graumann

Hi,

I'm running debian testing and "/home" is an ext3 fs. I run the following order of commands to shrink the fs and the corresponding partition:

e2fsck -f /dev/mapper/mygroup-home
resize2fs /dev/mapper/mygroup-home 55329357
lvreduce -L 208.5g /dev/mapper/mygroup-home

The latter was supposed to be .5g bigger than necessary (paranoia regarding the data integrity kicking in).

"e2fck /dev/mapper/mygroup-home" now stops with superblock/filesystem size mismatch, but I can't grow the fs into the new partition size, as "resize2fs" wants "e2fsck" (stopping with the mismatch) first.

The fs is mountable and everything seems allright otherwise.

Any pointers on how to update the superblock's size statement?

Thanks, Joh

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw

Re: [linux-lvm] [SOLVED]: lvm2 and partition shringkin: superblock/filesystem size mismatch

And yes, by that I set the truncation of the FS (thanks, Lars for pointing that out) in stone ...

Joh

Quoted 42 lines · Johannes Graumann

mke2fs -b 4096 -t ext3 -S /dev/mapper/mygroup-home

on the unmounted file system solved my issue.

Joh

Quoted 20 lines · Johannes Graumann

Hi,

I'm running debian testing and "/home" is an ext3 fs. I run the following order of commands to shrink the fs and the corresponding partition:

e2fsck -f /dev/mapper/mygroup-home
resize2fs /dev/mapper/mygroup-home 55329357
lvreduce -L 208.5g /dev/mapper/mygroup-home

The latter was supposed to be .5g bigger than necessary (paranoia regarding the data integrity kicking in).

"e2fck /dev/mapper/mygroup-home" now stops with superblock/filesystem size mismatch, but I can't grow the fs into the new partition size, as "resize2fs" wants "e2fsck" (stopping with the mismatch) first.

The fs is mountable and everything seems allright otherwise.

Any pointers on how to update the superblock's size statement?

Quoted 7 lines

Thanks, Joh

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#4 lore raw

Re: [linux-lvm] [SOLVED]: lvm2 and partition shringkin: superblock/filesystem size mismatch

Quoted 2 lines · Johannes Graumann

And yes, by that I set the truncation of the FS (thanks, Lars for pointing that out) in stone ...

Soo... did the fsck you ran immediately after the mke2fs -S complain, or did you get away with no more than a fright?

Lars

#5 lore raw

Re: [linux-lvm] [SOLVED]: lvm2 and partition shringkin: superblock/filesystem size mismatch

There ware complaints about unmatching group sizes, so I guess I lost data.

Joh

Quoted 14 lines · Lars Ellenberg
Quoted 2 lines · Johannes Graumann

And yes, by that I set the truncation of the FS (thanks, Lars for pointing that out) in stone ...

Soo... did the fsck you ran immediately after the mke2fs -S complain, or did you get away with no more than a fright?

Lars

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/