Implementation of LVM Logical volume management and disk quotas in Linux systems

Source: Internet
Author: User

LVM (Logical Volume Manager) is a logical mechanism for managing disk partitions in a Linux system, a logical layer built on disk and partition, capable of dynamically adjusting disk capacity while keeping existing data intact, thus increasing the flexibility of disk Management.

1. 执行命令 fdisk -l 来查看硬盘的设备名称及位置,此处添加了两块各为20G大小的硬盘

2. 执行命令 fdisk /dev/sdb 划分分区,并更改分区类型为LVM

3.  以上为硬盘sdb的设置,继续按照上步骤设置硬盘sdc

4. 将sdb1和sdc1转换成物理卷: pvcreate /dev/sdb1 dev/sdc1

5. 将两个物理卷创建为一个名为yun的卷组:vgcreate /dev/sdb1 /dev/sdc1

6. 从卷组yun中分隔空间,创建新的逻辑卷yun01,分配容量10G:lvcreate -L 10G -n yun01 yun

7. 格式化逻辑卷yun01 mkfs.ext4 /dev/yun/yun01,并创建挂载点

8. vim进入/etc/fstab设置自动挂载,用quota软件对逻辑卷yun01设置用户和组的配额:

9. 重新启动挂载,setenforce 0关闭selinux防火墙

10. 使用quotacheck -ugcv /dev/yun/yun01为yun01创建配额文件

11. 使用`edquota -u wzn`对用户wzn设置配额,参数为所示

12. 开启逻辑卷yun01的配额:quota -ugv /yun01
13. 登录wzn 用户,对这次配额进行验证,至此配额成功。

Implementation of LVM Logical volume management and disk quotas in Linux systems

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.