ext4 lvreduce报错superblock or the partition table is likely to be corrupt

1. 缩小ext4 lv未按照步骤导致缩小之后挂载报错

# mount -a
The filesystem size (according to the superblock) is xxxx blocks
The physical size of the device is xxxx blocks
Either the superblock or the partition table is likely to be corrupt!

2. 故障回放

# lvreduce -L 99G /dev/pgdata/lvol0  -- 未umount,直接lvreduce
# mount -a     -- 报错
The filesystem size (according to the superblock) is xxxx blocks
The physical size of the device is xxxx blocks
Either the superblock or the partition table is likely to be corrupt!

3. 问题解决

-- 只需要再次lvresize将lv扩容至原来大小,再按照正规流程走一遍即可解决
# umount /pgdata
# lvresize -L 199G /dev/pgdata/lvol0  --扩容至原来lv大小
# e2fsck -f /dev/mapper/pgdata-lvol0  --检查ext4文件系统,并校正
# lvreduce -L 99G /dev/pgdata/lvol0   --lvreduce缩容
# e2fsck -f /dev/mapper/pgdata-lvol0  --检查ext4文件系统,并校正

或者使用resize2fs刷新,lvresize -r、fsadm也可以达到此目的

# resize2fs /dev/mapper/pgdata-lvo10

4. 缩容有风险,尽量不要缩容

请使用浏览器的分享功能分享到微信等