View previous topic :: View next topic |
Author |
Message |
salam Apprentice
Joined: 29 Sep 2005 Posts: 226
|
Posted: Fri Mar 03, 2006 11:02 am Post subject: LVM: lvreduce autodetect? |
|
|
reading the man page of lvreduce, i've found nothing about automatic reducing of the lv size to the size of its filesystem. for example resize_reiserfs /dev/vg/var (without any more parameters) increases the size of the fs to exactly fit the lv size. when increasing the fs size i must first increase the lv size and then resize_reiserfs (or any other fs type used). this can be done automatically using the above command. but when reducing the size, the procedure is backwards (for example resize_reiserfs -s -128M /dev/vg/var and then lvreduce -L-128M /dev/vg/var) i'd like to have it done automatically without specifying the size in lvreduce (so the system detects that reiserfs size is 128M less than lv size => reduce the lv size to match fs size) can this be done? |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9555 Location: beyond the rim
|
Posted: Fri Mar 03, 2006 11:45 pm Post subject: |
|
|
Disclaimer: I don't have a real clue about this, more or less just guessing here
Not reliably. Mainly the problem is that LVM doesn't know if there is actually a filesystem on the volume, the only more or less reliable ways to access filesystem information are a) parsing the whole block device (slow, needs new code for each filesystem) or b) asking the kernel (only works if the filesystem is mounted, not sure if statvfs will actually give you the physical size) |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|