In this post we are going to see Reducing LVM xfs format filesystem.
Reducing LV size on xfs fileystem is little different from reducing LV size on etx4/3/2 fileystem’s.
Follow the below steps to perform this:
1. As first step take data backup using xfsdump
2. Then unmount the fileysystem
3. Now shrink the logical volume to the required size using lvreduce command.
4. Format the filesystem using xfs format.
Note: While we reducing size over etx4/3/2 filesystems, will use resize2fs command to shrink instead of formating. So, we no need to take data backup while using etx4/3/2 filesystem for LVM.
5. Mount the filesystem again.
6. Now finally restore the data using xfsrestore command.
LVM details are below:
VG Name: newvg
LV’s: lv1, lv2. Going to use lv2 for this lab.
Use lvs command to check the size of existing LV’s
[root@localhost ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv1 newvg -wi-ao---- 6.00g lv2 newvg -wi-a----- 7.00g
lv2 has been mounted under /lvolume2 mount point. Now take the backup of /lvolume2 under /tmp filesystem like below.
[root@localhost ~]#xfsdump -f /tmp/lv2.dump /lvolume2
Now unmount the filesystem using below command:
[root@localhost ~]# umount /lvolume2
Reduce or shrink the size to required size using lvreduce command:
In below example we are going to reduce the lv2 filesystem size from 7Gb to 6GB.
[root@localhost ~]# lvreduce -L -1G /dev/newvg/lv2 WARNING: Reducing active logical volume to 6.00 GiB. THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce newvg/lv2? [y/n]: y Size of logical volume newvg/lv2 changed from 7.00 GiB (1792 extents) to 6.00 GiB (1536 extents). Logical volume newvg/lv2 successfully resized.
Now format the filesystem using below command:
[root@localhost ~]#mkfs.xfs -f /dev/newvg/lv2
Mount the filesystem again into the /lvolume2
[root@localhost ~]#mount /dev/newvg/lv2 /lvolume2
Finally restore the backup data
[root@localhost ~]#xfsrestore -f /tmp/lv2.dump /lvolume2
Reference: yallalabs
You made some first rate factors there. I seemed on the internet for the issue and found most individuals will go along with together with your website.
It is not my first time to visit this site, i am browsing this web site dailly and get fastidious information from here
daily.