How Can We Help?
< All Topics
Print

Managing Disk Usage: A Guide to Enabling Disk Quota on Your VPS

Disk quota is a restriction in Linux systems that limits the storage capacity of each user and prevents them from overflowing the entire file system, thus improving the performance of the system.

a) Linux

Disk Quota

1. First, enter the sudo apt-get update command to update the package information index.

2. Then, use the sudo apt-get install -y quota command to install the quota utility, and use the dpkg -l | grep quota command to verify that the package was successfully installed.

3. Afterwards, use the sudo nano /etc/fstab command to instruct fstab to use the quota system by opening the nano text editor.

4. Next, enter usrquota in the fourth option of the entry as follows: UUID=0147b37e-c5d2-4bab-a04b-4edbb5a6501d/ext4Errors=remount-ro,usrquota 0 1.

5. Then, press CTRL+X, Y, and Enter to save the file. Next, enter the sudo mount -o remount / command to remount the partition so that the system can pick up the changes.

6. If aquota.user doesn’t exist in the system, use sudo quotacheck -ucm /commmand and verify it’s created in the root directory using the ls -ls command.

7. Then, enter the sudo setquota -u [username] [floppy disk limit] [hard disk limit] [soft inode limit] [hard inode limit] [partition] command to set the user disk space limit on the file system, like this: sudo setquota -u francis 5GB 6GB 0 0 /.

8. Finally, the sudo quota -vs [username] command is used to confirm that restrictions have been set for the user.

b) Windows

1. First, open Windows Explorer and select This PC.

2. Then, right-click the drive on which you want to enable quotas and select Properties.

3. Next, under Properties, select the Quotas tab and check the box next to Enable quota management.

4. After that, check the box next to “Deny disk space to users exceeding quota limit”.

5. Then, select the radio button Limit disk space. (This will allow setting the disk limit and warning level.) And select a value and select KB, MB, or GB from the drop-down list as per the requirement.

6. Finally, click Apply and restart your computer.

Disk quota for specific users

1. First, open Windows Explorer and select This PC.

2. Then, right-click the drive on which you want to enable quotas and select Properties.

3. After that, under Properties, select the Quotas tab and tick the box next to it to enable quota management.

4. Next, check the box next to “Deny disk space allocation to users who exceed quota limits“.

5. Then, click the radio button to limit disk space, select a value from the drop-down list, and click Apply to set the disk limit and warning level.

6. Next, click the Quota Entries button.

7. When the Quota Entries window opens, select Quotas in the upper left corner and click New Quota Entry.

8. After that, enter the username you want to search for and click on “Check Names“, and then click on the “OK” button.

9. Then, click the “Limit Disk Space” radio button and select a value from the drop-down list, such as KB, MB, or GB, to set disk limits and warning levels to apply quotas.

10. After that, select the required value and click on the OK button.

11. Finally, the specified user is granted a new quota.

Table of Contents