Re: LVM resize broken file system....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 27, 2013 at 8:51 AM, Another Sillyname
<anothersname@googlemail.com> wrote:
> I had a 487G LVM that contained a single partition and a swap partition.
>
> On the data partition I had 86G free that I needed to use elsewhere.
>
> All the following have been done from a recovery disk so the data is all
> still intact.
>
> When I tried to resize to 400G it wouldn't  let me stating below mjnimum
> size...
>
> sudo resize2fs -p /dev/pathto/lvmdevice 400G
>
> However mounting it df -h reports
>
>                                                  Size      Used     Free
> /dev/pathto/lvmdevice        487G   377G     86G
>
> or in 4k blocks
>
> /dev/pathto/lvmdevice         127571672     98643758    22449438
>
> So I was forced to run the resize2fs in tye default 4k mode
>
> sudo resize2fs -p /dev/pathto/lvmdevice 105000000
>
> This should give me a sufficient overhead and finished correctly
>
> I then did
>
> sudo lvresize -L /dev/pathto/lvmdevice
>
> This also appeared to be successful.
>
> However I can't mount it as it's reporting wrong fs type, bad option etc
> error.
>
> I think I've identified the problem as a mismatch on ghe block count.
>
> Even though I resized to 105000000 blocks I now see that df -h reported the
> size as 103352144 before I did the  lvresize (I didn't notice at the time)
>
> So I think the discrepancy between the  block count size reported by df at
> 103352144 and tune2fs at 105000000 is the error.
>
> How can I change the block count number reported by tune2fs from 105000000
> to 103352144 that will then allow me to run e2fsck again?
>
> Thanks

You should use dumpe2fs -h /dev/pathto/lvmdevice | grep -i block and
look for block count and block size. Multiply those two values to
obtain the "grand total" (in bytes) that your filesystem is using. The
lv must be higher than that.

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


[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux