< training | 12th Day > Dynamic expansion of Linux partitions with LVM

Source: Internet
Author: User

[[Email protected]~]# Preface ]
In Linux, we usually have the means to install the software, you know?
In Linux, if you don't have enough disk space, do you know how to extend the disk?
Dynamic expansion is a very important skill not only in work but also in other aspects, so learning it is very helpful to you.

The 12th day of the classes:

[Email protected]~] #今天的课程大纲1. How and how to install software in Linux Systems 2. How the LVM Disk Management mechanism works 3. How to use LVM to manage Disk 4. Methods of dynamic Expansion 5. Benefits of using LVM    

Detailed Explanation:

[Email protected]~]# theway and the way to install software in a Linux system
Honestly, Linux has fewer entertainment software, but technical software is never worse than Windows.
So how do we find the software we need in Linux? So let me introduce a few ways.
    1. Redhat official (see what distribution you use)

    2. Software official, you want to get what software, go to the official website to find

    3. Third party: The full name of Epel,epel is called Extra Packages for Enterprise Linux. Epel is a project built by the Fedora community to deliver high-quality software packages for RHEL and derivative distributions such as CentOS, scientific Linux, and more. After the Epel is loaded, it is equivalent to adding a third-party source. Note is the source.

    4. If the software does not meet your requirements, then make it yourself, in fact, their production is not difficult, later I will how to make their own software.

[[Email protected]~]#The principle of LVM Disk Management mechanism

What a VM is, it's a disk management mechanism, here you only need three things: PV physical volume, VG Volume group, LV logical volume. Principle, is a physical disk, you can convert it to a PV, and a PV can be built on more than one VG, a VG can be divided into several lv. LVM allows us to better determine the size of each partition to determine how much physical space is allocated. After the normal partition of the disk is good, it cannot be changed, this is OK. So there will be dynamic expansion later.

[[Email protected]~]# How to use LVM to manage disks
First I have a physical disk,/dev/sdb, 2G in size, I have created partition/dev/sdb1 on it, and now we are using LVM to manage it.
1. Direct execution of PVCREATE/DEV/SDB1

2. We create a volume group of vgmap:vgcreate VGMAP/DEV/SDB1
3. We create two lv,lvmapone sizes for the Vgmpa volume Group for the remaining 1g,lvmaptwo size.
Lvcreate-n lvmapone-l 1G Vgmap.

4. Create a file system for two lv, then mount it for use.

[[E-mail protected]~]# Dynamic expansion Method
Dynamic expansion, I think a better understanding of a word is "online expansion", meaning that without unloading the disk, the disk is still in use, we can increase the capacity of the disk. There are two ways to expand, one is the VG has the remaining space, the other is to add a new disk directly, the volume group name is created as a volume group of insufficient capacity. Here I demonstrate for the convenience of the VG and the rest of the space, I deleted the Lvmaptwo this LV, and now vgmap the remaining space is 1020M.

1. Remember a sequence, the first expansion of LV, in the expansion of the file system, the reason is very simple, you first expand the file system, then you expand the file system to put there (a reason, the anti-reverse on the line) 2. Use Lvextend to expand the size of the LV lvextend-l +1020m/dev/ Vgmap/lvmapone or Lvextend-l +100%free/dev/vgmap/lvmapone 3. Reset the file system size to make it as big as LV use command resize2fs/dev/vgmap/lvmapone, everyone, I did not uninstall Lvmapone, but the capacity has increased
[[Email protected]~]# Benefits of using LVM
1. Dynamic expansion and online expansion, without unloading the partition to increase capacity, convenient and fast.
2. Simple ... It's quite simple to tell the truth.
3. You can combine multiple disks together so you don't have to worry about buying a large disk.
4. Snapshot, and so on when the IO is not busy can be backup, convenient.


[Email protected]~]# from an IT man who loves his wife:
Today we mainly learn the way of software installation, we can customize our own packages in the future.
Dynamic expansion, now many companies will let the operations engineer master a skill, so, learn to not be wrong.
Blog Park: Love family love wife's it male QQ Group: Public Number: program ape Wild Banana "get the tool that appears in the article"

< training | 12th Day > Dynamic expansion of Linux partitions with LVM

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.