LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reduce Logical volume size (https://www.linuxquestions.org/questions/linux-newbie-8/reduce-logical-volume-size-4175504032/)

linuxmantra 05-05-2014 11:19 PM

Reduce Logical volume size
 
[root@redhatserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
27G 1.7G 24G 7% /
tmpfs 733M 0 733M 0% /dev/shm
/dev/sda1 485M 33M 428M 8% /boot
/dev/mapper/VolGroup-vol01
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 02:48 PM.