First of all, make sure your centos have quota.
One more thing is to shut down SELinux.
。
First type the command sestatus-v
You can see if SELinux is open.
If you open this.
Can Vim/etc/selinux/config
Change into selinux=disabled
Restart CentOS
First, we add a section first. Sdc1
Format into ext3 file format.
We can see SDC this hard drive we haven't partitioned yet.
Here we would like to divide a district for convenience.
This will be divided into the area, now formatted into the Ext3 file system.
Then create a directory and hang the partition that you just formatted and open the file quota, and set the automatic mount (open file quota is to add Usrquota,grpquota when mount the two parameters, one on behalf of the user quota, a delegate group quota)
Type Mkdir/helloworld
Create a HelloWorld folder as a mount point
Mount-o Grpquota,usrquota/dev/sdc1/helloworld
Mount | grep Grpquota,usrquota/dev/sdc1/helloworld
Type Vim/etc/fstab
Add the following record
/dev/sdc1/helloworld ext3 Defaults,grpquota,usrquota 0 0
So that the SDC1 partition can be mounted automatically on the boot.
Create a quota file.
Type the following command
Quotacheck-ucvg/dev/sdc1
Typing the following command to view
Ls/helloworld
Create a quota for user user1 that will alert you to a limit of 10M, more than 7M, and view
The command to view is Edquota-u user1
And then enable this quota
Type the following command QUOTAON/DEV/SDC1
* Note that we are here to note that the/helloworld folder is created by the root user and involves permission issues.
So type the following command so that User1 users can write data in the previous folder
chmod 777/helloworld
chmod 777/DEV/SDC1