jail+quota problem!

2007-09-20 Thread Wojciech Puchar
i have multi-jail server, moved every jail to a separate UFS partition, 
and turned on quota on some of them (where vserver customer asked for it).


repquota shows all right, edquota works, then repquota shows right things 
but after few syncs or just waiting a minute quota setting disappears!


mount as seen from master server:

/dev/mirror/szymon.eli on /jail/szymon (ufs, local, noatime, with quotas, 
soft-updates)

[EMAIL PROTECTED] ~]# ls -l /jail/szymon/quota*
-rw-r-  1 root  operator  2097120 20 wrz 22:00 /jail/szymon/quota.group
-rw-r-  1 root  operator  2097120 20 wrz 22:00 /jail/szymon/quota.user

[EMAIL PROTECTED] ~]# jexec 8 usr/bin/su -
[EMAIL PROTECTED] ~]# cat /etc/fstab
/dev/mirror/szymon.eli / ufs rw,userquota,groupquota 0 0


(i did it to make repquota work at all, with empty fstab doesn't, i found 
putting anything instead of /dev/mirror/szymon.eli make it work too)



then repquota works OK, edquota works, but is quickly losing the 
data. (typing sync once is enough)



any idea?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Quota problem.

2003-01-07 Thread Aleksey I. Yurlov
Have a nice time.
A little question about quotas in 4.7-S
I'll give output of commands, because it will be more natural by my opinion.

There is a ordinary user some on my box with:
# uname -a
FreeBSD ZzZ 4.7-STABLE FreeBSD 4.7-STABLE #0: Wed Oct 16 20:56:02 GMT 
2002 root@ZzZ:/usr/obj/usr/src/sys/ZzZ i386
#
Quotas for user some:
/usr: kbytes in use: 6245624, limits (soft = 700, hard = 710)
inodes in use: 23, limits (soft = 0, hard = 0)
, but :
# du -k /usr/home/some/
4913828  /usr/home/some/

Imho, 6245624 != 4913828 ;-(

User some have ftp access to his $HOME in CHROOT by proftpd (I 
checked, that there is no files on /usr filesystem owned by him),
and shell is /usr/bin/false. quotacheck -a, rehash, sync,..., reboot 
didn't helps.

If you know some solution in this situation - reply please.

ps: By now I will go to update my box, may be there is patches  fixes 
about quotas?!

---
Best regards, Aleksey I. Yurlov
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Quota problem

2002-09-22 Thread Ihsan Junaidi Ibrahim

Hello all,

I  originally  posted  this topic under How do i know a disk is bad thread but
didn't get any replies.

Well  I've narrowed down the problem towards disk quotas. It turns out that when
I  disable  quotas, everything works fine. When I first setup quotas on /home, I
did   not  place  any quota on the user nor group, with the intention of placing
for one later. I think I know the specific problems but I'm not that sure.

1)  Does  file/dir  ownership  of another user counts? I have a single directory
with files with someone else ownership.

2) Does quotas have problem with this kind of thing?

3)  I  ran  file  quota.user  and  the output says it's a text file without line
terminators  but  when  I  did less on it, all I got is a repetitive sequence of
'@@@' character. When I tried to edit it, all I got is a blank screen. Is this a
sign  of  the  quota.user/quota.group  is  corrupted?

When I ran these tests, I removed userquota,groupquota from /home's fstab entry.

Please help. Thanks in advance.

-- 
Thank you for your time,
Ihsan

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Quota problem

2002-09-22 Thread Matthew Seaman

On Sun, Sep 22, 2002 at 03:01:02PM +0800, Ihsan Junaidi Ibrahim wrote:

 
 Well I've narrowed down the problem towards disk quotas. It turns
 out that when I disable quotas, everything works fine. When I first
 setup quotas on /home, I did not place any quota on the user nor
 group, with the intention of placing for one later. I think I know
 the specific problems but I'm not that sure.

OK.  Here's a brief rundown of what you need to do to get filesystem
quotas working.

i) Read through these man pages:

quota(1)
edquota(8)
quotacheck(8)
quotaon(8)
repquota(8)
fstab(5)

   Additionally, any of the other pages turned up by 'man -k quota' 

   ii) Prepare your system.  You need to add 'options QUOTA' to your
   kernel config and compile yourself a new kernel, or the system
   simply won't support quotas.

  iii) Add:

enable_quotas=YES
check_quotas=YES

   to /etc/rc.conf.  Now, when you reboot into your new kernel you
   would see 

Checking quotas : done
Enabling quotas : done

   printed on the console.  You don't need to reboot just yet
   though.

   iv) At this point no filesystems have been marked as using quotas.
   I'm going to use my /var partition as an example.

   Edit /etc/fstab to enable quotas on the partition.  As I don't
   want the quota files cluttering up the root of the filesystem,
   I'm going to move them into a subdirectory.

/dev/da0s1e /varufs 
rw,userquota=/var/quota/var.user,groupquota=/var/quota/var.group  2   2

   Create the /var/quota directory, and generate baseline quota
   files.  quotacheck(8) should be run when the filesystem is
   quiescent for best results:

mkdir /var/quota
quotacheck -v /var
   
   Now, set up the per-uid or per-group limits with edquota(8)

edquota -f /var username

   If you've got lots of users, set up one with default values and
   use 'edquota -p defaultuser 1000-2000' to copy the settings to
   a range of UIDs in one go.

   All of the above can be done without having quotas enabled in
   the kernel yet (although you will see many warning messages to
   that effect).

v) Turn on quotas on the partition.  If you had to modify the
   kernel in step ii), then you've got to reboot at this point.
   Otherwise you can just run:

quotaon -v /var

   vi) Check that everything seems to be working by running
   repquota(8) and quota(1).  Try adding some big files and
   testing that quota limits are enforced.

Repeat as necessary for other filesystems.  That's all there is to it.

 1) Does file/dir ownership of another user counts? I have a single
 directory with files with someone else ownership.

The quota system keeps track of the ownership of every entity created
on the file system, be it a plain file, a directory or some other
thing.  It keeps track of the changes in the number of bytes and the
number of inodes used by each UID by having hooks into the system
calls (like open(2), truncate(2), write(2), etc) that can create or
destroy files or change their size.  The quotacheck(8) command should
be used to establish a baseline when setting up quotas for the first
time, and on reboot (check_quotas=YES in /etc/rc.conf) to ensure
sanity.

The quota system will add a small amount of overhead to file IO on the
partition, but for normal usage for shell accounts and the like it's
not significant.  

 2) Does quotas have problem with this kind of thing?

No.  It doesn't matter if a directory contains files owned by any
number of different users, or if a users' files are scattered all over
the partition.  It doesn't matter either if you've only specified
quota limits for some of your users --- the rest will default to
having an unlimited quota.

 3) I ran file quota.user and the output says it's a text file
 without line terminators but when I did less on it, all I got is a
 repetitive sequence of '@@@' character. When I tried to edit it, all
 I got is a blank screen. Is this a sign of the
 quota.user/quota.group is corrupted?

No --- the quota.user file consists of a list of fixed size records,
and uses the UID of the user as an index into the file to locate the
data for that user.  (Similarly, it uses the GID in the quota.group
file).  That means that if you have, say, a /home partition and you
are the only user with any files on the partition and your user id is
1000, then the quota.user file will consist of 1001 records, most of
which will be unused and empty.  The unused stuff is usually filled
with ascii NULL characters, often represented as '^@' when viewing a
file.

Of course, it's most unusual for root not to own any files at all on a
partition, so there should be some interesting data right at the
beginning of the file (record 0).  The fact that you're not seeing
anything 

Re[2]: Quota problem

2002-09-22 Thread Ihsan Junaidi Ibrahim

Hello all,

 Thanks  Matthew,  it  works  now.  I  no  longer  have the hangup in apache and
 file   operations.  But  I'm still stumped on why it happened, since I'm pretty
 sure I followed all the guidelines.

 Thanks again.
-- 
Thank you for your time,
Ihsan

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message