Review:

The previous article, “Viewing and modifying volume group properties for AIX Storage Management, PART ii,” described how to view and modify AIX volume group properties. I won’t go over all of them here, but just point out that if you’re not familiar with commands, you can use the SMIT tool.

Viewing and Modifying volume Group properties for AIX Storage Management (2)

To know the new:

Today is about viewing and modifying the properties of logical volumes, and after that, storage management for AIX is basically over. We’ll do a summary later, if you’re interested.

1. Create a logical volume

How to create a logical volume. There are also a few points to note when creating logical volumes:

  1. How many logical partitions should a logical volume contain, that is, the size of the logical volume is clear.
  2. Create a logical volume in a volume group and specify the name of the volume group to which the logical volume belongs.
  3. Specifies the name of the logical volume.
  4. Indicates the physical volume on which the logical volume is created.
  5. Indicates where the physical partition allocated to the logical volume is located in the physical volume, i.e. the internal disk allocation policy.
  6. Whether to mirror the logical volume and have several copies.
  7. If a logical volume is mirrored, you need to specify the distribution policy of the physical partitions of each copy on the physical volume, that is, the allocation policy between disks.
  8. Whether to open write validation for the logical volume.

The command used to create the logical volume is MKLV, for example, to create gaolv in rootvg. The logical volume is mirrored by two copies and has 20 logical partitions. Each logical partition maps to two physical partitions. Therefore, the total number of physical partitions is 40.

mklv -y gaolv -c 2 rootvg 20
Copy the code

You can also use the smit tool with the following command:

Smitty LV interface access toolCopy the code

1. Select add logical volume

 

2. Enter the name of the volume group to which the logical volume belongs

3. Enter the properties of the logical volume

Fill in the corresponding information.

There is one small problem. Do you know how to calculate the size of logical volume in the actual physical hard drive? From the previous explanation, it is not difficult to know that a logical volume is composed of logical partitions, so you only need to know how many logical partitions there are. Is that right?? This is half true because one logical partition can map to one to three physical partitions.

1. If there is no copy of the logical volume (the size of the Lv itself)

Size of a logical volume to a physical disk (MB) = Size of a PP (MB) x Number of LVS

2. If there are copies of the logical volume

Size of a logical volume to a physical disk (MB) = Size of a PP (MB) x Number of LVS x number of LVS

One more trivia question: Do you know how to change the size of a logical volume? You can change the size of a logical volume by adding or reducing logical partitions. You can change the physical location of a logical volume on a disk by increasing or decreasing the number of mirrors for the logical volume.

2. View logical volume properties

1. Display all logical volumes in a volume group

lsvg -l rootvg
Copy the code

​      

2. Display detailed logical volume properties

lslv gaolv
Copy the code

3. Displays the physical volumes that a logical volume spans and the distribution of logical volumes on physical volumes

lslv -l gaolv
Copy the code

Note:

The “COPIES” column indicates the number of PP’s used by three COPIES of the logical volume on the same physical volume. The format of the COPIES” column is as follows:

If two COPIES of logical volume Gaolv reside on the same physical volume hdisk1, the value of the “COPIES” column corresponding to hdisk14 should be 128∶128∶000. This logical volume mirroring cannot prevent the single point of failure of hdisk1. The entire Gaolv is lost. The contents of the “DISTRIBUTION” column indicate the DISTRIBUTION of the PP of the logical volume on the physical volume.

For example, a Gaolv logical volume on Hdisk1 has 64 PP on the outer edge and 96 PP on the inner edge. On Hdisk0, 32 PP on the outer edge and 96 PP on the inner edge.

Displays the logical volume allocation on the specified physical volume

lslv -p hdisk0
Copy the code

5. Display the copy allocation of the mirrored logical volume

lslv -m gaolv
Copy the code

3. Modify logical volume properties

If you want to modify the properties of a logical volume, it is recommended to use the SMIT tool, because for me, using commands to modify properties requires a lot of parameters to remember, and my mind is not working well.

smitty chlv
Copy the code

1. Select modify logical volume

 

2. Enter the logical volume name

3. Go to the modify page

4. Copy the logical volume

1. Copy a logical volume to a new logical volume.

CPLV -γ rootvg -y newLV oldlvCopy the code

This command copies the contents of the old logical volume oldlv to a new logical volume newlv in a volume group named myVG. If no volume group is specified, the new logical volume and the old logical volume belong to the same volume group. The CPLV command does not copy the first 512 bytes of the logical volume to the new logical volume because these 512 bytes are LVCB, but it writes LVCB of the new logical volume with the new properties.

2. Copy a logical volume to an existing logical volume.

# cplv-e existinglv oldlv
Copy the code

This command copies the contents of the old logical volume oldlv onto an existing logical volume ExistingL, both of which are in the same volume group. Because data on an existing logical volume is being overwritten, the user is asked to confirm whether to continue the replication operation. If the existing logical volume is smaller than the original logical volume, data may be lost and replication may fail.

You can also use the smit tool to run the following command:

smitty lv
Copy the code

1. Select the burn part in the picture

2. Select the corresponding method

The first item is to copy to an existing logical volume, the second item is to copy to a user-created logical volume, and the third item is to copy to a system-created logical volume.

5. Adding or reducing copies to a logical volume

Using the SMit tool, run the command

smitty  lv
Copy the code

1. Select the deepened part

2. Select Item 3 or item 4 to add or delete copies

Development:

Have you ever wondered what factors affect the performance of a logical volume? I’m going to talk briefly about two factors. One is internal disk allocation, the other is disk allocation.

Internal disk allocation means that the physical partition of the logical volume is stored in the actual location of the disk. For a single disk, it is recommended that the logical volumes that are frequently used and accessed be placed in the central area of the disk, and the logical volumes that do not need frequent access be placed in the edge area. But there is a special case: on the Edge of the disk outside (the Outer Edge of each track on storing data block than in each track on stored in other areas of the disk blocks of data, so the need to perform a large number of order is for applications that read and write operations, if on the Edge of the outside disk to store data, can produce higher throughput.

Disk allocation refers to the distribution of physical partitions of a logical volume among multiple physical volumes. Within the same volume group, the physical partitions of a specified logical volume can be distributed on one or more disks, depending on the setting of the “RANGE of physical Volumes “option when creating the logical volume (when creating the LV with the smitty MKLV command). This option (Range) has two Range values: minimum and maximum. 1) Minimum Indicates that the physical partition of a logical volume should be distributed on as few physical volumes as possible. If one physical volume is insufficient, the physical partition should be distributed on as few physical volumes as possible. Minimum values should only be used to increase the availability of data and should not be set for logical volumes that require frequent access. 2) Maximum means to distribute the physical partition of a logical volume across as many physical volumes as possible, usually across all physical volumes in a volume group. The maximum value reduces the average time to access a logical volume. If a non-mirrored logical volume spans multiple physical volumes, an error on any physical volume will result in data loss, making the data on the logical volume incomplete. Maximum is a performance-oriented setting that should be used in conjunction with mirroring to improve data availability and logical volume performance.