LVM Extend Logical Volume and Filesystem: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
Line 21: Line 21:


== AIX ==
== AIX ==
==== Extend a Logical Volume and Filesystem ====
==== Extend a Logical Volume and Filesystem with Disk Expansion ====
# Gather logical volume information for the mount path
# Gather logical volume information for the mount path
#: <tt>'''# df -g <mount_path>'''</tt>
#: <tt>'''# df -g <mount_path>'''</tt>

Revision as of 02:55, 28 January 2022

Linux

Extend a Logical Volume and Filesystem

  1. Gather Filesystem information for the mount path
    # df -h <mount_path>
  2. Gather logical volume "LV", volume group "VG" information, and physical volume "Device" information
    # lvs <filesystem_path> -o +devices,stripes
  3. Expand underlying disk
    Follow vendors procedure to expand underlying disk
  4. List SCSI device sizes, determine if added space was added to the device
    # lsscsi -s
    1. If space was not automatically added, rescan the SCSI Bus
      # echo '- - - -' > /sys/class/scsi_host/host#/scan
      Note: host# is from the first number in lsscsi -s [2:0:0:0], this would be host2
  5. Resize the expanded physical volume
    # pvresize <device>
  6. Expand the logical volume and file system
    1. Using all available space
      # lvextend -l +100%FREE -r <logical_volume_path>
    2. Not using all available space
      # lvextend -L +<size>[M|G|T] -r <logical_volume_path>

AIX

Extend a Logical Volume and Filesystem with Disk Expansion

  1. Gather logical volume information for the mount path
    # df -g <mount_path>
  2. Gather volume group "VOLUME GROUP" information from the logical volume group
    # lslv <logical_volume>
  3. Gather physical volume information
    # lsvg -p <volume_group>
  4. Expand underlying disk
    Follow vendors procedure to expand underlying disk
  5. Examine all the disks in the volume group to see if they have grown in size
    # chvg -g <volume_group>
  6. Get the maximum logical partitions "TOTAL PPs" from the volume group
    # lsvg <volume_group>
  7. Set the maximum number of logical partitions that can be allocated to the logical volume
    # chlv -x <maximum> <logical_volume>
  8. Expand the file system
    # chfs -a size=+<size>[M|G|T] <file_system>