 |
 |
Setting Disc Quotas?
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2002
Location: Japan
Status:
Offline
|
|
Anyone who is using Panther, is there any way to restrict disc space for users with Panther? I have multiple users on my imac and want to limit their amount of disc space, without having to partition my HD for each user. As this is a pain in the ass and seems useless?
Cheers,
Bill
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status:
Offline
|
|
Not natively.
You can try this project, though. It's a Perl script that runs via your crontab, checks home folder sizes, and makes read-only accounts that go over.
If you're handy with scripting it'd be easy to home-brew something, too; say, make a list of users and their limits:
user____ soft_______hard
default__512_______768
joe______768______1024
superman -
baby_____96______128
then run a crontab that checks the size of the home folder against that list. If a user goes over the soft limit, call Applesript to pop up a warning. If the user goes over the hard limit, make the account read-only.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Location: Sydney, Australia
Status:
Offline
|
|
Originally posted by wrwjpn:
Anyone who is using Panther, is there any way to restrict disc space for users with Panther? I have multiple users on my imac and want to limit their amount of disc space, without having to partition my HD for each user. As this is a pain in the ass and seems useless?
Cheers,
Bill
I don't have panther  but as Mac OS X is based on netBSD, I would expect that quotas would work like bsd quotas. A short check in google found the following at http://www.mreriksson.net/faqs/netbsd/#Q2.
To enable disk quotas you need to go trough the following steps:
1) Add the userquota option to the entries representing the filesystems you would like to add quota support for (/home for example). By default, this will add a file called quota.user to the root of the filesystems with quotas enabled, which contains information about the amouth of data each user can store. The location of this file can be changed using an equal sign after userquotas and the path to where you would like the file to be located (Including the filename itselfe).
Examples:
/dev/wd0f /home ffs rw,userquota 1 2
or
/dev/wd0f /home ffs rw,userquota=/var/quotas/home.user 1 2
Next, you should execute the 'quotacheck -a' command. This will scan trough all your filesystems with quotas enabled and build a database of the diskspace allocated by each user.
If you wish to do this without rebooting, you should probably execute 'quotaon -a', this will enable the quota system for all entries in /etc/fstab with the user or groupquota option.
Editing the quotas
To edit the limits for a user, use the edquota(8) command like this:
edquota myuser
Where myuser is the name of the user you wish to edit the limitations for. This will open a file for editation that looks something like this:
Quotas for user myuser:
/usr: blocks in use: 1948, limits (soft = 13000, hard = 15000)
inodes in use: 21, limits (soft = 0, hard = 0)
To change the limits, you whould edit the soft and hard block limits. The user can go over the soft limit on temporary basis, but when reaching the hard limit, the system won't allow the user to write any more data to the filesystem.
You should probably never need to use the inode limits, so just set them to zero to disable them.
This may work, but I haven't tested this so use at your own risk.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: ~/
Status:
Offline
|
|
The file system level quotas might work, running apropos quota finds man pages for several quota tools. The quota tools are either residing in /sbin or /usr/sbin meaning they're stock OSX programs. Disk quotas were introduce in BSD 4.2 afterall.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status:
Offline
|
|
Ah, indeed, they must have added the quota programs in Jaguar. THanks tek and gray.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2002
Location: Japan
Status:
Offline
|
|
Thanks,
I will check your ideas and get back to let you know how it went.
Cheers,
Bill
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Location: Sydney, Australia
Status:
Offline
|
|
Originally posted by wrwjpn:
Thanks,
I will check your ideas and get back to let you know how it went.
Cheers,
Bill
Cool, you have me all curious about whether this works now !
|
|
|
| |
|
|
|
 |
|
 |
|
Banned
Join Date: Sep 2000
Location: Fightclub
Status:
Offline
|
|
Originally posted by teknologika:
I don't have panther but as Mac OS X is based on netBSD, I would expect that quotas would work like bsd quotas.
WRONG again!
FreeBSD, you idiot, NOT NetBSD.
Get your facts straight; and to others reading this thread, beware of advice from people who can't even get the most elementary facts correct.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: ~/
Status:
Offline
|
|
That was a bit uncalled for.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2002
Location: Japan
Status:
Offline
|
|
I tried to get this working according to the set up that was posted by teknologika, but I kept getting errors about filesystem not in fstab. I tried to find the file fstab in /etc but it wasn't there. I tried to locate it with the locate command but it couldn't find it. I updated my locate database and tried to locate again but still it wasn't able to find any fstab file. Is there any way to make one and if so how to I format it:
ex.
/dev/hd0 rw 1 1
/dev/hd1 rw 1 2
something like this?
Any help would be greatly appreciated.
Bill
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Location: Sydney, Australia
Status:
Offline
|
|
Public Apology: I would like to formally apologize for getting the type of BSD incorrect whilst posting to this forum and trying to actual help someone solve a problem. I will NEVER offer information without verifying it from three independent sources before posting again. 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Apr 2003
Location: The City Of Diamonds
Status:
Offline
|
|
Originally posted by eno:
WRONG again!
FreeBSD, you idiot, NOT NetBSD.
Get your facts straight; and to others reading this thread, beware of advice from people who can't even get the most elementary facts correct.
Why the **** did you flame him like that ?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by eno:
WRONG again!
FreeBSD, you idiot, NOT NetBSD.
Get your facts straight; and to others reading this thread, beware of advice from people who can't even get the most elementary facts correct.
Also to others reading this thread (not the peole _not_ reading it, though you should also take heed): Beware of people like this.
|
|
"It's about time trees did something good insted of just standing there LIKE JERKS!" :)
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2002
Location: Japan
Status:
Offline
|
|
Enough flaming already.
After many trial and error  of getting this working I have found a solution
1. Download Webmin and install on the machine you want to use quotas on. It might be a little difficult for some people but just read the instructions and you will have no problems.
2. Login to Webmin, click on the System button, tyhen click on the Disk quotas button.
3. Choose the filesystem where you want disk quotas enabled. Then choose users and set your quotas.
Optional: If the users exceed their limits do you want to give them a grace period to backup and delete some data. (Good in educational situations)
If you have any problems let me know.
I was able to setup disk quotas starting from step2 in less than 10 minutes.
Bill
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by teknologika:
Public Apology: I would like to formally apologize for getting the type of BSD incorrect whilst posting to this forum and trying to actual help someone solve a problem. I will NEVER offer information without verifying it from three independent sources before posting again.
Nice response  . I won't call anyone an idiot but I will point this out found on this page on the ADC website:
Part of the history of Mac OS X goes back to Berkeley Software Distributions (BSD) UNIX of the early seventies. Specifically, it is based in part on BSD 4.4 Lite. On a system level, many of the design decisions are made to align with BSD-style UNIX systems. Most libraries and utilities are from FreeBSD ( http://www.freebsd.org/), but some are derived from NetBSD ( http://www.netbsd.org/). For future development, Mac OS X has adopted FreeBSD as a reference code base for BSD technology. Work is ongoing to more closely synchronize all BSD tools and libraries with the FreeBSD-stable branch..
So it turns out that the original poster was not entirely wrong...
WM
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|