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

[linux-lvm] LVM resize broken file system....



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





--
Sent from Tablet

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