LVM Resize a Filesystem: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
m (Michael Kohler moved page LVM Extend a Filesystem to LVM Resize a Filesystem without leaving a redirect)
No edit summary
Line 1: Line 1:
== AIX ==
== AIX ==
=== Extend a Filesystem ===
# <tt>'''# chfs -a size=+<additional size>M <absolute path to filesystem>'''</tt>
# <tt>'''# chfs -a size=+<additional size>M <absolute path to filesystem>'''</tt>


== Linux ==
== Linux ==
# <tt>'''# lvextend -L +<size in mb>M /dev/rootvg/<logical volume>'''</tt>
=== Extend a Filesystem ===
# <tt>'''# resize2fs /dev/rootvg/<logical volume>'''</tt>
# <tt>'''# lvextend -L +<size in MB>M /dev/rootvg/<logical volume>'''</tt>
# <tt>'''# resize2fs /dev/<volume group>/<logical volume>'''</tt>
=== 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.
## <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 in MB>M'''</tt>
# Reduce the logical volume.
## <tt>'''# lvreduce –L -<size in MB>M /dev/<volume group>/<logical volume>'''</tt>
# Mount the filesystem.
## <tt>'''# mount /dev/<volume group>/<logical volume>'''</tt>


== Further Reading ==
== Further Reading ==

Revision as of 14:10, 1 August 2014

AIX

Extend a Filesystem

  1. # chfs -a size=+<additional size>M <absolute path to filesystem>

Linux

Extend a Filesystem

  1. # lvextend -L +<size in MB>M /dev/rootvg/<logical volume>
  2. # resize2fs /dev/<volume group>/<logical volume>

Reduce a Filesystem

  1. Note: You may have to change to runlevel 1 in order to unmount.
  2. This can be done online, but it is advised to dismount the filesystem before reducing the size.
    1. # umount /dev/<volume group>/<logical volume>
  3. Force check the filesystem to ensure it is clean. DO NOT RUN e2fsck IF THE FILESYSTEM IS MOUNTED.
    1. # e2fsck –f /dev/<volume group>/<logical volume>
  4. Reduce the filesystem.
    1. # resize2fs /dev/<volume group>/<logical volume> <size in MB>M
  5. Reduce the logical volume.
    1. # lvreduce –L -<size in MB>M /dev/<volume group>/<logical volume>
  6. Mount the filesystem.
    1. # mount /dev/<volume group>/<logical volume>

Further Reading

  1. IBM pSeries and AIX Information Center