LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-05-2010, 12:59 PM   #1
robmoser
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Rep: Reputation: 0
How do i read an aquota.user file?


I'd like to actually read the contents of an aquota.user file. Partly just from curiosity, and partly because I'm having a problem where it looks like its storing the users quota in the wrong file on the wrong filesystem, and thereby causing locking problems. So if there is a way to directly translate a specific aquota.user file to readable text, or in some other way tell which aquota.user file a particular user's quota resides, I'd love to hear about it.

Not to be too preemptively paranoid, but in the interest of minimising confusion, here are a few similar questions that are NOT what I'm asking:

1) How to read a user's quotas. (quota)
2) How to set up quotas. (various, but honest; I get it.)
3) How to update aquota.user. (checkquota)
4) How to update quotas from the old format to the newer one (convertquota)

I'm specifically looking for how to actually unscramble the binary format that the aquota.user file is stored in. I've googled round about it a fair bit, but I can't seem to find a way to disambiguate the answer from all of the different answers to those other, more common ones.

Thanks for any advice,

- rob.
 
Old 04-06-2010, 05:49 AM   #2
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
Yes, nearly gave you the wrong answer!

So you know about edquota -u username, and repquota etc.

What you want is the format of the binary aquota.user files, stored in the root directory of the partition(s) they relate to.....


I don't know, but if I was you I would think quotactl and the associated code would be a good place to start looking.

Hope that helps.
 
Old 04-07-2010, 02:44 AM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,242

Rep: Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024
I'm pretty sure repquota is what you want http://linux.die.net/man/8/repquota. It reads that file and/or aquota.group
 
1 members found this post helpful.
Old 04-07-2010, 10:41 AM   #4
robmoser
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Well, sort of...

repquota goes in, does mystical magical things to extract data from the quota file, gets a bunch of things flat-out wrong, refuses to look up some of the usernames, and outputs it all in a somewhat inconsistent format thats a pain to parse. What I'm looking for is how to do the mystical magical bit myself. What I was really hoping is that someone would say "Oh, its a Berkeley db; you can access it with any standard BDB API" - or something like that, only true.
 
Old 04-08-2010, 08:28 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,242

Rep: Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024
How do you know it gets things wrong (refuses to lookup user ???) ? It just reads the file & outputs results afaik.
 
Old 04-09-2010, 10:36 AM   #6
robmoser
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Well "wrong" may be overstating it a bit.

repquota reports on the quota for a user on the filesystem specified (or all of them, if you use -a), but:

1) It's usage information is often out of date.

2) Because of #1, it will report a user as part of a filesystem for quite awhile after the user has been moved off of the filesystem. Since moving users from one filesystem to another is what I'm currently working on, this makes its information mostly worthless.

3) It stores quotas by uid, and then looks up a username for the uid. Its doing a lot of these lookups, so its timeout appears to be quite short, and it frequently gives up and reports less than half of the entries by username, and the other half by uid. When its mixed like that, its a pain to use the data as input to any kind of automated script, and even if you force it to always use uids you have to translate them to usernames yourself.

4) It has some quirks to its output format which make it annoying for an automated script to react to; for instance, if the user is over quota, it adds an extra column into the middle of the output.
 
  


Reply

Tags
quotas


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write into File from Kernel and read the same file from User space saurabhchokshi Programming 0 05-01-2009 02:26 PM
quota.user or aquota.user outbackjack Linux - General 1 07-04-2006 07:30 AM
creating file /aquota.user and /aquota.group?? deepika Linux - Newbie 1 10-09-2003 03:15 AM
creating file /aquota.user and /aquota.group?? deepika Linux - Newbie 1 07-29-2003 11:02 AM
Missing aquota. group and aquota.user files nam Linux - General 2 11-05-2002 04:28 PM


All times are GMT -5. The time now is 04:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration