Case study: LVM volume management and quota setup
Experimental environment: The company is ready to build a mail server (REHL5 system platform) in the Internet, providing e-mail space for employees and some VIPK customers across the country. Plan to add two SCSI hard drives and build LVM logical volumes to hold mail data, given the need for dynamic scaling and limit the user's mailbox space by disk quotas.
Requirements Description: Using LVM Disk Management scheme
Set up and enable disk quotas
Recommended steps:
1 adding disk devices and establishing a LLVM Disk Management scheme
Add two SCSI HDD devices and complete hard drive detection and partitioning
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image002 "border=" 0 "alt=" clip_image002 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiom1zpggqjbo7uaaa1bn8zdoa932.jpg "" 244 "height=" 131 "/>
FDISK/DEV/SDB: Access to interactive partition interface
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image004 "border=" 0 "alt=" clip_image004 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiom1zpgguxyjusaaahytt18vy792.jpg "" 244 "height="/>
N: New partition P: List disk partition condition T: Change partition type w: Save partition operation
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image006 "border=" 0 "alt=" clip_image006 "src=" http://s3.51cto.com/wyfs02/M02/77/8B/ Wkiol1zpggyqdu0iaaawca2yeis065.jpg "244" height= "/>650" this.width=650; "style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image008 "border=" 0 "alt=" clip_image008 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiom1zpgg2gobscaaafcq3vtxi193.jpg "244" height= "/>650) this.width=650; style=" Background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image009 "border=" 0 "alt=" clip_image009 "src=" http://s3.51cto.com/wyfs02/M00/77/8B/ WKioL1Zpgg6ihma5aaamad75ugy175.jpg "" 244 "height="/>
And so on, complete the/DEV/SDC partition
Partprobe: Enables the operating system to detect a new partition table condition (after changing the partition settings of the disk, it is advisable to restart the system or perform "Partprobe/dev/sdb")
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image011 "border=" 0 "alt=" clip_image011 "src=" http://s3.51cto.com/wyfs02/M02/77/8B/ Wkiol1zpghgrm76vaaahywnijeg649.jpg "" 244 "height="/>
Fdisk–l: Can be viewed. Confirm the device name and location of the new drive
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image013 "border=" 0 "alt=" clip_image013 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiom1zpghkhkjjaaaapjfjt224093.jpg "" 244 "height=" 98 "/>
Convert/DEV/SDB1 and/DEV/SDC1 oh partitions to physical volumes
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image015 "border=" 0 "alt=" clip_image015 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiom1zpghorrbbhaaarkbozxpe616.jpg "" 244 "height=" "/>
Consolidate two physical volumes to create a volume group named Mail_store
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image016 "border=" 0 "alt=" clip_image016 "src=" http://s3.51cto.com/wyfs02/M00/77/8B/ Wkiol1zpghtzsfhxaaamuilduls155.jpg "" 244 "height="/> Create a logical volume named Mbox in the Mail_store volume group, set the capacity (set as needed)
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image018 "border=" 0 "alt=" clip_image018 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiom1zpghtywgsaaaai4uxrtia124.jpg "" 244 "height="/>
Use the MKFS command to format the logical volume MBOX, create the EXT3 file system, and mount it to the/mailbox directory
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image020 "border=" 0 "alt=" clip_image020 "src=" http://s3.51cto.com/wyfs02/M01/77/8B/ Wkiol1zpghtwrzo1aaajtt0xvdy714.jpg "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image022 "border=" 0 "alt=" clip_image022 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiom1zpghxsoi-haaamtody9k0727.jpg "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image024 "border=" 0 "alt=" clip_image024 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiom1zpghxzhsg4aaaijypxjam317.jpg "" 244 "height="/>
2 Adding quota support
In the REHL5 system, the kernel has a disk quota function for the Linux file system, and the quota package is installed by default in the system
Confirm the installation of the quota package, and the list to view the Quota Manager program for the quota package installation
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image026 "border=" 0 "alt=" clip_image026 "src=" http://s3.51cto.com/wyfs02/M02/77/8B/ Wkiol1zpghbd-8swaaale7thwou123.jpg "244" height= "/>650" this.width=650; "style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image028 "border=" 0 "alt=" clip_image028 "src=" http://s3.51cto.com/wyfs02/M00/77/8B/ Wkiol1zpghbt_ji8aaajg7zmpqw519.jpg "" 244 "height="/>
Modify mount settings in the Etc/fstab file, add usrquota grpquota parameters
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image030 "border=" 0 "alt=" clip_image030 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiom1zpgheh6tb-aaaivbtl5yc927.jpg "244" height= "/>650" this.width=650; "style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image032 "border=" 0 "alt=" clip_image032 "src=" http://s3.51cto.com/wyfs02/M01/77/8B/ Wkiol1zpghfhgnhyaaai4syow5q130.jpg "" 244 "height="/>
Re-mount the logical volume MBOX to the mailbox directory, adding Usrquota Grpquota quota support
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image034 "border=" 0 "alt=" clip_image034 "src=" http://s3.51cto.com/wyfs02/M02/77/8C/ Wkiom1zpghit6sveaaafr8domou198.jpg "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image036 "border=" 0 "alt=" clip_image036 "src=" http://s3.51cto.com/wyfs02/M01/77/8C/ Wkiom1zpghmtkwduaaakmdmn08g056.jpg "" 244 "height="/>
Using the Quotasheck command to establish quota support in the/mailbox file system
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image038 "border=" 0 "alt=" clip_image038 "src=" http://s3.51cto.com/wyfs02/M00/77/8C/ Wkiom1zpghnjyhriaaajm6demja792.jpg "" 244 "height="/>
3 Set up and enable disk quotas
Set disk quotas for Terry users and ACCP groups using the Edquota command
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image040 "border=" 0 "alt=" clip_image040 "src=" http://s3.51cto.com/wyfs02/M00/77/8B/ Wkiol1zpghqz7nesaaajsx3loge966.jpg "" 244 "height="/>
Compiling quotas for user Terry
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image041 "border=" 0 "alt=" clip_image041 "src=" http://s3.51cto.com/wyfs02/M01/77/8B/ Wkiol1zpghrrnwooaaaidbqbqxu067.jpg "" 244 "height=" one "/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image043 "border=" 0 "alt=" clip_image043 "src=" http://s3.51cto.com/wyfs02/M00/77/8D/ Wkiom1zpghvzautmaaaj5jps9fo687.jpg "" 244 "height="/>
Compiling the ACCP Group
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image045 "border=" 0 "alt=" clip_image045 "src=" http://s3.51cto.com/wyfs02/M01/77/8D/ Wkiom1zpghzxleyraaaiavvick8521.jpg "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image047 "border=" 0 "alt=" clip_image047 "src=" http://s3.51cto.com/wyfs02/M00/77/8B/ Wkiol1zpgh3x2u0zaaak-9zivfy095.jpg "" 244 "height="/>
Use the quota command to enable the disk quotas feature
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image049 "border=" 0 "alt=" clip_image049 "src=" http://s3.51cto.com/wyfs02/M01/77/8D/ Wkiom1zpgh2xe8piaaaolxnqa9a015.jpg "" 244 "height="/>
4 Verifying the disk quotas feature
Switch to the/mailbox directory using the user account login system in the Jerry User ACCP group and use the DD command to verify the quota function
Testing with the DD conversion tool
The DD command is a device conversion and replication command
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image051 "border=" 0 "alt=" clip_image051 "src=" http://s3.51cto.com/wyfs02/M00/77/8D/ Wkiom1zpgh2cluauaaao8q0mtv8122.jpg "244" height= "/>650" this.width=650; "style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image052 "border=" 0 "alt=" clip_image052 "src=" http://s3.51cto.com/wyfs02/M02/77/8B/ Wkiol1zpgh6aywjwaaalsumiggm298.jpg "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image053 "border=" 0 "alt=" clip_image053 "src=" http://s3.51cto.com/wyfs02/M00/77/8B/ Wkiol1zpgh_w7ycvaaakqhkzcps190.jpg "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image055 "border=" 0 "alt=" clip_image055 "src=" http://s3.51cto.com/wyfs02/M01/77/8B/ Wkiol1zpgh_xhgttaaakdzgsivc569.jpg "" 244 "height="/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image056 "border=" 0 "alt=" clip_image056 "src=" http://s3.51cto.com/wyfs02/M02/77/8B/ Wkiol1zpgidhzie4aaallagdw9c098.jpg "244" height= "/>650" this.width=650; "style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image058 "border=" 0 "alt=" clip_image058 "src=" http://s3.51cto.com/wyfs02/M02/77/8B/ Wkiol1zpgidjpht0aaajybyt2jy595.jpg "244" height= "/>650" this.width=650; "style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image059 "border=" 0 "alt=" clip_image059 "src=" http://s3.51cto.com/wyfs02/M01/77/8D/ WKiom1Zpgihtdfpwaaaka1opxsm308.jpg "244" height= "/>650" this.width=650; "style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image061 "border=" 0 "alt=" clip_image061 "src=" http://s3.51cto.com/wyfs02/M02/77/8D/ Wkiom1zpgigccud6aaajokmhcow960.jpg "" 244 "height="/>
Use the Requota command to view disk quota usage for the/mailbox file system
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" clip_image063 "border=" 0 "alt=" clip_image063 "src=" http://s3.51cto.com/wyfs02/M01/77/8B/ Wkiol1zpgiwa2ymcaaaisz-hww0136.jpg "" 244 "height="/>
LVM volume management and quota settings