Advertisements

Tag Archives: lsvg

Creating a jfs2 filesystem in AIX

Listing physical volumes

root@aix:/ # lspv
hdisk0 00c94ad454a2d4c5 rootvg active
hdisk1 00c94ad45808a18f rootvg active
hdisk3 00c94ad4229190d8 tsmpoolvg active
hdisk21 00ce196f4b9604c3 aplicvg active
hdisk22 00ce196f418e3f6d aplicvg active
hdisk44 00c94ad4c75dfb09 aplicvg active
hdisk2 none None
hdisk57 00c94ad481c4f2aa aplicvg active
hdisk55 00c94ad4f99f7480 tsm55dbvg active
hdisk56 00c94ad4f99f2d43 tsm55logvg active

Configures devices

root@aix:/ # cfgmgr

Listing physical volumes

root@aix:/ # lspv
hdisk0 00c94ad454a2d4c5 rootvg active
hdisk1 00c94ad45808a18f rootvg active
hdisk3 00c94ad4229190d8 tsmpoolvg active
hdisk21 00ce196f4b9604c3 aplicvg active
hdisk22 00ce196f418e3f6d aplicvg active
hdisk44 00c94ad4c75dfb09 aplicvg active
hdisk2 none None
hdisk57 00c94ad481c4f2aa aplicvg active
hdisk55 00c94ad4f99f7480 tsm55dbvg active
hdisk56 00c94ad4f99f2d43 tsm55logvg active
hdisk4 none None

Comparing lspv output, the new disk is hdisk4. Checking ID to see if it matches

root@aix:/ # lsattr -El hdisk4 | grep -i 600507680191818C1000000000000C98
unique_id 33213600507680191818C1000000000000C9804214503IBMfcp Device Unique Identification False

Using script to query all disks

for i in `lspv | awk ‘{print $1’}`
do
echo $i `lsattr -El $i | grep unique_id`
done

Creating volume group with PP SIZE 16MB is not possible

root@aix:/ # mkvg -y tsmdbtmp -s 16 hdisk4
0516-1254 mkvg: Changing the PVID in the ODM.
0516-1208 mkvg: Warning, The Physical Partition Size of 16 requires the
creation of 32000 partitions for hdisk4. The system limitation is 16256
physical partitions per disk at a factor value of 16. Specify a larger
Physical Partition Size or a larger factor value in order create a
volume group on this disk.
0516-862 mkvg: Unable to create volume group.

Creating volume group with PP SIZE 32MB.

root@aix:/ # mkvg -y tsmdbtmp -s 32 hdisk4
tsmdbtmp

Listing volume group information

root@aix:/ # lsvg tsmdbtmp
VOLUME GROUP: tsmdbtmp VG IDENTIFIER: 00c94ad400004c000000015d801914eb
VG STATE: active PP SIZE: 32 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 15999 (511968 megabytes)
MAX LVs: 256 FREE PPs: 15999 (511968 megabytes)
LVs: 0 USED PPs: 0 (0 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
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: 16256 MAX PVs: 2
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no
DISK BLOCK SIZE: 512 CRITICAL VG: no

Creating filesystem. Logical volume name is fslvXX

root@aix:/ # smitty crfs

Add a File System

Move cursor to desired item and press Enter.

Add an Enhanced Journaled File System
Add a Journaled File System
Add a CDROM File System

F1=Help F2=Refresh F3=Cancel F8=Image
F9=Shell F10=Exit Enter=Do

Add an Enhanced Journaled File System

Move cursor to desired item and press Enter.

Add an Enhanced Journaled File System
Add an Enhanced Journaled File System on a Previously Defined Logical Volume

F1=Help F2=Refresh F3=Cancel F8=Image
F9=Shell F10=Exit Enter=Do

Add an Enhanced Journaled File System

Move cursor to desired item and press Enter.

Add an Enhanced Journaled File System
Add an Enhanced Journaled File System on a Previously Defined Logical Volume

+————————————————————————–+
| Volume Group Name |
| |
| Move cursor to desired item and press Enter. |
| |
| rootvg |
| aplicvg |
| tsmpoolvg |
| tsm55logvg |
| tsm55dbvg |
| tsmdbtmp |
| |
| F1=Help F2=Refresh F3=Cancel |
| F8=Image F10=Exit Enter=Do |
F1| /=Find n=Find Next |
F9+————————————————————————–+

Add an Enhanced Journaled File System

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
Volume group name tsmdbtmp
SIZE of file system
Unit Size Megabytes +
* Number of units [511900] #
* MOUNT POINT [/tsmdbtmp]
Mount AUTOMATICALLY at system restart? yes +
PERMISSIONS read/write +
Mount OPTIONS [] +
Block Size (bytes) 4096 +
Logical Volume for Log +
Inline Log size (MBytes) [] #
Extended Attribute Format +
ENABLE Quota Management? no +
Enable EFS? no +
Allow internal snapshots? no +
Mount GROUP []

Mount logical volume

root@aix:/ # mount /tsmdbtmp

Check filesystem size

root@aix:/ # df -m /tsmdbtmp
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/fslv08 511904.00 511825.51 1% 4 1% /tsmdbtmp

Advertisements

AIX – Mirroring a logical volume

Check the logical volume to be mirrored

root@aix:/ # lsvg -l datavg | grep mirroring
mirroring jfs2 64 64 7 open/syncd /data

Run the command below to make two copies of this logical volume

root@aix:/ # mklvcopy mirroring 2

Then start syncing the volume group

root@aix:/ # nohup syncvg -v datavg &

To verify that the volume is mirrored, verify if the column PPs is the double of the column LPs

root@aix:/ # lsvg -l datavg | grep mirroring
mirroring jfs2 64 128 14 open/stale /data

AIX – Removing disks from a volume group and then inserting a new disk

This activity they intend to remove a disk array drawer and so a new disk will be added and some old disks will be removed

Listing the disks

root@aix:/ # lspv
hdisk0 0003416af966647d rootvg active
hdisk1 0003416af740bb45 rootvg active
hdisk2 0003416a783c13a2 datavg active
hdisk3 0003416af7cc1c47 datavg active
hdisk4 0003416af7cc1cef datavg active
hdisk5 0003416af7cc1d8e datavg active
hdisk6 0003416af7cc1e47 datavg active
hdisk7 0003416a702e8968 datavg active
hdisk8 0003416af7cc1f97 datavg active
hdisk9 0003416afae71331 datavg active
hdisk10 0003416afae713de None
hdisk11 0003416afae7147e datavg active
hdisk12 0003416afae71520 datavg active
hdisk13 0003416afae715c5 datavg active
hdisk14 0003416afae7166c datavg active
hdisk15 0003416abe0699e3 datavg active
hdisk18 0003416a96438ea0 poolvg active
hdisk19 0003416a964390f3 poolvg active
hdisk20 0003416a96439327 poolvg active
hdisk21 0003416a964395d5 poolvg active
hdisk16 0003416a2f20c609 pool02vg active
hdisk17 0003416a2f20e88c pool03vg active

The command to find the newly inserted disk

root@aix:/ # cfgmgr

Listing the disk again. The new disk is the hdisk22

root@aix:/ # lspv
hdisk0 0003416af966647d rootvg active
hdisk1 0003416af740bb45 rootvg active
hdisk2 0003416a783c13a2 datavg active
hdisk3 0003416af7cc1c47 datavg active
hdisk4 0003416af7cc1cef datavg active
hdisk5 0003416af7cc1d8e datavg active
hdisk6 0003416af7cc1e47 datavg active
hdisk7 0003416a702e8968 datavg active
hdisk8 0003416af7cc1f97 datavg active
hdisk9 0003416afae71331 datavg active
hdisk10 0003416afae713de None
hdisk11 0003416afae7147e datavg active
hdisk12 0003416afae71520 datavg active
hdisk13 0003416afae715c5 datavg active
hdisk14 0003416afae7166c datavg active
hdisk15 0003416abe0699e3 datavg active
hdisk18 0003416a96438ea0 poolvg active
hdisk19 0003416a964390f3 poolvg active
hdisk20 0003416a96439327 poolvg active
hdisk21 0003416a964395d5 poolvg active
hdisk16 0003416a2f20c609 pool02vg active
hdisk17 0003416a2f20e88c pool03vg active
hdisk22 none None

Checking if the hdisk22 is coming from the disk array

root@aix:/ # lsdev -Cc disk
hdisk0 Available 1Z-08-00-8,0 16 Bit LVD SCSI Disk Drive
hdisk1 Available 1Z-08-00-9,0 16 Bit LVD SCSI Disk Drive
hdisk2 Available 1Z-08-00-10,0 16 Bit LVD SCSI Disk Drive
hdisk3 Available 1Z-08-00-11,0 16 Bit LVD SCSI Disk Drive
hdisk4 Available 25-08-00-8,0 16 Bit LVD SCSI Disk Drive
hdisk5 Available 25-08-00-9,0 16 Bit LVD SCSI Disk Drive
hdisk6 Available 25-08-00-10,0 16 Bit LVD SCSI Disk Drive
hdisk7 Available 25-08-00-11,0 16 Bit LVD SCSI Disk Drive
hdisk8 Available 25-08-00-12,0 16 Bit LVD SCSI Disk Drive
hdisk9 Available 25-08-00-13,0 16 Bit LVD SCSI Disk Drive
hdisk10 Available 25-09-00-8,0 16 Bit LVD SCSI Disk Drive
hdisk11 Available 25-09-00-9,0 16 Bit LVD SCSI Disk Drive
hdisk12 Available 25-09-00-10,0 16 Bit LVD SCSI Disk Drive
hdisk13 Available 25-09-00-11,0 16 Bit LVD SCSI Disk Drive
hdisk14 Available 25-09-00-12,0 16 Bit LVD SCSI Disk Drive
hdisk15 Available 25-09-00-13,0 16 Bit LVD SCSI Disk Drive
hdisk16 Available 1f-08-02 1722-600 (600) Disk Array Device
hdisk17 Available 2a-08-02 1722-600 (600) Disk Array Device
hdisk18 Available 2a-08-02 1722-600 (600) Disk Array Device
hdisk19 Available 2a-08-02 1722-600 (600) Disk Array Device
hdisk20 Available 2a-08-02 1722-600 (600) Disk Array Device
hdisk21 Available 2a-08-02 1722-600 (600) Disk Array Device
hdisk22 Available 1f-08-02 1722-600 (600) Disk Array Device

Adding hdisk22 to the volume group poolvg

root@aix:/ # extendvg poolvg hdisk22
0516-1254 extendvg: Changing the PVID in the ODM.

Listing the disks to check if hdisk22 is in the poolvg

root@aix:/ # lspv | grep hdisk22
hdisk22 0003416a16888bf6 poolvg active

Listing the logical volumes from the volume group poolvg

root@aix:/ # lsvg -l poolvg
poolvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
pool_lv001 raw 128 128 4 open/syncd N/A
pool_lv002 raw 128 128 4 open/syncd N/A
pool_lv003 raw 128 128 4 open/syncd N/A
pool_lv004 raw 128 128 4 open/syncd N/A
pool_lv005 raw 128 128 4 open/syncd N/A
pool_lv006 raw 128 128 4 open/syncd N/A
pool_lv007 raw 128 128 4 open/syncd N/A
pool_lv008 raw 128 128 4 open/syncd N/A
pool_lv009 raw 128 128 4 open/syncd N/A
pool_lv010 raw 128 128 4 open/syncd N/A
pool_lv011 raw 128 128 4 open/syncd N/A
pool_lv012 raw 128 128 4 open/syncd N/A

Checking the characteristics from hdisk22

root@aix:/ # lspv hdisk22
PHYSICAL VOLUME: hdisk22 VOLUME GROUP: hsm_pool_vg
PV IDENTIFIER: 0003416a16888bf6 VG IDENTIFIER 0003416a00004c00000001129644220a
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 256 megabyte(s) LOGICAL VOLUMES: 0
TOTAL PPs: 4462 (1142272 megabytes) VG DESCRIPTORS: 1
FREE PPs: 4462 (1142272 megabytes) HOT SPARE: no
USED PPs: 0 (0 megabytes) MAX REQUEST: 1 megabyte
FREE DISTRIBUTION: 893..892..892..892..893
USED DISTRIBUTION: 00..00..00..00..00

Removing the logical volumes. Repeat with all the logical volumes

root@aix:/ # rmlv -f hsm_pool_lv003
rmlv: Logical volume pool_lv003 is removed.

Removing the disks hdisk18, hdisk19, hdisk20 and hdisk21 from the volume group poolvg

root@aix:/ # reducevg poolvg hdisk18
root@aix:/ # reducevg poolvg hdisk19
root@aix:/ # reducevg poolvg hdisk20
root@aix:/ # reducevg poolvg hdisk21

Checking if the disks were removed

root@aix:/ # lspv
hdisk0 0003416af966647d rootvg active
hdisk1 0003416af740bb45 rootvg active
hdisk2 0003416a783c13a2 datavg active
hdisk3 0003416af7cc1c47 datavg active
hdisk4 0003416af7cc1cef datavg active
hdisk5 0003416af7cc1d8e datavg active
hdisk6 0003416af7cc1e47 datavg active
hdisk7 0003416a702e8968 datavg active
hdisk8 0003416af7cc1f97 datavg active
hdisk9 0003416afae71331 datavg active
hdisk10 0003416afae713de None
hdisk11 0003416afae7147e datavg active
hdisk12 0003416afae71520 datavg active
hdisk13 0003416afae715c5 datavg active
hdisk14 0003416afae7166c datavg active
hdisk15 0003416abe0699e3 datavg active
hdisk18 0003416a96438ea0 None
hdisk19 0003416a964390f3 None
hdisk20 0003416a96439327 None
hdisk21 0003416a964395d5 None
hdisk16 0003416a2f20c609 pool02vg active
hdisk17 0003416a2f20e88c pool03vg active
hdisk22 0003416a16888bf6 poolvg active

Removing the disk definition from the system

root@aix:/ # rmdev -dl hdisk18
hdisk18 deleted
root@aix:/ # rmdev -dl hdisk19
hdisk19 deleted
root@aix:/ # rmdev -dl hdisk20
hdisk20 deleted
root@aix:/ # rmdev -dl hdisk21
hdisk21 deleted

Checking if the disks are ready to be physically removed

root@aix:/ # lspv
hdisk0 0003416af966647d rootvg active
hdisk1 0003416af740bb45 rootvg active
hdisk2 0003416a783c13a2 datavg active
hdisk3 0003416af7cc1c47 datavg active
hdisk4 0003416af7cc1cef datavg active
hdisk5 0003416af7cc1d8e datavg active
hdisk6 0003416af7cc1e47 datavg active
hdisk7 0003416a702e8968 datavg active
hdisk8 0003416af7cc1f97 datavg active
hdisk9 0003416afae71331 datavg active
hdisk10 0003416afae713de None
hdisk11 0003416afae7147e datavg active
hdisk12 0003416afae71520 datavg active
hdisk13 0003416afae715c5 datavg active
hdisk14 0003416afae7166c datavg active
hdisk15 0003416abe0699e3 datavg active
hdisk16 0003416a2f20c609 pool02vg active
hdisk17 0003416a2f20e88c pool03vg active
hdisk22 0003416a16888bf6 poolvg active

The disks don’t appear anymore

root@aix:/ # lspv | egrep ‘hdisk18|hdisk19|hdisk20|hdisk21’
root@aix:/ #

Creating the logical volumes in the volume group to replace the old ones deleted

mklv -t raw -y pool_lv001 poolvg 128
mklv -t raw -y pool_lv002 poolvg 128
mklv -t raw -y pool_lv003 poolvg 128
mklv -t raw -y pool_lv004 poolvg 128
mklv -t raw -y pool_lv005 poolvg 128
mklv -t raw -y pool_lv006 poolvg 128
mklv -t raw -y pool_lv007 poolvg 128
mklv -t raw -y pool_lv008 poolvg 128
mklv -t raw -y pool_lv009 poolvg 128
mklv -t raw -y pool_lv010 poolvg 128
mklv -t raw -y pool_lv011 poolvg 128
mklv -t raw -y pool_lv012 poolvg 128
mklv -t raw -y pool_lv013 poolvg 128
mklv -t raw -y pool_lv014 poolvg 128
mklv -t raw -y pool_lv015 poolvg 128
mklv -t raw -y pool_lv016 poolvg 128
mklv -t raw -y pool_lv017 poolvg 128
mklv -t raw -y pool_lv018 poolvg 128
mklv -t raw -y pool_lv019 poolvg 128
mklv -t raw -y pool_lv020 poolvg 128
mklv -t raw -y pool_lv021 poolvg 128
mklv -t raw -y pool_lv022 poolvg 128
mklv -t raw -y pool_lv023 poolvg 128
mklv -t raw -y pool_lv024 poolvg 128
mklv -t raw -y pool_lv025 poolvg 128
mklv -t raw -y pool_lv026 poolvg 128
mklv -t raw -y pool_lv027 poolvg 128
mklv -t raw -y pool_lv028 poolvg 128
mklv -t raw -y pool_lv029 poolvg 128
mklv -t raw -y pool_lv030 poolvg 128
mklv -t raw -y pool_lv031 poolvg 128
mklv -t raw -y pool_lv032 poolvg 128
mklv -t raw -y pool_lv033 poolvg 128
mklv -t raw -y pool_lv034 poolvg 128

Verifying the volume group poolvg

root@aix:/ # lsvg poolvg
VOLUME GROUP: poolvg VG IDENTIFIER: 0003416a00004c00000001129644220a
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 4462 (1142272 megabytes)
MAX LVs: 256 FREE PPs: 110 (28160 megabytes)
LVs: 34 USED PPs: 4352 (1114112 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: 30480
MAX PPs per PV: 5080 MAX PVs: 6
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

Increasing a JFS2 filesystem on AIX

First you need to know which filesystem that you’ll resize. Get the logical volume

root@aix:/ # df -m /u04
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/lvcrnstore 34816.00 1892.34 95% 103 1% /u04

With this information you type lslv lvcrnstore to find out about the volume group that this logical group is part of. Check if there are FREE PPs to extend the filesystem

root@aix:/ # lsvg oraclevg
VOLUME GROUP: oraclevg VG IDENTIFIER: 000d400c00004c00000000fd81379ca3
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 531 (135936 megabytes)
MAX LVs: 256 FREE PPs: 17 (4352 megabytes)
LVs: 15 USED PPs: 514 (131584 megabytes)
OPEN LVs: 14 QUORUM: 2
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per PV: 1016 MAX PVs: 32
LTG size: 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

Resize the filesystem and check the new size

root@aix:/ # chfs -a size=+4G /u04
Filesystem size changed to 79691776

root@aix:/ # df -m /u04
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/lvcrnstore 38912.00 5987.71 85% 103 1% /u04

Notice that the number of free PPs decreased since you used to increase the filesystem

root@aix:/ # lsvg oraclevg
VOLUME GROUP: oraclevg VG IDENTIFIER: 000d400c00004c00000000fd81379ca3
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 531 (135936 megabytes)
MAX LVs: 256 FREE PPs: 1 (256 megabytes)
LVs: 15 USED PPs: 530 (135680 megabytes)
OPEN LVs: 14 QUORUM: 2
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per PV: 1016 MAX PVs: 32
LTG size: 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

AIX Volume Group can’t properly display the Logical Volume Type

Listing the logical volumes inside the volume group. AIX can’t determine the LV type.

root@aix:/ # lsvg -l oravg
oravg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
oravg_lg            ??? 1     1     1    closed/syncd  N/A
ora_lv              ??? 1064  1064  2    closed/syncd  N/A

To solve this problem we’ll export then reimport the VG. But first we’ll need to deactivate it.

root@aix:/ # varyoffvg oravg

And we need at least one disk that is part of the volume group because it has the information needed to import.

root@aix:/ # lspv | grep oravg
hdisk251
00c5f1d097cc8a6e                   oravg
hdisk221
00c5f1d0a7bffede                    oravg

Now we run exportvg and the server will no longer know it once had the volume group.

root@aix:/ # exportvg oravg

Let’s list all the volume groups the server is aware that exists.

root@aix:/ # lsvg
rootvg
datavg
cache01vg
cache02vg

Only the rootvg is currently imported and active.

root@aix:/ # lsvg -o
rootvg

Let’s reimport the volume group. We need to declare one of the disks we listed before to reimport the volume group.

root@aix:/ # importvg -y oravg hdisk251
oravg

Next, we activate the volume group

root@aix:/ # varyonvg oravg

Listing the Volume Group. Volume Group TYPE listed.

root@aix:/ # lsvg -l oravg
oravg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
oravg_lg            jfs2log    1     1     1    closed/syncd  N/A
ora_lv              jfs2       1064  1064  2    closed/syncd  /u01

%d bloggers like this: