Wednesday, April 14, 2010

3. Logical Volume

Logical Volumes

Some important things about LV's which many won't know
Members of specific volume groups

Can control location of logical volumes

Can view location of logical volumes

Non-typical logical volumes

Logical Volume Control Block

LVID
 
Members of specific volume groups
 

Logical volumes that reside on a volume group and only exist in that volume group. Logical volumes are not allowed to be mirrored to other volume groups and cannot be spanned from one volume group to another volume group.  This is in part to the information held on a logical volume by the VGDA. The VGDA can’t be expected to not only track a logical volume in its own volume group and then additionally track the logical volume (and more important its status) on another volume group.

Can control location of logical volumes

The creation of the logical volume allows many levels of control, from no control to disk specific control to partition location control. The main binary which determines how the partitions are allocated to the user’s request is /usr/sbin/allocp. The binary takes into account user specific requirements at the command line and the default values, such as the intra-policy and the inter-policy. With no specific arguments, such as the disk(s) where the logical volumes “should” be created on, allocp will just use the available defaults as the blueprint to determine how the logical volume is allocated. If the user gives a list of disks where they would like the logical volume to be allocated, allocp will create the logical volume with those disks as its parameters. If it cannot fulfill these disk requirements, then the “mklv” command will fail. Finally, with map files,
the user can tell the logical volume which exact physical partition on the disk they wish the logical volume to be created. Implicit in this fact is the ability to control the ORDER which these physical partitions are allocated. People with their own theories of optimal data access tend to try to control the logical volume formation at the physical partition level.

Can view location of logical volumes

The LVM commands provide many ways of letting the user view the same logical volume. They can usually just be simply deduced, after some experience in using LVM. For instance, if I want to look at how a logical volume is laid out onto one disk, I simply type: “lspv -M hdiskA  grep lvX”. Or, I can type “lslv -p lvX”. Or, I can use “lslv -m lvX”. Or, I can use “lsvg -l vgname grep lvX”. The point is that there is more than one way the logical volume’s location can be viewed by the many LVM high level commands.

Non-typical logical volumes
 
There are a few logical volumes that exist on the system that are used and accessed in the typical manner. Besides the log logical volume (used by jfs), there are the dump device logical volume, the boot logical volume, and the paging device logical volume.After AIX 4.1, note that the paging device and the dump device are the same logical volume. This was done as part of an effort to “lighten” the system and makes sense. Not only do you free up disk space formally used by the dump logical volume (which you hoped never had to be used), but you’ve also now guaranteed that the  dump device is large enough to capture the dump image if you do have a system failure. However, there is a side-effect to th is change.When the user tries moving their original paging device (hd6), they cannot do so even though they have correctly turned
off their paging device and rebooted the machine. The reason is that the dump device has a lock on the logical volume that prevents the removal of the dormant paging device. This is easily fixed by resetting the dump device with the “sysdumpdev” command.

Logical Volume Control Block

The logical volume control block (lvcb) consists of the first 512 bytes of a logical volume. This area holds important information such as the creation date of the logical volume, information about mirrored copies, and possible mount points in a journaled filesystem.

LVID

The LVID is the soft serial number used to represent the logical volume to the LVM libraries and low level commands. The LVID is created from the VGID of the volume group, a decimal point, and a number which represents the order which the logical volume was created on the volume group.


Commands related to Logical Volume
******************************
A logical volume may contain one of the following and only one at a time
• Journaled or Enhanced journaled file system (for Ex: /dev/hd4)
• Paging space (/dev/hd6)
• Journal Log (/dev/hd8)
• Boot Logical Volume (/dev/hd5)
• Nothing (raw device)

#smitty lv

To show characteristics of a LV
#lslv –l lv00
Map of which PV’s contain which PP’s for the LP’s of the LV
#lslv –m lv00
To create a LV
#smitty mklv
To remove a LV
#smitty rmlv
Note: Do not use rmlv to remove JFS or Paging space volumes.
To list all the LV’s defined on the system
#lsvg
lsvg –il
To increasing the size of a LV
#smitty extendlv
Logical volume size
Total LV size=PP size * LP’s assigned to LV * Number of copies of the LV.

No comments:

Post a Comment