Disk Quota

I was wondering if it is possible to implement disk quota in QNX file
system?

Anyone?

Thanks in advance for replies

TBL <tburhan@dodo.com.au> wrote:

I was wondering if it is possible to implement disk quota in QNX file
system?

Anyone?

I don’t think there is any configuration flag to enable any sort of
disk quotas (I assume you mean per-user type of quotas.)

And, it is, of course, possible to implement disk quotas under QNX,
it just requires writing (and testing) code.

Assuming you are talking about QNX6 (since you don’t specify a
version), the obvious way to do this would be to write a resource
manager that front ends for the filesystem, and which manages and
enforces those quotes. For someone familiar with writing resource
managers [waves at RK] this shouldn’t to difficult – you can
actually off-load most of the intelligence to the underlying
filesystem by just forwarding most of the messages on, probably
while playing with setuid/setgid calls to get proper perms
checking.

On QNX4, the same principles apply, just the interfaces and
hoops you need to jump through aren’t nearly as well documented.

-David

QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.

David Gibbs <dagibbs@qnx.com> wrote:

TBL <> tburhan@dodo.com.au> > wrote:
I was wondering if it is possible to implement disk quota in QNX file
system?

Anyone?

I don’t think there is any configuration flag to enable any sort of
disk quotas (I assume you mean per-user type of quotas.)

And, it is, of course, possible to implement disk quotas under QNX,
it just requires writing (and testing) code.

Assuming you are talking about QNX6 (since you don’t specify a
version), the obvious way to do this would be to write a resource
manager that front ends for the filesystem, and which manages and
enforces those quotes. For someone familiar with writing resource
managers [waves at RK] this shouldn’t to difficult – you can

RK waves back :slight_smile:

Wouldn’t it just be possible to mount files of fixed size as
“filesystems”? ISTR that early on in the days of the QNX 6 filesystem
Bill Flowers was quoted as saying "and we’d have to have special
logic to disallow mounting of files as filesystems… Yes, this
is going back a long time :slight_smile:

This would be the easiest thing to do; each user gets their own little
sandbox which is actually a complete filesystem with a hard quota.

actually off-load most of the intelligence to the underlying
filesystem by just forwarding most of the messages on, probably
while playing with setuid/setgid calls to get proper perms
checking.

On QNX4, the same principles apply, just the interfaces and
hoops you need to jump through aren’t nearly as well documented.

If what you need is a quota filesystem that allows different
sandboxes (e.g., three different users, with three different
quotas all put some files into “/tmp”) then you are getting into
a bit more work in terms of managing the quota information…
(i.e., who has used how much, and possibly where. What do you
do with hard links: from which user’s quota do the files come
from? Even when you delete a link? etc…)

As I tell my boss every time he returns from a marketing meeting
and starts, “Hey, marketing just asked if we could…” and I
interrupt him with, “Yes! Of course! It’s only a matter of time
and money!” :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

Robert Krten <rk@parse.com> wrote:

David Gibbs <> dagibbs@qnx.com> > wrote:
TBL <> tburhan@dodo.com.au> > wrote:
I was wondering if it is possible to implement disk quota in QNX file
system?

Anyone?

I don’t think there is any configuration flag to enable any sort of
disk quotas (I assume you mean per-user type of quotas.)

And, it is, of course, possible to implement disk quotas under QNX,
it just requires writing (and testing) code.

Assuming you are talking about QNX6 (since you don’t specify a
version), the obvious way to do this would be to write a resource
manager that front ends for the filesystem, and which manages and
enforces those quotes. For someone familiar with writing resource
managers [waves at RK] this shouldn’t to difficult – you can

RK waves back > :slight_smile:

Wouldn’t it just be possible to mount files of fixed size as
“filesystems”? ISTR that early on in the days of the QNX 6 filesystem
Bill Flowers was quoted as saying "and we’d have to have special
logic to disallow mounting of files as filesystems… Yes, this
is going back a long time > :slight_smile:

I’m pretty sure you can still do that.

This would be the easiest thing to do; each user gets their own little
sandbox which is actually a complete filesystem with a hard quota.

But, most quota systems “over-subscribe” the available disk space. So,
with a 100G disk, and 20 users, each would get 10-20G of quota. Can’t
do that with a personal-filesystem in a file.

actually off-load most of the intelligence to the underlying
filesystem by just forwarding most of the messages on, probably
while playing with setuid/setgid calls to get proper perms
checking.

On QNX4, the same principles apply, just the interfaces and
hoops you need to jump through aren’t nearly as well documented.

If what you need is a quota filesystem that allows different
sandboxes (e.g., three different users, with three different
quotas all put some files into “/tmp”) then you are getting into
a bit more work in terms of managing the quota information…
(i.e., who has used how much, and possibly where. What do you
do with hard links: from which user’s quota do the files come
from? Even when you delete a link? etc…)

If two users are hard-linked to the same file, just count it
against BOTH their quotas. Then the deletion of one link case is
easy.

Some quota’ed systems mount /tmp on a seperate device, and don’t apply
quotas in /tmp – but they have a rigorous automatic cleanup policy
for /tmp.

As I tell my boss every time he returns from a marketing meeting
and starts, “Hey, marketing just asked if we could…” and I
interrupt him with, “Yes! Of course! It’s only a matter of time
and money!” > :slight_smile:

Yup. And, before designing a quota filesystem, it would really be good to
know what the quotas were for – what sort of scenario they were
intending to handle/restrict, how secure they needed to be, and which
OS they were needed for.

-David

QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.

Robert Krten wrote:

Wouldn’t it just be possible to mount files of fixed size as
“filesystems”? ISTR that early on in the days of the QNX 6 filesystem
Bill Flowers was quoted as saying "and we’d have to have special
logic to disallow mounting of files as filesystems… Yes, this
is going back a long time > :slight_smile:

This would be the easiest thing to do; each user gets their own little
sandbox which is actually a complete filesystem with a hard quota.

Yeah, that’d work, although with a lot of users under quota you’d end up
with a lot of mount points… is there any penalty for having a lot of
mount points?

I used to do this under BeOS to “master” CD-ROM images, works like a charm.


Chris Herborth (cherborth@qnx.com)
Never send a monster to do the work of an evil scientist.

Chris Herborth <cherborth@qnx.com> wrote:

Robert Krten wrote:
Wouldn’t it just be possible to mount files of fixed size as
“filesystems”? ISTR that early on in the days of the QNX 6 filesystem
Bill Flowers was quoted as saying "and we’d have to have special
logic to disallow mounting of files as filesystems… Yes, this
is going back a long time > :slight_smile:

This would be the easiest thing to do; each user gets their own little
sandbox which is actually a complete filesystem with a hard quota.

Yeah, that’d work, although with a lot of users under quota you’d end up
with a lot of mount points… is there any penalty for having a lot of
mount points?

I was able to do 1000 mountpoints on my tar filesystem with no major
grief…

I used to do this under BeOS to “master” CD-ROM images, works like a charm.

I’m thinking of doing the same thing using bochs for QNX4/QNX6 emulation…

Cheers,
-RK

[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

Chris Herborth <cherborth@qnx.com> wrote:

Robert Krten wrote:
Wouldn’t it just be possible to mount files of fixed size as
“filesystems”? ISTR that early on in the days of the QNX 6 filesystem
Bill Flowers was quoted as saying "and we’d have to have special
logic to disallow mounting of files as filesystems… Yes, this
is going back a long time > :slight_smile:

This would be the easiest thing to do; each user gets their own little
sandbox which is actually a complete filesystem with a hard quota.

Yeah, that’d work, although with a lot of users under quota you’d end up
with a lot of mount points… is there any penalty for having a lot of
mount points?

I think the prefix space (mount points, ln -P, or any other resmgr_attach)
is linearly searched.

-David

QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.