Thursday 2 June 2011

AIX Data Storage - Part 4

WORKING WITH LOGICAL VOLUME MANAGER (LVM) - SUB-PART 2:


Objectives for the module
>Working with Logical Volumes
>Mirroring & Stripping

Logical Storage



Explanation:
Logical Volumes is a collection of logical partitions which may span across multiple physical volumes in the same volume group.

A file system structure is usually sits on top of a logical volume.
If required, the logical volume can be dynamically increased.

There is a limit of 512 LVs per Volume Group.
Logical Partitions are mapped to the physical partition. Usually this mapping is one-to-one unless there is mirroring done on the LV.


Mirroring





Explanation:
Mirroring is when a logical partition maps to more than one physical partition of the same volume group.

Ideally each copy must reside on a separate disk but this restriction can be removed.

There are various mirroring scheduling policies:
a.Parallel policy: Read: On each read, the system checks whether the primary is busy. If its not busy, the read is initiated on the primary, otherwise from secondary.
                            Write: Initiated concurrently.
b. Parallel/Sequential: Read: Always reads on primary copy.
                                     Write: Initiated concurrently.
c. Parallel/Round robin: Read: Alternates between copies, resulting in equal utilization.
                                        Write: Initiated concurrently.
d. Sequential: Read: Always reads on primary copy.
                       Write: initiated serially, first to the primary and then to secondary disk

MWC ( Mirror Write Consistency)

Explanation:

MWC (Mirror Write Consistency) ensures data consistency on logical volumes in case of system crashes during the mirrored writes.

There are two methods of MWC :
a.Active Method: Consistency is achieved by logging when a write occurs. LVM makes an update to the MWC log that identifies what areas of the disk are being updated before performing the write of the data. This actually results in a performance degradation during random writes.

b.Passive Method: Introduced with AIX version 5.1. Passive method reduces the problem of having to update the MWC log on the disk. This method logs that the logical volume has been opened but does not log writes. If the system crashes, then the LVM starts a forced synchronization of the entire logical volume when the system restarts.

You can set MWCfor a logical volume by using the option –wwith either the mklvcommand or with the chlv command. The various options to set for the MWC option(-w) are:

a.y or a (Yes or Active) –Each write is logged to MWC log. Default value setting.
b.P ( Passive)–Use the passive method.
c.n (No)–There is no MWC, if there is a crash, then the mirrored LVs are in inconsistent state.

Striping

•Normal flow of data blocks when a logical volume is spread across physical volumes:

•The layout of stripe units when a logical volume is set up to stripe:

•Consecutive stripe units are created on different physical volumes
•Striping increases read/write sequential throughput by evenly distributing stripe units among disks
•Stripe unit size is specified at creation time

Striped Columns

Explanation:

Striping is a technique for spreading the data in a logical volume across several hard disks such that I/O capacity of all disk drives can be simultaneously used.

In a non striped logical volume, data is accessed using the addresses to the data blocks within the physical partitions.

In a striped logical volume, the data is accessed using the addresses of the stripe units (data of a striped logical volume is broken into units called stripe units). The size of the stripe unit is usually specified during the creation time and it could range form 4 kb to 128 kb.

To implement striping at your size, at least two physical volumes are required. Recommendation is that the number of physical partitions allocated to a striped logical volume must be able to be evenly distributed among the disks.

Intra-physical volume allocation policy:

Inter-physical volume allocation policy:

  • Maximum number of physical volumes to use
  • Range of physical volumes to use
Explanation:
Intra physical volume allocation policy specifies where on the physical volume the partitions will be allocated to the logical volume. The choices could be inner edge, inner middle, centre, outer middle and outer edge areas. Usually the centre area generally was the area with the best performance on older disks but may not be true with the newer disks. You may have to go through the documentation for the hard disks to come to a conclusion.

Inter physical volume allocation policy specifies how many physical volumes can be used to contain the physical partitions of the logical volume. It also specifies the range of volumes used i.e. minimum ( allocate partitions on one physical volume or as many as there are (maximum).

Logical Volume Menu


Explanation:
You can use the fastpath #smit lv to get into the main menu pertaining to the logical volumes.
You can use this menu to continue with the management tasks which may relate to listing all the logical volumes by volume group, Add a logical volume, set the characteristics of a logical volume, show the characteristics of a logical volume, remove a logical volume, copy a logical volume if required.

Viewing characteristics of Logical Volume

Explanation:
The command # lslv –l <lvname> gives information about the distribution of a particular logical volume’s logical partitions for each physical volume.

The output shows:
a.The name of the physical volume.
b. Number of logical partitions on the disk and its copies if any.
c.In Band –percentage of physical partitions which match the intra policy of the logical volume
d.Distribution of physical partitions on the physical volume ( outer edge, outer middle, centre, inner middle and inner edge)

Copies information for e.g. : 001:000:000, the first information is regarding the first copy i.e. 1 pp. The next two fields hold information regarding the second and third mirrored copies on the physical volume.

The command #lslv –m <lvname> would give information about the LPs and its mapping to the physical partitions and the physical volumes on which these physical partitions are present.
First set of values are for the first copy and the second and the third columns are for mirrored copies if any.

Adding a Logical Volume

Explanation:
You can use the fastpath $ smit mklv to get into this SMIT menu to add a new logical volume. The mandatory options here would be the name of the Volume Group where you want to create the Logical 

Volume and the size of the logical volume in terms of the number of Logical Partitions to allocate to the logical volume. If required you can also specify the name of the logical volume that you are creating. If not by default it creates a logical volume with the name starting aslvand then followed by a running sequential number like lv00, lv01 etc.

Removing a Logical Volume


Explanation:
If a logical volume is not required, you can use the fastpath # smit rmlv to remove a logical volume.
You can also use the high level command rmlvto remove a logical volume.

Recommendation: Do not use the rmlv command to remove journaledfile systems or paging space, This high level structures have information relating to them saved in the ODM database and in some files like /etc/filesystems. The command rmlvcommand doesn’t cleanup the lvrelated information from the database or the file.

Set Characteristics of a Logical Volume


Explanation:
You can use the fastpath #smit lvsc to set the characteristics of a logical volume.
You can change the logical volume details, you can rename a logical volume, you can increase the size of a logical volume, Add a copy to a logical volume, and remove a copy from a logical volume.

In AIX 5.1 and above the size of the logical volume may not be decreased dynamically. To make a logical volume smaller, you may have to backup the data, delete the logical volume, recreate a logical volume with the desired small size and restore the data.
You can use the high level command # chlv to change the various attributes of the logical volume.

Viewing characteristics of logical volumes


Explanation:
The command discussed here is the lsvgcommand to list the characteristics of a volume group. The various options used are:-
-il-> to list the logical volumes within the volume group. Option –i of lsvg reads the list of volume groups from the standard input.
-o-> active volume groups.

Show Logical Volume Characteristics


Explanation:
The command lslv is to list the characteristics of a logical volume.

The output of the command gives the details about the logical volume. It shows the state of the volume group,typeof the logical volume, inter and intra policy of the logical volume, mount point, state of the LV, number of LPs within the LV etc.

Write Verify :specifies whether to verify all writes to the logical volume with a follow-up read.

Bad Block:specifies whether the Logical Volume Manager should try to relocate a bad block if one is encountered.

Add/Remove a logical Volume Copy


Explanation:
You can use the fastpath # smit mklvcopy to get into this option to add/remove the number of logical partition copies.
You can also use the high level command called mklvcopy to add copies (mirroring) to a logical volume that has none or to increase the copies from two or three.
You can use rmlvcopy command to reduce the total number of copies for a logical volume.

NOTE: Once a logical volume has been created, striping cannot be imposed on it or removed from it.
The mirrored copies in order to be matching to each other, the logical volume has to be synchronized using the syncvg command.

Reorganizing a Volume Group


Explanation:

When you change the intra-physical volume policy ( centre, middle, edge) the physical partition will not relocate automatically.

You can use the fastpath #smit reorgvg or the high level command reorgvg to relocate or re-distribute the physical partitions according to the intra policy.

E.g.: # reorgvg datavg mylv lv01

If you issue reorgvg command with the volume group name but no logical volume name, the entire volume group gets reorganized



Incoming Search Terms:
Everything about Logical Volume
AIX logical volume
Logical volume in detail
Working with Logical volume
Stripping and mirroring
how to perform stripping and mirroring in AIX
Guide to logical volume in AIX
Guide to logical storage data in AIX
LVM in AIX

No comments:

Post a Comment