New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Enable user quotas on B3

A collection of tips on howto tweak your Bubba.
Post Reply
anhtuan445
Posts: 11
Joined: 06 Nov 2010, 15:44

Enable user quotas on B3

Post by anhtuan445 »

NOTE: The kernel and modules used here are not fully tested so use at your own risk!

This small guide will help you get user quotas running on your B3.

This is the steps I took on B3 to get user quotas working. It might be missing some small thing as it took a lot of testing to get it. Feel free to comment on steps missing or clarifications needed.

1. Download files from - http://b3.update.excito.org/test/ .I used wget to download the kernel and module files.

Code: Select all

	wget filename
2. Install the packages manually -

Code: Select all

	dpkg -i  bubba3-kernel_2.6.35.8-1.armel.deb  bubba3-modules_2.6.35.8-1.armel.deb
3. Restart

4. Add quota support to mounted partition (I'm using journaled quota v2)
Open fstab and add ,usrjquota=aquota.user,jqfmt=vfsv0 to /home partition

Code: Select all

	vi /etc/fstab
The line should look like this

Code: Select all

    ..
    /dev/mapper/bubba-storage       /home   ext3    defaults,usrjquota=aquota.user,jqfmt=vfsv0      0       2
    ..
5. Remount the partition (restart will do it also)

Code: Select all

	mount -o remount /home
6. Check with "mount" if the partiton was mounted correctly. In my example -

Code: Select all

	..
	/dev/mapper/bubba-storage on /home type ext3 (rw,usrjquota=aquota.user,jqfmt=vfsv0)
	..
7. Add quota support to kernel modules

Code: Select all

	modprobe quota_v2
	echo 'quota_v2' >> /etc/modules
8. Restart

9. Check "lsmod" and find -

Code: Select all

	..
	quota_v2                3461  0
	..
If you find it then the module loading was successful.

10. Create aquota files

Code: Select all

	touch /home/aquota.user
	chmod 644 /home/aquota.user
I'm using 644 instead of 600 because users can see their usage thatway.
11. Install quota (might be installed already but just to be sure)

Code: Select all

	apt-get install quota quotatool
12. Run quotacheck

Code: Select all

	quotacheck -vcum /home
You should get something like this

Code: Select all

	quotacheck: Scanning /dev/mapper/bubba-storage [/home] done
	quotacheck: Old group file not found. Usage will not be substracted.
	quotacheck: Checked 19 directories and 16 files
Wait for the scan to complete.
13. Turn the qouta on

Code: Select all

	quotaon /home
14. Use repquota (repquota -a for example) to check the current usage.

15. Now your done - quotas are working. Next step is to configure the usage limits.

16. You can use quotatool to set user quota limits. The example will set limit for user marten, using 15Mb for soft and 20Mb for hard limit on /home partition.

Code: Select all

    quotatool -u marten -bq 15M -l "20 Mb" /home
This should cover it :)
If you have any questions or comments please leave them here and I'll be happy to help.

Marten
Post Reply