Reduce Logical Volume in RedHat Linux 5/6
* Unmount the file system. Make sure before unmounting the file system shouldn’t be used by any user or system as shown below.fuser –c –u <file system>
lsof | grep <file system>
Eg:- [root@cdtsorl267p ~]# fuser -c -u /test/
/test/: 2417(root) )
*We need to inform user and kill the process as shown below
kill -9 2417
* Unomunt the file system
umount </file system>
Eg:- umount /laxman_test
*Run fsck on the device of unmounted file system as below
fsck -f –y /dev/<VG>/<LV>
Eg:- fsck -f –y /dev/vg_cdtsyum01p/ lv_test
* Then we need to resize the blocks on the devise as below. It rearranges the blocks, so we need to give how much size we want to reduce up to.
resize2fs /dev/<VG>/<LV> <size in GB>
Eg:- If you want to reduce the file system from 10GB to 6GB, we need to run resize2fs as below
resize2fs /dev/vg_cdtsyum01p/ lv_test 6G
* It rearranges all the data to 6GB
reduce LVM linux
ReplyDelete