Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Use the setquota command using a loop over user names:
Code:
for name in user0 user1 user2 user3
do
setquota -u $name W X Y Z filesystem
done
where W, X, Y, Z are the block-softlimit, the block-hardlimit, the inode-softlimit and the inode-hardlimit respectively. filesystem is the actual filesystem with quota. Then turn quotas on using the quotaon command.
Have you a list of them? Or can you retrieve all of them with a simple command?
If they are in a list (one username per line) just do
Code:
while read name
do
setquota -u $name W X Y Z filesystem
done < namelist.txt
if you can retrieve them using a command, just do
Code:
for name in $(some_command)
do
setquota -u $name W X Y Z filesystem
done
I should be able to generate a list from the passwd file easily enough.
So the only variables in that code I need to replace are W X Y Z and filesystem?
The size values are specified in bytes I guess. What is a reasonable number of inodes for a 120 GB partition? And filesystem refers to a partition? How do I specify it by device id? Like /dev/sdc1
fstab should contain mount args usrquota (and grpquota if you need it) and they'll be used when the FSes are mounted. Since fstab takes quota args it seems reasonable to expect mountpoints, not devicenames. Take into account users don't have any business in say /boot, /usr (unless your perception of filesystems is severely skewed) so you could focus on areas where they do like /home and /var (mailspools and such). You could use the values of one "average" user to come up with "average" values for XYZ. One lame quck way to initialise quota (to get some values) could be to run 'quotacheck -cugamMf' but YMMV(VM).
Thanks very much. With your help and this page, I was able to reign in the singular user that caused the problem. On Monday I will use a script to get the rest: http://www.yolinux.com/TUTORIALS/Lin...ialQuotas.html
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.