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

Setting method of disk quota under Redhat Linux system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "the setting method of disk quota under Redhat Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the setting method of disk quota under Redhat Linux system".

Quotas make it impossible for individual users and groups to occupy all the space of the partition. You can configure quotas by limiting the number of inode, where each inode is associated with a specific file, or you can set an absolute limit (number of KB).

By default, readhat installs and activates the quota rpm package. If you're not sure, you can run the command: rpm-Q quota.

Quotas are usually activated in the kernel.

To use quotas for specific users, there are six steps:

one. Modify / etc/fstab to activate quota options for the selected file system

two. Remount the file system for the changes to take effect

three. Create an aquota.user file at the beginning of the file system.

four. Scan the corresponding file system and generate basic quota files with the quotacheck command

five. Use the edquota command to impose quota restrictions on specific users

six. Finally, activate the quota with the quotaon command.

The following is an example of how to impose a disk quota limit on user test under / partition:

Modify / etc/fstab

# vi / etc/fstab, in

LABEL=/ / ext3 defaults 1 1 line activates the disk quota, and the modified result is as follows:

LABEL=/ / ext3 defaults,usrquota 1 1

After saving and exiting.

Remount the file system for the changes to take effect

Reactivation / etc/fstab change: # mount-o remount /

Create an aquota.user file

The easiest way to generate the aquota.user file under the / partition is to use the touch command:

Touch aquota.user, modify the permissions of the aquota.user file to allow only root users to access:

Chmod 600 aquota.user

Conduct a quota check

You can use the quotacheck-avum command to generate the appropriate quota file.

-a: scan for file systems that support quotas in / etc/fstab

-v: generate lengthy output

-u: check user quota

-m: remount the scanned file system

Set quotas on user test

Run the following command: edquota test

LABEL=/ / ext3 defaults,usrquota 1 1

Disk quotas for user test (uid 501):

Filesystem blocks soft hard inodes soft hard

/ dev/hda2 20 100000 0 6 00

~

Make inodes soft hard settings.

Enable quota

# quotaon / (quota setting for quotaoff / can be cancelled / partition)

At this point, the quota setting for test users for the / partition is complete.

You can copy the same restrictions to other users (kk tt) with the following command:

# edquota-up test kk tt

In addition, use the repquota command to monitor quota usage.

Undefinedundefined

At this point, I believe you have a deeper understanding of "the setting method of disk quota under the Redhat Linux system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Servers

Wechat

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

12
Report