Tuesday, April 13, 2010

1.Physical volume

Here I would like to add some contents which will be useful for administrators to troubleshoot the issue.

n one system, many disks can make up a volume group. Disks cannot be shared between volume groups. The entire disk is dedicated to being part of one volume roup.On one system, many disks can make up a volume group. Disks cannot be shared between volume groups. The entire disk is dedicated to being part of one volume group.


Logical volumes reside only on volume groups. A logical volume can span multiple disks within a volume group(but cannot span multiple volume groups): lv00. Or, a logical volume can just reside on one disk: biglv.Finally,a logical volume can have multiple copies of itself: mirrlv. 

Physical volumes


Disk Independence


The basic design of the interaction between LVM and the disk device driver has always assured that LVM’s use of the disk would behave the same regardless of the type of disk being used in LVM. Thus, a disk drive such as the serial dasd drive (9333 drives) behave the same in LVM as the standard SCSI drive, although they use different disk and adapter device drivers.

PVID’s and how they configure


When a disk is configured to a system for the first time, it shouldn’t have a PVID if it is a brand new disk. When it is used in a volume group, the user sees a message to the effect of:

Making this disk a physical volume

Which is another way of saying that a PVID is being placed onto the disk. The PVID is an amalgamation of the machine’s serial number (from the systems EPROMs) and the date that the PVID is being generated. This combination insures the extremely low chance of two disks being created with the same PVID. Finally, when a system is booted, the disk configurator goes and looks at the PVID sitting on each disk platter and then compares that to an entry in ODM. If the entry is found, then the disk is given the hdiskX name that is associated with the ODM entry for the PVID. If there is no PVID, the configuration routines will automatically assign the next free hdisk name from the pool of “free” hdisk names.

Note that if a hdisk has been removed with the “rmdev -l hdiskX -d” command, then this hdisk name will be available for reuse by a later disk.

One question here....
Why it is unsupported method to copy using "dd" command to copy the entire contents of one disk to another disk?
When we copy using "dd" we forgets in this action is that they are literally copying over the PVID of
the first disk onto the platter of the second disk. The extremely rare consequence of this “dd” is that the user may have, in the distant future, two disks attached to the same p-series or RS/6000 with the same PVID. When this occurs, EXTREME confusion will occur.

Working on physical volumes
***********************
A physical partition (PP) is the basic or smallest unit of allocation of disk. The default size of the PP’s is 4 MB. The PP size can be changed in increments of the power of 2 up to 1024MB.The default maximum number of PP’s per Physical Volume is 1016. All PP’s within a volume group are the same size and can’t be changed dynamically. The number of physical partitions per physical volume can be changed dynamically in multiples of 1016 (1016, 2032…).

The top level menu for Physical Volume

#smitty pv

List all Physical Volumes in system

#lspv

List contents of a Physical Volume

#lspv hdisk0

To lists all the logical volumes on a Physical Volume

#lspv –l hdisk0

Listing Physical partition allocation by Physical Volume region

#lspv –p hdisk0

Listing Physical partition allocation table

#lspv –M hdisk0

Migrating the contents of a Physical Volume
*************************************
The PP’s belonging to one or more specified logical volumes can be moved from one physical volume to one or more other physical volumes within a volume group using the migratev command.

Note: The migratepv command can’t move data between different volume groups.
How to move the data from a failing disk before it is removed for repair or replacement.

Step1: Make sure that the source and destination PV’s are in the same VG.

#lsvg –p rootvg

Step2: If you are planning to a new disk such as when you have a failing disk

Make sure the disk is available

#lsdev –Cc disk

If OK , Make sure it does not belong to another VG

#lspv

Add the new disk to the VG

#extendvg rootvg hdisk1

Step3: Make sure that you have enough room on the target disk for the source that you want to move.

Determine the number of PP’s on the source disk

#lspv hdisk1
grep “USED PPs”

Determine the number of free PP’s on the Destination disk

#lspv hdisk2
grep “FREE PPs”

Step4: If you are migrating data from a disk in the rootvg

#lspv –l hdisk1
grep hd5

If you get the hd5 information

#migratepv –l hd5 hdisk1 hdisk2

Note: The migratepv command is not allowed if the VG is varied on in a concurrent mode.



Next, you will get a message warning you to perform the bosboot command on the destination disk.

#bosboot –ad /dev/hdisk2 === hdisk2---Destination Disk

#bootlist –m normal hdisk2 === hdisk1--- Source Disk

#mkboot –cd /dev/hdisk1

Step5: If you are migrating data from a disk in other than rootvg

#smitty migratepv

Step6: To remove the source disk from the volume group such as when it is failing

#reducevg rootvg hdisk1

#rmdev –dl hdisk1



Examples related to migration:

To move PP’s from hdisk1 to hdisk6 and hdisk7 (all PV’s are in one VG)

#migratepv hdisk1 hdisk6 hdisk7

To move PP’s in LV lv02 from hdisk1 to hdisk6

#migratepv –l lv02 hdisk1 hdisk6

No comments:

Post a Comment