LVM Resize a Filesystem: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= LVM Extend a Filesystem = == AIX == # '''<tt># chfs -a size=+<additional size>M <absolute path to filesystem></tt>''' == Linux == # '''<tt><tt>'''") |
|||
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== AIX == | == AIX == | ||
==== Extend a Filesystem ==== | |||
: <tt>'''# chfs -a size=+<additional size>M <absolute path to filesystem>'''</tt> | |||
==== Reduce a Filesystem ==== | |||
: <tt>'''# chfs -a size=-<reduced size>M <absolute path to filesystem>'''</tt> | |||
== Linux == | == Linux == | ||
# '''<tt><tt>''' | ==== Extend an ext4 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>'''# 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 an ext4 Filesystem ==== | |||
# Note: You may have to change to runlevel 1 in order to unmount | |||
# Backup your data! | |||
# Dismount the filesystem before reducing the size | |||
#: <tt>'''# umount /dev/<volume_group>/<logical_volume>'''</tt> | |||
# Force check the filesystem to ensure it is clean. '''DO NOT RUN <tt>e2fsck</tt> IF THE FILESYSTEM IS MOUNTED''' | |||
#: <tt>'''# e2fsck –f /dev/<volume_group>/<logical_volume>'''</tt> | |||
# Reduce the filesystem | |||
#: <tt>'''# resize2fs /dev/<volume_group>/<logical_volume> -<size>[M | G]'''</tt> | |||
# Reduce the logical volume | |||
#: <tt>'''# lvreduce –L -<size>[M | G] /dev/<volume_group>/<logical_volume>'''</tt> | |||
# Re-check the filesystem to ensure it is clean | |||
#: <tt>'''# e2fsck –f /dev/<volume_group>/<logical_volume>'''</tt> | |||
# Mount the filesystem | |||
#: <tt>'''# mount /dev/<volume_group>/<logical_volume>'''</tt> | |||
== Further Reading == | |||
# [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp IBM pSeries and AIX Information Center] | |||
[[Category:AIX]] | |||
[[Category:Linux]] |
Latest revision as of 15:03, 1 April 2022
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 an ext4 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>[M | G]
- Reduce the logical volume
- # lvreduce –L -<size>[M | G] /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>