Logical Volume Manager (LVM) basic commands

Logical Volume Manager (LVM) basic commands in AIX

  • Put a PVID on a disk

                     chdev -l hdisk1 -a pv=yes

  • PVIDs are automatically placed on a disk when added to a VG Remove a PVID from a disk

                     chdev -l hdisk1 -a pv=clear

  • List all PVs in a system (along) with VG membership

                      lspv

  • Create a VG called datavg using hdisk1 using 64 Meg PPs

                      mkvg -y datavg -s 64 hdisk1

  • Create a LV on (previous) datavg that is 1 Gig in size

                      mklv -t jfs2 -y datalv datavg 16

  • List all LVs on the datavg VG

                      lsvg -l datavg

  • List all PVs in the datavg VG

                       lsvg -p datavg

  • Take the datavg VG offline

                       varyoffvg datavg

  • Remove the datavg VG from the ODM

                      exportvg datavg

  • Import the VG on hdisk5 as datavg

                     importvg -y datavg hdisk5

  • Vary-on the new datavg VG (can use importvg -n)

                    varyonvg datavg

  • List all VGs (known to the ODM)

                      lsvg

  • List all VGs that are on line

                      lsvg -o

  • Check to see if underlying disk in datavg has grown in size

                    chvg -g datavg

  • Move a LV from one PV to another

                    migratepv -l datalv01 hdisk4 hdisk5

  • Delete a VG by removing all PVs with the reducevg command.

                   reducevg hdisk3 (-d removes any LVs that may be on that PV)