LVM
synclvodm -Pv <vgname>
imfs -x -l <lvname>
imfs -l <lv_name>
getlvcb -AT <lvname>
VG Related commands
# lsvg - to list all the VGs # lsvg -o - To list all the active VGs # lsvg -l testvg -- To list the all the LVs in testvg # lsvg -p testvg -- To list all the PVs belongs to testvg # lsvg -i -- to read VG names from standard input
To sync the stale partitions on VG
# varyonvg vgname
Cook-book for creating a Volume Group and file systems using LVM
lspv hdisk0 00c33e2e8347acfd rootvg active hdisk1 00c33e2e8c8a25e3 rootvg active hdisk36 none None hdisk37 none None erpsb4ci0:/ # mkvg -s 512 -y saplocvg hdisk36 0516-1254 mkvg: Changing the PVID in the ODM. saplocvg erpsb4ci0:/ # lsvg saplocvg VOLUME GROUP: saplocvg VG IDENTIFIER: 00c33e2e00004c0000000111a483c8ab VG STATE: active PP SIZE: 512 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 999 (511488 megabytes) MAX LVs: 256 FREE PPs: 999 (511488 megabytes) LVs: 0 USED PPs: 0 (0 megabytes) OPEN LVs: 0 QUORUM: 2 TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per VG: 32512 MAX PPs per PV: 1016 MAX PVs: 32 LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no HOT SPARE: no BB POLICY: relocatable mklv -y saplocvg_log -t jfs2log saplocvg 1 hdisk36 saplocvg_log logform -V jfs2 /dev/saplocvg_log logform: destroy /dev/rsaplocvg_log (y)?y mklv -y sapmntlv -t jfs2 saplocvg 64 hdisk36 lsvg -l saplocvg saplocvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT sapmntlv jfs2 64 64 1 closed/syncd N/A saplocvg_log jfs2log 1 1 1 closed/syncd N/A crfs -v jfs2 -d /dev/sapmntlv -m /sapmnt -A yes -p rw File system created successfully. 33553204 kilobytes total disk space. New File System size is 67108864
Mirror the rootvg to hdisk1
extendvg -f rootvg hdisk1 chvg -Qn rootvg mklv -t sysdump -y lg_dumplvx rootvg 64 hdisk1 sysdumpdev -P -s /dev/lg_dumplvx mklvcopy hd2 2 hdisk1 mklvcopy hd3 2 hdisk1 mklvcopy hd4 2 hdisk1 mklvcopy hd5 2 hdisk1 mklvcopy hd6 2 hdisk1 mklvcopy hd8 2 hdisk1 mklvcopy hd9var 2 hdisk1 mklvcopy hd10opt 2 hdisk1 mklvcopy nmon_lv 2 hdisk1 syncvg -v rootvg bosboot -a -d /dev/hdisk0 bosboot -a -d /dev/hdisk1 bootlist -m normal -o hdisk0 hdisk1
While trying to extend the filesystem, getting the following error.
0516-787 extendlv: Maximum allocation for logical volume backuplv is 6600
This is because, the maximum LP is set to 6600 for that LV. We can can change it using chlv command.
# chlv -x 8000 testlv
If the device configuration database (ODM) is not consistent with Logical Volume Manager information, the synclvodm command can be used to resynchronize the database. It Synchronizes or rebuilds the logical volume control block, the device configuration database, and the volume group descriptor areas on the physical volumes
synclvodm rootvg hd7 synclvodm rootvg
To changes an available disk device to a physical volume by assigning a PVID
# chdev -l hdisk7 -a pv=yes
To clear the boot record located on physical volume hdisk1, use the command:
# chpv -c hdisk1
To define hdisk3 as a hot spare, use the command:
# chpv -hy hdisk3
To remove hdisk3 from the hot spare pool of its volume group, use the command:
# chpv -hn hdisk3