read AdvFS quota.* files directly?

From: Tim Mooney <mooney_at_dogbert.cc.ndsu.NoDak.edu>
Date: Tue, 14 Jul 1998 17:44:44 -0500 (CDT)

All-

The short story: I need a program that will read directly from a file in
`quota.user' format, and print out the important info: uid, block soft limit,
block hard limit, files soft limit, files hard limit, and time limit. Anyone
have a program that does this, so I don't have to reinvent the wheel?

The long story:

We recently had an entire AdvFS domain trashed under 4.0b + patch set #7,
because of an as-yet unknown problem with an HSZ50. Running `verify' on
the domain would get through all filesets and all files in the filesets, but
the system would panic just before the verify command finished.

I opened a call with Digital and was able to get the 4.0b version of `salvage',
and it successfully salvaged every single byte of every file. For those of
you that haven't had to use salvage (knock on wood!), salvage saves data
from one domain into a directory in a different domain, so you need to have
some temporary space available.

`salvage' even saves the contents of quota.user and quota.group, but it makes
them "normal files" in the directory you salvage your domain to, rather than
the undeletable quota.user and quota.group files that exist in the top
directory of a domain.

The problem is now that I need to be able to read the salvaged quota.user
files, so I can re-apply quotas to all users on the system in question.
I already have a locally written command to set a quota completely from the
command line (very similar to Richard Jackson's program, which has been
mentioned on this list many times), now I just need one to extract and print
quota information directly from the salvaged quota.user files, so I can figure
out what people's quotas were previously and reset them to that.

The format of the quota.user and quota.group files is described ambiguously
in /usr/include/vfs/quota.h. With enough time and effort I could write the
program myself, but I'm really hoping someone has already done this and is
willing to share, to save me some time.

If there's a kind soul out there that's already done this and they're willing
to share their work, I would really appreciate it!

Thanks,

Tim
-- 
Tim Mooney                              mooney_at_dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J1, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
Received on Wed Jul 15 1998 - 00:45:41 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT