Skip to contentSkip to conversation

LVM reducing.

linux-lvm Christian Reiss 2 participants 2 messages Feb 19, 2004 – Feb 20, 2004

lore
Share & tools
lore
#0 lore raw

Greetings,

I am running the LVM2 version now, as LVM1 corrupted the VG.
So i converted it to LVM2 (figured it would re-do the master-data-thingy), and it works.

Now, (presumably Heinz :) how can I safely reduce the size under LVM2? LVM1 had this e2fsadm jiggamagic-thingy-thing - anything LVM2 offers to safely reduce the data?

-Christian.

Signature · 5 lines
Christian Reiss <[email protected]>
demonserver.de

Key fingerprint = 2999 B7CD A218 06DF D658  5BE3 18B6 B232 02FF 71B2
Public Key can be obtained here: http://www.demonlord.de/pgp.txt
#1 lore raw
Quoted 9 lines · Christian Reiss

Greetings,

I am running the LVM2 version now, as LVM1 corrupted the VG. So i converted it to LVM2 (figured it would re-do the master-data-thingy), and it works.

Now, (presumably Heinz :) how can I safely reduce the size under LVM2? LVM1 had this e2fsadm jiggamagic-thingy-thing - anything LVM2 offers to safely reduce the data?

There is no e2fsadm for LVM2.

What I tend to do is to reduce the filesystem by a little more than I need, then reduce the LV by the "correct" amount, then resize the the filesystem to fill the LV. It's a little bit of a faff but it avoids any nasty accidents or rounding errors:

eg: To remove 2Gig from an LV

# resize_reiserfs -s -2300M /dev/vg00/fs
# lvreduce -L -2G /dev/vg00/fs
# resize_reiserfs /dev/vg00/fs

That works for ext2/3 etc as well as reiser, just use the relevant resize command.

patrick