Managing disk quotas with fsdisk
What is Disk Quota?
Disk quota is a feature in Linux operating systems that allows system administrators to limit the amount of disk space that a user or group can use on a filesystem. This is useful for managing disk space usage on a system and preventing individual users from consuming too much disk space, which can lead to performance issues and storage capacity problems.
How to Enable Disk Quotas?
To enable disk quotas on a filesystem, you first need to make sure that the kernel supports disk quotas. You can check this by looking for the CONFIG_QUOTA option in your kernel configuration. If it’s not enabled, you will need to recompile your kernel with quota support.
Once you have confirmed that your kernel supports disk quotas, you can enable quotas on a filesystem by adding the «usrquota» and/or «grpquota» options to the filesystem entry in the /etc/fstab file. After making this change, you will need to remount the filesystem for the changes to take effect.
Managing Disk Quotas with fsdisk
Fsdisk is a command-line utility that is used to manage disk quotas on a Linux system. With fsdisk, you can set quotas for individual users or groups, track disk usage, and generate reports on disk space usage. Here are some common tasks that you can perform with fsdisk:
- Setting disk quotas for users and groups
- Enforcing disk quotas on a filesystem
- Checking disk usage and quota limits
- Generating reports on disk space usage
Examples of Using fsdisk
Here are some examples of how you can use fsdisk to manage disk quotas on a Linux system:
1. Setting disk quotas for a user: To set a disk quota for a specific user, you can use the «edquota» command followed by the username. This will open a text editor where you can set the quota limits for that user.
2. Enforcing disk quotas on a filesystem: To enforce disk quotas on a filesystem, you can use the «quotaon» command followed by the filesystem name. This will enable disk quotas on that filesystem.
3. Checking disk usage and quota limits: You can use the «quota» command to check the disk usage and quota limits for a specific user or group.
4. Generating reports on disk space usage: Fsdisk can generate reports on disk space usage using the «repquota» command. This will show you the disk usage and quota limits for all users and groups on a filesystem.