Debian quota install




















Our user sammy is listed at the bottom, with the amounts used and soft and hard limits. Also note the Block grace time: 7days callout, and the grace column. If our user was over the soft limit, the grace column would show how much time they had left to get back under the limit.

We can configure the period of time where a user is allowed to float above the soft limit. We use the setquota command to do so:. The above command sets both the block and inode grace times to seconds, or 10 days. The following are some common errors you may see when setting up and manipulating filesystem quotas.

This is an error you might see if you tried to turn on quotas using quotaon before running the initial quotacheck command. The quotacheck command creates the aquota or quota files needed to turn on the quota system.

See Step 3 for more information. You or your system administrator will need to adjust the file permissions appropriately, or use sudo when running commands that require access to the quota file. Where would you like to share this to? Twitter Reddit Hacker News Facebook.

Share link Tutorial share link. Sign Up. DigitalOcean home. Community Control Panel. Hacktoberfest Contribute to Open Source. Not using Debian 9? Choose a different version or distribution. Debian 9. Introduction Quotas are used to limit the amount of disk space a user or group can use on a filesystem. Prerequisites This tutorial assumes you are logged into a Debian 9 server, with a non-root, sudo-enabled user, as described in Initial Server Setup with Debian 9.

Step 1 — Installing the Quota Tools To set and check quotas, we first need to install the quota command line tools using apt. About the authors. To enable both user and group quota, use the usrquota,grpquota option. If you just want to try out quota, then you can use the mount command to temporarily enable quota on a filesystem. To ready the filesystem for quota, you have to run the quotacheck command on each of the filesystems you want to use quota.

To do that, initialize quota as follows:. As you can see, the quota is turned on. If for some reason, you decide to turn off quota, then you can do so with the following command:. To do that, run the following command:. You should see the following window. Here are some terms that you should know.

Filesystem : It is the disk partition where this quota is to be applied. Blocks : This is the amount of disk space in blocks the user bob can use.

You have to convert MB or GB unit to the equivalent block size and use the block size here. Inode : It is the number of files you can create in a filesystem. The "grace" field corresponds to the number of grace days remaining before the user is locked out of their account. The user has until that time to reduce their quota to below the "soft" level.

You can use the edquota command to edit user and group quotas. The "blocks" and "inodes" fields cannot be edited, they are there for information purposes only. However, you can edit the soft and hard fields. The first pair refer to blocks, and the second to inodes. For our example, let's set the "student" quota so that the user has 8MB of disk space available, and can use an extra 2MB temporarily if required.

Once you've made the changes, you can save and exit. The edquota utility will complain if it doesn't like the values that you've given. Unlike repquota and edquota , which only the root user can make use of, the quota command is available to all users, and it allows them to query their current quota information. The root user may optionally specify the username of a user in order to check their quota:. If you log in as the "student" account, you should be able to use quota to check your disk usage:.

The optional "-q" switch tells quota not to output anything unless the user has exceeded their quota limits:. That way, whenever a user logs in, they will be presented with a summary of the disk usage information, but only if they are over quota. Let's test and see if our quota system works. We'll use the dd command to create a 9MB file as the "student" user:. This shows us that we've exceeded our soft quota, and have 6 days in which to reduce the amount of space that we're using.

If we were to attempt to create another file slightly larger than 1MB, and thus exceed our hard limit, we would receive an "out of disk space" error message. Debian and disk quotas: Chapter 5. User Information and Administration. Debian and disk quotas:.



0コメント

  • 1000 / 1000