In this case, the MIGRATELP command is your most trustworthy friend. When you encounter a failed disk or you need to migrate data from one disk to another, you can use the MIGRATEPV or create a mirrored copy, and you will not be restricted to one method. For the original volume group (VG), you may experience a factor (http://www.aliyun.com/zixun/aggregation/16557.html ">factoring") problem when adding a disk to VG. However, by understanding the characteristics of VG, you can change the factor. In this article, we'll use some examples to discuss these common disk maintenance tasks.
When it comes to disk maintenance, some common acronyms that are familiar with disk-related properties are good because they make conversations more concise.
VG: Volume group LV: Logical Volume LP: Logical partition PP: Physical partition PV: Physical volume (disk)
Many times, when you get to the office, you hear all users and support people start complaining that the system is running slowly. Regular quick checks include:
Processor limit memory Limit disk access network process intrusion
After performing some performance tests, you may conclude that access congestion is caused by disk access, and the dispersion of data on the disk. No one likes it. So let's say you've identified hotspots on disk by analyzing the output from tools such as Filemon, Topas, Nmon, or Lvmstat. You need to move the data to another disk to ease blocking. Another disk may be a new disk, and more likely an existing disk that is not filled with data in VG. Let's go through two scenarios to see how to move data from one disk to another. Before that, however, it's a good idea to know some of the commands so it's convenient to view the LV and PV.
Most important disk-related commands
Here are all the commands that I think you need to know to get the right information before you perform the data Migration task.
Get information from a PV
The size of the disk you are looking at (in megabytes) is always the information you need to know. If the disk name is HDISK4, use the getconf command to find the size:
# getconf disk_size/dev/hdisk49216
Use the LSPV command to extract disk information.
Lspv-l <hdiskx>:
The above commands list the LV and LP, and the mount points of the PP and file system, if applicable.
Lspv-m <hdiskx>:
The above Commands list PV, PP number, LV, and LP numbers.
Get information from a VG
Use the Lsvg command to get the layout of the VG for one (or more) PV.
Lsvg <vg_name>:
The above command lists general information about the VG properties, mainly PP size, total space, free space, and used space.
Lsvg-l <vg_name>:
The above commands list the file system type, LP and PV, and the LV state (open or closed) and the file system mount point (if applicable).
Lsvg-p <vg_name>:
The above command lists the PV that belongs to the VG, as well as the total pp space and the free pp space.
Get information from LV
You can use the LSLV command to obtain information about the LV.
Lslv-l <lv_name>:
The above command lists the PV of the LV.
Lslv-m <lv_name>:
The above commands list LP, partition number, and PV, which apply to all PV in the LV.
The output of the above command provides you with sufficient information to determine whether it is appropriate to perform a data migration using the following migration technologies:
Migratelp MIGRATEPV Disk Mirroring
In this demo, I created a small file system, small LV, because I needed to make the output as small as possible. In reality, the LV of a normal application is very large. Therefore, LV's LP list will be very long. One trick is to print out the LV list and then use a marker pen to determine which LP to move.