LVM Resize a Filesystem: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
== Linux == | == Linux == | ||
==== Extend | ==== Extend an ext4 Filesystem ==== | ||
# <tt>'''# lvextend -L +<size | # Increase the size of the logical volume. | ||
# <tt>'''# resize2fs /dev/< | #:<tt>'''# lvextend -L +<size>[M | G] /dev/<volume_group>/<logical_volume>'''</tt> | ||
# Resize the underlying filesystem | |||
#: <tt>'''# resize2fs /dev/<volume_group>/<logical_volume>'''</tt> | |||
==== Extend an xfs Filesystem ==== | |||
# Increase the size of the logical volume. | |||
#:<tt>'''# lvextend -L +<size>[M | G] /dev/<volume_group>/<logical_volume>'''</tt> | |||
# Resize the underlying filesystem | |||
#: <tt>'''# xfs_growfs -d </path/to/filesystem>'''</tt> | |||
==== Reduce a Filesystem ==== | ==== Reduce a Filesystem ==== | ||
# Note: You may have to change to runlevel 1 in order to unmount. | # Note: You may have to change to runlevel 1 in order to unmount. |
Revision as of 18:38, 1 March 2017
AIX
Extend a Filesystem
- # chfs -a size=+<additional size>M <absolute path to filesystem>
Reduce a Filesystem
- # chfs -a size=-<reduced size>M <absolute path to filesystem>
Linux
Extend an ext4 Filesystem
- Increase the size of the logical volume.
- # lvextend -L +<size>[M | G] /dev/<volume_group>/<logical_volume>
- Resize the underlying filesystem
- # resize2fs /dev/<volume_group>/<logical_volume>
Extend an xfs Filesystem
- Increase the size of the logical volume.
- # lvextend -L +<size>[M | G] /dev/<volume_group>/<logical_volume>
- Resize the underlying filesystem
- # xfs_growfs -d </path/to/filesystem>
Reduce a Filesystem
- Note: You may have to change to runlevel 1 in order to unmount.
- Backup your data!
- 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>
- Re-check the filesystem to ensure it is clean.
- # e2fsck –f /dev/<volume group>/<logical volume>
- Mount the filesystem.
- # mount /dev/<volume group>/<logical volume>