LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   a doubt on shrinking logical volume (https://www.linuxquestions.org/questions/linux-general-1/a-doubt-on-shrinking-logical-volume-528710/)

nirmaltom 02-13-2007 12:16 PM

a doubt on shrinking logical volume
 
hi,
i am running zod and my partitions are based on lvm.
i read from resize2fs man page as

If you wish to shrink an ext2 partition, first use resize2fs to shrink
the size of filesystem. Then you may use fdisk(8) to shrink the size
of the partition. When shrinking the size of the partition, make sure
you do not make it smaller than the new size of the ext2 filesystem!

now my question is when we resize a partition , the resized no is appropriate.example if i resize a partition to extend or shrink to 500mb , it may be resized between the ranges of 470mb-530mb ,i think.

to shrink a partition they ask me to reduce the ext2 filesytem size first and then the partition second.So how can i predict the exact value of the resized partition , so that i shall reduce the filesystem value first.

is there any methods directly?

or i have to make the the file system to lower size and extend it for the remaining?

thanks for any response
regards,
Nirmal Tom.

uselpa 02-13-2007 01:33 PM

Maybe you are mixing LV and partition here.
If I understand correctly, you want to shrink the file system, and then the logical volume. Do you also want to shrink the underlying harddisk partition, or not?

nirmaltom 02-13-2007 01:57 PM

hi,
i dont want to shrink the the underluing physical partition.i want to shrink the logical volume ,say, from 800mb to 500mb

thanks and regards,
Nirmal Tom.

uselpa 02-13-2007 02:04 PM

What are the PE (physical extend) size of your VG and your PV (see vgdisplay and pvdisplay)?

nirmaltom 02-13-2007 02:21 PM

hi,
from vgdisplay,
PE Size 32.00 MB
from pvdisplay,
PE Size (KByte) 32768

thanks,
Nirmal Tom.

uselpa 02-13-2007 03:26 PM

Right, so if make your new filesystem size a multiple of 32MB, then lvreduce will not adapt that size because it is an multiple of the PE size.

Still, I strongly advise you to take a backup first.

nirmaltom 02-14-2007 12:46 AM

hi,
thanks fpor the infn
regards,
Tom


All times are GMT -5. The time now is 03:58 PM.