Ubuntu reduse lvm vol

1. Reboot the computer with the CD in and boot off of CD.
2. Select Rescue a Broken System. When it gets to the point of asking you to mount a file system, tell it not to mount any file system and run from the install root.
3. From the command line, type lvmdiskscan
4. This will show you all the disks. You will see your root volume. For these purposes, it is called /dev/VolGrp000/root.
5. Run e2fsck -f /dev/VolGrp000/root
6. After that completes, run resize2fs /dev/VolGrp000/root 3932160
I went to http://www.unitconversion.org/unit_converter/data-storage.htmlto convert 15Gb to Blocks. Make sure you use Gb and not GB. Also, do not shrink your root filesystem smaller than what it being used. Make sure you know how much is being used and allow some room for growth. This takes a while to run.
7. Once complete you can mount the volume and verify that it did shrink by running mount /dev/VolGrp000/root /mnt and then run df and you will see the new size. After this, unmount the volume with umount /mnt
8. Now we can put the rest of the space back into the LV pool. Run
lvreduce -L 15G /dev/VolGrp000/root
Word of caution, don't shrink it smaller then what you resize2fs it otherwise you will really break your system. This will put the space back into a Spare status and you can use it as you wish.
9. Now, you can move the free 15GB to /home logical volume.
lvextend -L+15G /dev/VolGrp000/home
10. Now you have to resize the filesystem to match the size of the logical volume
resize2fs /dev/VolGrp000/home
11. Reboot your PC and you are done.
 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章