You are on page 1of 7

AIX ���� PVID ��� ޸Ļָ�����

2016 ��06 ��21 �� AIX ��ά �������� �Ķ � 1,379 ��

inewup-aix-pvid

������ƪ ���£ �������

pvid��aixϵͳ��ODM,LVM����ʶ��PV�����кţ�����ϵͳͳ��pvid4ʶ��pv����pv����ӵ�ϵͳ
�� ֮ �
޸޸ �
޸�޸ �ͳ��}�ַ � ʽ���pvid

1��cfgmgr -v

2��lspv ���û��PVID�Ļ���ִ � � chdev -l hdiskn -a pv=yes

Ҳ����˵��ϵͳ����ʶ��Ӳ��
��v��Ӳ���Ͽ�
p Ϊ
���lvm��������ʱ��ϵͳ�ͷ�����pvid��Ӳ���ϵͳ��odm���б�����pvid��pvid����

������кţ��γ�pvʱ���ʱ��c�pvid����д��odm�⣬��Ӳ��ͷ��Ϣ�0�����ͷ�����ֽ
‫ � �ڣ‬Լ� VGDA Ҳ� � д�� pvid� � Ҳ���� ˵pvid� ������‫� � �ط‬

To make a disk into a physical volume, the PVID is placed onto the disk. ThePVID is
an combination of the machine's serial number (from the systems EPROMs) and the
date the PVID was generated. This combination ensures the extremely low chance of
PVIDs being duplicated. When the system is booted, the disk configurator looks at
the PVID residing on the disk and compares it with an entry in the ODM. If an entry
is found, then the disk is given the hdiskx number in the ODM that is associated
with the PVID. If there is no matching entry, then the next name in the pool of
'free' hdisk names is allocated to the physical volume.

����ͳ�� lquerypv -H hdisk4�鿴pv�ϵ�pvid

bash-4.2# lquerypv -H /dev/hdisk4

00cd3585e72effee0000000000000000

bash-4.2# lspv

hdisk0 00cd34c53fd6f1c2 rootvg active

hdisk1 00cd34c58a50fa1e rootvg active

hdisk4 00cd3585e72effee datavg active

���Կ������pv��pvidǰ��λ����������ģ���������кţ�����λ�����Dz���ġ�

����ͳ�����·����޸�pvid

chdev -l hdisk2 -a pv=clear ���pv ����ͷ��pvid

chdev -l hdisk2 -a pv=yes ���¶���pvid�����pvid���‫������ � � �ʹ�ڣ‬Ҳû���ա�

���pv�Ѿ�������飬���Ȼ� � ��� varyoffvg � � exportvg

ִ ִ�����ϲ��裬 pv��pvid����ı 䡣�����޸ĵ�ֻ �Ǵ���ͷ��pvid ����û ���


޸�vgda�е�pvid��

��pv�Ѿ���һ�����ij�Աʱ���мDz�Ҫ����޸�pvid����Ȼ���vg��varyon�ģ���Ҳ���
޸IJ��˵ġ�
bash-4.2# chdev -l hdisk2 -a pv=clear

Method error (/etc/methods/chgfcparray):

0514-062 Cannot perform the requested function because the

specified device is busy.

��Ϊ��pv����һ������ʱ��pvid����д��vgda������������޸ľ����pvid��Ȼ�
�����ɵ�pvid�����ܺ;���vgda�е�pvid��ƥ�䣬 ������޸�importvg�����
޸�varyonvg�����п��ܾͻᶪʧ��‫���ݣ‬importvg��ʱ��odm����ȡpv�ϵ�vgda�����vgda��
pvid����������ϵ�pvid����ϵĻ��������ִ���

‫�ע‬⣺��pv ��������Ժ �pvid ��Ӳ ���ϴ��������� ‫���ط‬һ������Ӳ


} �� ��ͷ��һ��
����vgda�С���}��‫���ط‬pvidһ������� ���������� pvid��� ޸ģ�������
�ģ
ɲ�һ�£�������п��ܶ�ʧ��‫�ݡ‬

bash-4.2# lspv

hdisk0 00cd34c53fd6f1c2 rootvg active

hdisk1 00cd34c58a50fa1e rootvg active

hdisk2 00cd34c5eb733676 None

......................................

bash-4.2# smitty mkvg

bash-4.2# lspv

hdisk0 00cd34c53fd6f1c2 rootvg active

hdisk1 00cd34c58a50fa1e rootvg active

hdisk2 00cd34c5eb733676 testvg active

.....................................

��hdisk2������testvg���ʱ��b��pvidtest�ļ�ϵͳ��

bash-4.2# mount /pvidtest

bash-4.2# df -g

Filesystem GB blocks Free %Used Iused %Iused Mounted on

/dev/hd4 5.00 4.42 12% 13825 2% /

...................................

/dev/fslv00 0.50 0.50 1% 4 1% /pvidtest

bash-4.2# cd /pvidtest

bash-4.2# vi test.txt

bash-4.2# ls
lost+found test.txt

���ļ�ϵͳ��д���������‫�ݡ‬

bash-4.2# varyoffvg testvg

bash-4.2# exportvg testvg

bash-4.2# importvg -y testvg hdisk2

testvg

--export/import vg����û����ġ�

bash-4.2# chdev -l hdisk2 -a pv=clear

Method error (/usr/lib/methods/chgdisk):

0514-062 Cannot perform the requested function because the

specified device is busy.

pvvgû��varyoff�Ǹı 䲻��pvid�ġ�

bash-4.2# varyoffvg testvg

bash-4.2# chdev -l hdisk2 -a pv=clear

hdisk2 changed

bash-4.2# lspv

hdisk0 00cd34c53fd6f1c2 rootvg active

hdisk1 00cd34c58a50fa1e rootvg active

hdisk2 none None

.....................

bash-4.2# chdev -l hdisk2 -a pv=yes

hdisk2 changed

bash-4.2# lspv

hdisk0 00cd34c53fd6f1c2 rootvg active

hdisk1 00cd34c58a50fa1e rootvg active

hdisk2 00cd34c538a357cf None

................................

‫⿴�ע‬pvid�Ѿ��ı��ˡ�vgҲ��ʧ�ˡ�

bash-4.2# varyonvg testvg


0516-510 varyonvg: Physical volume not found for physical volume

identifier 00cd34c5eb733676

vg���޸�varyon��

bash-4.2# lqueryvg -Atp hdisk2

0516-320 lqueryvg: Physical volume hdisk2 is not assigned to a volume group.

Max LVs: 256

PP Size: 29

Free PPs: 556

LV count: 2

PV count: 1

Total VGDAs: 2

Conc Allowed: 0

MAX PPs per PV 1016

MAX PVs: 32

Quorum (disk): 1

Quorum (dd): 1

Auto Varyon ?: 1

Conc Autovaryo 0

Varied on Conc 0

Logical: 00cd34c500004c0000000151388d1f90.1 loglv01 1

00cd34c500004c0000000151388d1f90.2 fslv00 1

Physical: 00cd34c5eb733676 2 0

......................

��ȡhdisk2 vgda����Ϣ��
���¿�ʼ�޸���

1.bash-4.2# exportvg testvg

2.�����޸������Ӧ���ļ�����һ�ֶ�ΪVGDA���е��
‫ֶ�������� ڶ‬
޸ �Ϊ���¾������µ��
޸���������Ҳ�ɲ����Ϊ���޸�ԭ�������
о� ‫��ֲ����� �ݣݣݣ ݣ‬䡣
޸ � ���

bash-4.2# cat pvidfixlv

fslv00:fslv00

loglv01:loglv01
3.��Ӳ�������´������飬����ԭ�
������
о ‫ݽ‬ṹ��

bash-4.2# recreatevg -y testvg -l /tmp/pvidfixlv hdisk2

testvg

bash-4.2# lsvg -o

testvg

......

bash-4.2#

4.�޸�/etc/filesystems

/fs/pvidtest:

dev = /dev/fslv00

vfs = jfs2

log = /dev/loglv01

mount = false

check = false

options = rw

account = false

recreatevg ��ϵͳ�Զ�������Ŀ¼/fs�����е��ļ�ϵͳ���
‫���ص‬/fs�£�ԭ� 4 � mountpoint����/Ϊ��޸�ġ�

bash-4.2# lsvg -l testvg

testvg:

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT

loglv01 jfs2log 1 1 1 closed/syncd N/A

fslv00 jfs2 1 1 1 closed/syncd /fs/pvidtest

/pvidtest:

dev = /dev/fslv00

vfs = jfs2

log = /dev/loglv01

mount = false

check = false

options = rw
account = false

�޸�/etc/filesystems֮������ӡ�

bash-4.2# mount /pvidtest

bash-4.2# cd /pvidtest

bash-4.2# ls

lost+found test.txt

�ļ����‫ڣ�״״‬Ҳ����� ޸���ϡ�

�‫ٴ‬β鿴VGDA�е���‫��ݣ‬ɷ���hdisk2��PVIDҲ�Ѿ����޸�Ϊ�µ�ֵ
bash-4.2# lqueryvg -Atp hdisk2
Max LVs: 256
PP Size: 29
Free PPs: 1114
LV count: 2
PV count: 2
Total VGDAs: 3
Conc Allowed: 0
MAX PPs per PV 1016
MAX PVs: 32
Quorum (disk): 1
Quorum (dd): 1
Auto Varyon ?: 1
Conc Autovaryo 0
Varied on Conc 0
Logical: 00cd34c500004c000000015138a9f3e6.1 loglv01 1
00cd34c500004c000000015138a9f3e6.2 fslv00 1
Physical: 00cd34c538a9f276 1 0
............................
=============================
)չ˼�룺룺룺����Ƕ������ɵ�VG�ֻ���ʲô���ӵ��‫�أ‬
bash-4.2# lspv
hdisk0 00cd34c53fd6f1c2 rootvg active
hdisk1 00cd34c58a50fa1e rootvg active
hdisk2 00cd34c538c772b6 testvg active
hdisk3 00cd34c538c7768c testvg active
....................................
ͬͬ� ����vgû � �varyoff � � ʱ� � �Dz ���� ޸�pvid��
bash-4.2# chdev -l hdisk3 -a pv=clear
Method error (/usr/lib/methods/chgdisk):
0514-062 Cannot perform the requested function because the
specified device is busy.
bash-4.2# varyoffvg testvg
bash-4.2# lspv
........................
hdisk2 00cd34c538c772b6 testvg
hdisk3 00cd34c538c7768c testvg
...............
bash-4.2# chdev -l hdisk3 -a pv=clear
hdisk3 changed
bash-4.2# lspv
hdisk0 00cd34c53fd6f1c2 rootvg active
hdisk1 00cd34c58a50fa1e rootvg active
hdisk2 00cd34c538c772b6 testvg
hdisk3 none None
..............................................
bash-4.2# chdev -l hdisk3 -a pv=yes
hdisk3 changed
bash-4.2# lspv
hdisk0 00cd34c53fd6f1c2 rootvg active
hdisk1 00cd34c58a50fa1e rootvg active
hdisk2 00cd34c538c772b6 testvg
hdisk3 00cd34c538d61c54 None
.........................................
bash-4.2#
,exportvg ��Ҳ������
ͬͬ��� recreatevg
bash-4.2# exportvg testvg
bash-4.2# recreatevg -y testvg -l /tmp/pvidfixlv hdisk2 hdisk3
testvg
bash-4.2# lspv
hdisk0 00cd34c53fd6f1c2 rootvg active
hdisk1 00cd34c58a50fa1e rootvg active
hdisk2 00cd34c538dd3b9c testvg active
hdisk3 00cd34c538dd3cd6 testvg active
..............................
�鿴�ļ�ϵͳ��ϵͳ����ǰ�������һ��/fsǰ޸
/fs/fs/pvidtest:
dev = /dev/fslv00
vfs = jfs2
log = /dev/loglv01
mount = false
check = false
options = rw
account = false
�޸ģ�mount���鿴�ļ�һ��dz�

You might also like