Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Set disk quota in 5.Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Set disk quota

Summary

Execute in the kernel

Enable on a file system basis

Different policies for different groups or users

Restrict based on block or node

Enforce soft limits (soft limit)

Hard limit (hard limit)

Initialization

Partition mount options: usrquota, grpquota

Initialize the database: quotacheck

Execution

Enable or cancel quotas: quotaon, quotaoff

Edit quota directly: edquota username

Edit directly in shell:

Setquota usename 4096 5120 40 50 / foo

Define the original standard user

Edquota-p user1 user2

Report

User survey: quota

Quota Overview: repquota

Other tools: warnquota

The steps to achieve disk quota are as follows:

1. Enable quota mount option

Vim / etc/fstab usrquota,grpquota

two。 Create a quota database

Quotacheck-cug / home

Setenforce 0

3. Enable the database

Quotaon-p / home to see if the database is enabled

Quotaon / home enable database

4. Set quota entry

Edquota wang

Edquota-p wang mage

Setquota tom 100000 150000 00 / home

5. Test

Quota wang

Repquota / home

Dd

Examples are as follows:

It is best to create a partition before operation, then format it, and then mount it to the home directory under the root, so that the home directory is independent on a partition.

1) enable disk quota mount option

Execute mount-o remount to take effect again

2) create a quota database

3) enable the database

Quotaon-p to see if the database is enabled

Quotaon enables the database

Quotaoff disables database

4) set quota entry

Edquota username

Edquota-p username1 username2 (copy quota information for user 1 to user 2)

Setting quota information in non-interactive environment with setquota command

5) Test

Use the quota command and requota command to view

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report