How to add a disk to an existing VG and then create a new LV

In this example the disk was a LUN on a fibre attached array, but the principles are the same for an internal disk

Ensure the LUN is mapped out to the AIX server.

Type lspv and make a note of the available drives, you may see something like hdisk0, hdisk1 etc

Run the configuration manager by typing cfgmgr. This command configures devices and optionally installs device software into the system.

Next run lspv again and hopefully you should see a new hdisk displayed

Something like the following

hdisk3 none none

Type lspv to display the available volume groups

To add the new hdisk to a existing volume group type extendvg "vgname" hdisk3

Change vgname and hdisk3 to appropriate values for your setup

Now run lspv again and something similiar to the following should be displayed

hdisk3 005eb21e4866396f vgname active

We now need to create a logical volume and filesystem, this can be done from smit or the command line, the commands are shown here

To create the logical volume type the following

mklv -t jfs2 -y lvname vgname 100 hdisk3

This will create a jfs2 logical volume of 100 logical partitions in size on hdisk3. Replace these parameters and the lvname and vgname with relevant names to your environment

Now create the filesystem on the logical volume, type

crfs -v jfs2 -d lvname -m /moint_point -A yes

This command will create a jfs2 filesystem on logical volume "lvname". It will also create a mount point and an entry in /etc/filesystems to enable automatic mounting of this filesystem on boot, this is defined by the -m and -A options

All that is left now is to mount the filesystem, to do this type mount /mount-point, we don't need to include the device /dev/lvname as we have an entry in /etc/filesystems

How to remove a logical volume and filesystem from a volume group

To remove the previously created logical volume, use the rmfs command. This command will remove the mount point, the entry from /etc/filesystems, and the logical volume, to do this type

rmfs -r /mount-point