19: linux Performance Optimization: advanced lvm usage

Source: Internet
Author: User
Linux performance optimization 19: lvm advanced usage 18: linux Performance Optimization 18: lvm is recommended http://www.2cto.com/os/201307/231381.html The above section introduces the logical volume management technology. we all know that it has advantages over traditional disk management. here I have an article about l... linux performance optimization 19: lvm advanced usage 18: linux Performance Optimization 18: lvm is recommended http://www.2cto.com/os/201307/231381.html The above section introduces the "logical volume" management technology. we all know its advantages over traditional disk management. here I have a manual "lvm HOWTO" on LVM management ", most of them are 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!
Related Article

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.