Get the App
SLTechnology News&Howtos  ›  Network Security  › 

LVM volume management and quota setting

Shulou Source: shulou.com Published: 2022-06-01 01:56:52 10月04日 Update

Experimental case: LVM volume management and quota setting

Experimental environment: the company is going to build a mail server (REHL5 system platform) in Internet to provide email space for employees and some VIPK customers all over the country. Considering the need of dynamic expansion, it is planned to add two SCSI hard drives and build LVM logical volumes to store mail data, and limit users' mailbox space by disk quota.

Requirement description: using LVM disk management solution

Set and enable disk quotas

Recommended steps:

1 add disk devices and establish LLVM disk management scheme

Add two SCSI hard disk devices and complete hard disk detection and partition

Fdisk / dev/sdb: can enter the interactive zoning interface

N: new partition p: list disk partition t: change partition type w: save partition operation

And so on, complete the / dev/sdc partition

Partprobe: make the operating system detect the new partition table (after changing the partition settings of the disk, it is recommended that you restart the system or execute "partprobe / dev/sdb")

Fdisk-l: can be viewed. Confirm the device name and location of the new hard drive

Convert / dev/sdb1 and / dev/sdc1 Oh partitions to physical volumes

Consolidate the two physical volumes to create a volume group named mail_store

Create a logical volume named mbox in the mail_store volume group and set the capacity (as needed)

Use the mkfs command to format the logical volume mbox, create an EXT3 file system, and mount it to the / mailbox directory

2 add quota support

In the REHL5 system, the kernel has customized the disk quota function of the linux file system, and the quota package is installed by default in the system.

Confirm the installation of the quota package and list the quota management programs installed by the quota package

Modify the mount settings in the etc/fstab file and add usrquota grpquota parameters

Re-mount the logical volume mbox to the mailbox directory and add usrquota grpquota quota support

Use the quotasheck command to establish quota support in the / mailbox file system

3 set and enable disk quotas

Use the edquota command to set disk quotas for terry users and accp groups

Compile the quota for user terry

Compile the accp group

Use the quota command to enable disk quotas

4 verify disk quota function

Log in to the / mailbox directory using the user account in the jerry user accp group, and use the dd command to verify the quota function

Test using the dd conversion tool

The Dd command is a device conversion and copy command

Use the requota command to view the disk quota usage of the / mailbox file system

Tags: Quotas disks systems commands files users management functions situations hard drives devices logic directories software packages support scenarios physics space mail Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple MySQL MariaDB Huawei Shulou Information