LVM Resize a Filesystem
Jump to navigation
Jump to search
AIX
Extend a Filesystem
- # chfs -a size=+<additional size>M <absolute path to filesystem>
Reduce a Filesystem
- # chfs -a size=-<additional size>M <absolute path to filesystem>
Linux
Extend a Filesystem
- # lvextend -L +<size in MB>M /dev/rootvg/<logical volume>
- # resize2fs /dev/<volume group>/<logical volume>
Reduce a Filesystem
- Note: You may have to change to runlevel 1 in order to unmount.
- This can be done online, but it is advised to dismount the filesystem before reducing the size.
- # umount /dev/<volume group>/<logical volume>
- Force check the filesystem to ensure it is clean. DO NOT RUN e2fsck IF THE FILESYSTEM IS MOUNTED.
- # e2fsck –f /dev/<volume group>/<logical volume>
- Reduce the filesystem.
- # resize2fs /dev/<volume group>/<logical volume> <size in MB>M
- Reduce the logical volume.
- # lvreduce –L -<size in MB>M /dev/<volume group>/<logical volume>
- Mount the filesystem.
- # mount /dev/<volume group>/<logical volume>