![]() There are a few ways we can set quotas for users or groups. Our server is now monitoring and enforcing quotas, but we’ve not set any yet! Next we’ll set a disk quota for a single user. Now we’re ready to turn on the quota system: sudo quotaon -v / If you didn’t include the u or g options in the quotacheck command, the corresponding file will be missing. Output oup bin dev home lib64 media opt root sbin srv tmp var vmlinuz.oldĪer boot etc initrd.img lib lost+found mnt proc run snap sys usr vmlinuz We can verify that the appropriate files were created by listing the root directory: ls / If you don’t need to enable user- or group-based quotas, you can leave off the corresponding quotacheck option. Remounting the filesystem as read-only will give more accurate results in case a user is actively saving files during the process, but is not necessary during this initial setup. ![]() m: disables remounting the filesystem as read-only while performing the initial tallying of quotas.g: indicates that a group-based quota file should be created.u: specifies that a user-based quota file should be created.The quotacheck parameters we’ve used are: ![]() These files contain information about the limits and usage of the filesystem, and they need to exist before we turn on quota monitoring. This command creates the files /er and /oup. Step 4 – Enabling Quotasīefore finally turning on the quota system, we need to manually run the quotacheck command once: sudo quotacheck -ugm / Now that we’ve installed our tools and updated our filesystem options, we can turn on the quota system. Output/dev/vda1 / ext4 rw,relatime,quota, usrquota, grpquota,data=ordered 0 0 This file’s contents will be similar to the following: Open that file in your favorite text editor now: sudo nano /etc/fstab We do this by updating the filesystem’s entry in the /etc/fstab configuration file. To activate quotas on a particular filesystem, we need to mount it with a few quota-related options specified. Step 3 – Updating Filesystem Mount Options Next we will update our filesystem’s mount options to enable quotas on our root filesystem. Run the previous find command again to verify that the installation was successful. This will provide the kernel modules necessary for implementing quotas. If you get no output from the above command, install the linux-image-extra-virtual package: sudo apt install linux-image-extra-virtual Your kernel version – highlighted in the file paths above – will likely be different, but as long as the two modules are listed, you’re all set and can skip the rest of this step. Output/lib/modules/ 4.15.0-45-generic/kernel/fs/quota/quota_v1.ko
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |