19: linux performance optimization: Advanced lvm usage

Source: Internet
Author: User

19: lvm advanced usage 18: linux performance optimization 18: lvmhttp: // www.bkjia.com/ OS /201307/231381.html introduces the "logical volume" management technology, we all know that it has advantages over traditional disk management. Here I have a lvm Management Manual "LVM HOWTO", which is mostly about concepts and usage methods. If you want to, you can leave a message or search for it online. In addition to the features of scaling, the logical volume also has the ability to migrate the underlying physical volume! The theoretical life of a hard disk is more than 30 thousand hours. Generally, the hard disk is finished after being started for three years. If it is used normally for 10 years, there is no problem. Unfortunately, the disk on the server we manage is always in the starting state. If we use a logical volume, it may be just a few logical volumes for the upper layer, there may be multiple physical disks at the underlying layer. The service life of these disks is approaching! What should I do? You must change the disk! There is a pvmove in the logical volume management tool. This function can be implemented! The upper-layer lv is not affected. You can access data when the Administrator replaces the disk. Next I will simulate an Application Scenario: assuming there is a logical volume, the physical disk uses/dev/vdc, and the space size is 500 mb. Step: Use fdisk to directly partition the primary partition/dev/vdc1. Note: run partx-a/dev/vdc, partx-a/dev/vdd to create the logical volume: pvcreate/dev/vdc1 generate physical volume vgcreate vg0/dev/vdc1 create volume group lvcreate-L 400 M-n lv0 vg0 create logical volume mkfs. format ext4/dev/vg0/lv0 to ext4 file system mount/dev/vg0/lv0/mnt mount partition to directory cp/boot/*/mnt User Data Writing Time leap, ah, three years later, the disk service life is approaching, and I/O performance may have been expressed! To migrate a physical volume to another physical volume in the same volume group: pvcreate/dev/vdd1 generate the physical volume vgextend vg0/dev/vdd1 and add it to the subsequent volume group vg0 pvmove/dev/vdc1/dev/vdd1 to migrate data to the new physical volume vgreduce vg0/ dev/vdc1 Delete the physical volume from the volume group pvremove/dev/vdc1 Delete the physical volume and use fdisk to delete the trace! Detaching a disk can be processed at a low price! Note: The old disks must be repeatedly written to overwrite the old data, which may leak confidential information!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.