Wednesday, May 7, 2014
Some AIX LVM commands
1)viewing the PV info
# lspv
hdisk0 00cedcc344f7bfe8 rootvg active
hdisk2 00cedcc3d72aa40f popvg active
hdisk1 00cedcc3d9cc99f6 catvg active
#
2) Checking for catadata
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 0.44 0.29 35% 12553 16% /
/dev/hd2 4.53 0.03 100% 42715 69% /usr
/dev/hd9var 0.81 0.74 9% 4605 3% /var
/dev/hd3 0.81 0.81 1% 257 1% /tmp
/dev/hd1 0.03 0.03 2% 13 1% /home
/dev/hd11admin 0.12 0.12 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 0.62 0.37 41% 4689 6% /opt
/dev/livedump 0.25 0.25 1% 4 1% /var/adm/ras/livedump
/dev/softwarelv 9.38 1.28 87% 2620 1% /aiximages
/dev/catlv 0.02 0.02 4% 17 1% /catadata
# umount /catdata
step 3:-unmounting the catadata
# umount /catadata
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 0.44 0.29 35% 12553 16% /
/dev/hd2 4.53 0.03 100% 42715 69% /usr
/dev/hd9var 0.81 0.74 9% 4605 3% /var
/dev/hd3 0.81 0.81 1% 257 1% /tmp
/dev/hd1 0.03 0.03 2% 13 1% /home
/dev/hd11admin 0.12 0.12 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 0.62 0.37 41% 4689 6% /opt
/dev/livedump 0.25 0.25 1% 4 1% /var/adm/ras/livedump
/dev/softwarelv 9.38 1.28 87% 2620 1% /aiximages
Setp 4:- Reducing the catvg with catlv into it, remember it has to be last lv in the vg to remove it.
# reducevg -d catvg hdisk1
0516-914 rmlv: Warning, all data belonging to logical volume
catlv on physical volume hdisk1 will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume catlv is removed.
0516-914 rmlv: Warning, all data belonging to logical volume
loglv00 on physical volume hdisk1 will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume loglv00 is removed.
ldeletepv: Volume Group deleted since it contains no physical volumes.
# lspv
hdisk0 00cedcc344f7bfe8 rootvg active
hdisk2 00cedcc3d72aa40f popvg active
hdisk1 00cedcc3d9cc99f6 None
#
Setp 5:-Check no catvg
# lspv
hdisk0 00cedcc344f7bfe8 rootvg active
hdisk2 00cedcc3d72aa40f popvg active
hdisk1 00cedcc3d9cc99f6 None
#
Step 6:-In case you donot want the VGID from PV u need in cluster, else no needed.
# chdev -l hdisk1 -a pv=clear
hdisk1 changed
# lspv
hdisk0 00cedcc344f7bfe8 rootvg active
hdisk2 00cedcc3d72aa40f popvg active
hdisk1 none None
#
===============================================================================================
Now let us do from the begining:-
Step1:- To give PV id manually else while creating vg system will randomly assign the pvid
# chdev -l hdisk1 -a pv=yes
hdisk1 changed
# lspv
hdisk0 00cedcc344f7bfe8 rootvg active
hdisk2 00cedcc3d72aa40f popvg active
hdisk1 00cedcc3d9e2a55c None
#
Step2:- now will create vg and lv
# mkvg -y catvg hdisk1
catvg
# mklv -y catlv catvg 100m
catlv
# lspv
hdisk0 00cedcc344f7bfe8 rootvg active
hdisk2 00cedcc3d72aa40f popvg active
hdisk1 00cedcc3d9e2a55c catvg active
# lspv -l hdisk1
hdisk1:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
catlv 13 13 00..13..00..00..00 N/A
# lsvg -l catvg
catvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
catlv jfs 13 13 1 closed/syncd N/A
#
Step3:- Now we will create FS on the LV
# crfs -v jfs -d catlv -A yes -m /mydata
Based on the parameters chosen, the new /mydata JFS file system
is limited to a maximum size of 134217728 (512 byte blocks)
New File System size is 212992
# mount /mydata
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 0.44 0.29 35% 12554 16% /
/dev/hd2 4.53 0.03 100% 42715 69% /usr
/dev/hd9var 0.81 0.74 9% 4605 3% /var
/dev/hd3 0.81 0.81 1% 257 1% /tmp
/dev/hd1 0.03 0.03 2% 13 1% /home
/dev/hd11admin 0.12 0.12 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 0.62 0.37 41% 4689 6% /opt
/dev/livedump 0.25 0.25 1% 4 1% /var/adm/ras/livedump
/dev/softwarelv 9.38 1.28 87% 2620 1% /aiximages
/dev/catlv 0.10 0.10 4% 17 1% /mydata
#
Setp 4:- Check if u can write something on FS
# pwd
/mydata
# ls
lost+found ram sam
#
will meet with some more stuff next time.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment