Using a volume to expand root volume group within a virtual machine

Procedure

  1. Open a SSH or Telnet connection to the virtual machine. Log in as root or su to root.
  2. Run a scan of your hardware as follows to ensure the new disk is recognized by the operating system:
    AIX# cfgmgr
  3. Identify the new disk. In the following example, the new disk is hdisk1:
    AIX# lsdev -Cc disk
    hdisk0 Available Virtual SCSI Disk Drive
    hdisk1 Available Virtual SCSI Disk Drive
    
    AIX# lspv
    hdisk0 000bc441088ae8ae rootvg active
    hdisk1 none None
  4. Create a PID on the disk:
    AIX# chdev -1 hdisk1 -a pv=yes

    The command output should be similar to the following example:

    hdisk0 000bc441088ae8ae rootvg active
    hdisk1 00079a4bb5cbd8e7 None
  5. Add the physical volume to the root volume group.
    1. Run the lsvg command to identify the name of the root volume group:
      AIX# lsvg
      rootvg
    2. Expand the root volume group across the new physical volume:
      AIX# extendvg -f rootvg hdisk1
      hdisk1 changed

      In some cases, a message similar to the following example might be displayed:

      0516-1162 extendvg: Warning, The Physical Partition Size of 32
      requires the creation of 1920 partitions for hdisk1.

      If so, run the following command and then run the extendvg command again:

      AIX# chvg -t 2 rootvg
  6. Use the df -k command to list the file systems.
  7. Increase the size of the preferred file system. In the following scenario, 10G is added to the root file system and the rest of the available space to the /usr file system.
    1. Run the chfs -a size command to increase the size of the root file system. In the following example, the size of the root file system is increased by 10G:
      AIX# chfs -a size=+10G /
      Filesystem size changed to 48562176
    2. Determine the amount of free space that is available to add to the /usr file system: In the following example, the size of the root file system is increased by 10G:
      AIX# lsvg rootvg | grep 'FREE PPs'
      MAX LVs: 256 FREE PPs: 1599 (51168 megabytes)
    3. Determine the device for /usr file system:
      AIX# df -g /usr
      Filesystem	GB blocks	Free	%Used	Iused	&Iused 	Mounted on
      /dev/hd2 	4.00 	1.50 	63% 	68944 	16% 	/usr
    4. Determine the maximum number of partitions that are allowed for the /usr file system:
      AIX# lslv hd2 | grep 'LPs:'
      MAX LPS: 1536 PP SIZE: 32 megabyte(s)
      LPs: 128 PPs: 128
    5. Change the maximum number of partitions that are allowed for the /usr file system to 'FREE PPS' (1599) + 'PPs' (128) = 1727:
      AIX# chlv -x'1727' hd2
    6. Use the chfs -a size command to increase the size of the file system. In the following example, the size of the root file system is increased to the maximum available (51168 megabytes from the lsvg command above):
      AIX# chfs -a size=+51168M /usr
      Filesystem size changed to 113180672
  8. Run the df -k command to verify the new size. Note the change to the size of the root file system.