LVM Resize a Filesystem: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 11: | Line 11: | ||
=== 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. | ||
# | # Backup your data! | ||
# Dismount the filesystem before reducing the size. | |||
## <tt>'''# umount /dev/<volume group>/<logical volume>'''</tt> | ## <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'''. | # 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> | ## <tt>'''# e2fsck –f /dev/<volume group>/<logical volume>'''</tt> | ||
# Reduce the filesystem. | # Reduce the filesystem. | ||
## <tt>'''# resize2fs /dev/<volume group>/<logical volume> <size in MB>M'''</tt> | ## <tt>'''# resize2fs /dev/<volume group>/<logical volume> [+ | -]<size in MB>M'''</tt> | ||
# Reduce the logical volume. | # Reduce the logical volume. | ||
## <tt>'''# lvreduce –L -<size in MB>M /dev/<volume group>/<logical volume>'''</tt> | ## <tt>'''# lvreduce –L -<size in MB>M /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. | # Mount the filesystem. | ||
## <tt>'''# mount /dev/<volume group>/<logical volume>'''</tt> | ## <tt>'''# mount /dev/<volume group>/<logical volume>'''</tt> |
Revision as of 17:57, 1 August 2014
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 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.
- 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>