How can I reduce the size of my LVM?
Reducing the logical volume involves the below steps.
- Unmount the file system.
- Check the file system for any errors.
- Shrink the file system size.
- Reduce the logical volume size.
- Re-check the file system for errors (Optional).
- Mount the file system.
- Check the reduced file system size.
How reduce home LVM size in Linux?
How to resize LVM partitions – shrink home / extend root
- First step is to unmount /home partition.
- Shrink old /home partition to 20GB, (system will force you to check filesystem for errors by running e2fsck)
- Reduce the LVM to 20G.
- Extend /root LVM to new size, utilizing 100% of free space on disk.
How do I remove logical volume?
To remove an inactive logical volume, use the lvremove command. If the logical volume is currently mounted, unmount the volume before removing it. In addition, in a clustered environment you must deactivate a logical volume before it can be removed.
How do I shrink the LVM root file system?
- Step 1: Backup your data (Optional but recommended) Since you plan to shrink root LVM partition it is important that you backup your data before starting with the process.
- Step 2: Boot into rescue mode.
- Step 3: Activate Logical Volume.
- Step 4: Perform File system Check.
- Step 5: Resize root LVM partition.
How enable and disable LVM in Linux?
The format for the command to deactivate an individual logical volume is as follows.
- lvchange -an vg/lv. The format for the command to activate an individual logical volume is as follows.
- lvchange -ay vg/lv.
- vgchange -an vg.
- vgchange -ay vg.
How do I reduce the size of my root partition in Linux?
Reduce the size of root filesystem
- First, boot the system into rescue mode.
- Activate the logical volume to be reduced.
- Reduce the size of the file system and logical volume on /dev/VolGroup00/LogVol00.
- Finally reduce the size of the logical volume containing the root file system:
What is the use of resize2fs?
Description. The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing.