PV and LVM resize ext4

Roberto Ragusa mail at robertoragusa.it
Sat Oct 17 13:45:39 UTC 2009


Ambrogio wrote:

>> e2fsck -f /dev/vg_taitsvolume/lv_root
>> resize2fs -p /dev/vg_taitsvolume/lv_root 30G
>> lvreduce --size 30G vg_taitsvolume/lv_root --test
>> lvreduce --size 30G vg_taitsvolume/lv_root
> i suggest to reduce the LV to a little more than 30G, or you have to
> calculate at block level the right dimension. Maybe 31GB is a good
> choise to eliminate the risks of lost the last blocks in the filesystem.

Well said.
Never trust the definition of GB, the padding and rounding
rules etc.

Resize the filesystem to 20GB, then resize the volume to 30GB,
then resize the fileystem again with no size specification:
it will fill the available space (30GB).

> But... you can use a more simple algoritm
> 
> make the LV on the new disks
> resize the old fs to feet the size of the new lv (a little less)
> dd the filesystem to the new LV
> resize the new fs as to feet the entire LV

Agreed on this one too.

-- 
   Roberto Ragusa    mail at robertoragusa.it




More information about the fedora-list mailing list