-   Linux - Newbie (
-   -   Reduce Logical volume size (

linuxmantra 05-05-2014 11:19 PM

Reduce Logical volume size
[root@redhatserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
27G 1.7G 24G 7% /
tmpfs 733M 0 733M 0% /dev/shm
/dev/sda1 485M 33M 428M 8% /boot
17G 70M 16G 1% /option

I want to reduce the size of logical volume /dev/mapper/VolGroup-vol01 to 5G. I made following steps to reduce the lv size:
1. unmount /option
2. e2fsck -f /dev/mapper/VolGroup-vol01
3. resize2fs -p /dev/mapper/VolGroup-vol01 <size of FS>
4. lvreduce -L-12G /dev/mapper/VolGroup-vol01
and so on....
Main problem for me is, how much to put the size of FS in step no 3. I could not figure it out. I can do all, if some one suggest me how to choose the size of FS in step 3.

Thank you in advance.

syg00 05-05-2014 11:55 PM

Any size smaller than the lv will become. Make it one Gig to be safe, then re-run the resize2fs (note the command name) after the lvreduce - without specifying a size, and it will fill the lv.

All times are GMT -5. The time now is 06:50 PM.