tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: large quotas, once more
@ 1997-01-30 11:09 Gernot Salzer
  0 siblings, 0 replies; only message in thread
From: Gernot Salzer @ 1997-01-30 11:09 UTC (permalink / raw)
  To: tru64-unix-managers


The question was:
   Is it possible to shrink the (virtual) size of quota.* files,
   if the top uids/gids are no longer in use?

Thanks to
   sysadmin@sba.miami.edu
   Kurt.Knochner@Physik.TU-Muenchen.DE
   
There are two possibilities:

1. Let the system do it.
   Backup the filesystem, and recreate it from scratch. The quota files will
   be initialized to 8K.

2. Do it by hand.
   Quoting Kurt Knocher:
> Quota files are records of 32 Byte indexed by the userid. Write a C Programm
> which reads only the first n records and writes it to a new file. 
> 
> Or: Use the following Perlscript:
> 
> 	#!/usr/local/bin/perl
> 
> 	$file="quota.user";
> 	$newfile="new-quota.user";
> 	$max_user_id=20000;
> 
> 	open(QUOTA,"<$file");
> 	open(OUT,">$newfile");
> 	binmode(QUOTA);
> 	read(QUOTA,$input,$max_user_id*32,0);
> 	syswrite(OUT,$input,$max_user_id*32,0);
> 	close(QUOTA);
> 	close(OUT);
> 
> Where max_user_id is the numer of records you want to move to the
> new quota file. After you created the new file:
> 
> 	quotaoff /home		; or the mountpoint of your filesystem
> 	mv quota.user quota.user.sav
> 	mv new-quota.user quota.user
> 	quotaon /home
> 	quotacheck /home
> 
> That's it. Have fun and be carefull.




Original question:

> Is there any way of reorganizing the quota.* files?
>
> I once made the mistake to mark files using a high uid/gid, something like
> 8888888 (yes, I know, it's not very clever, but I did it), and then the
> virtual size of the quota files grew to 28MB. Now I don't use these (and
> similar) id's any more, but the quota files keep their size.
> Is there a way to shrink the files?
> 
> Even though 28MB are only the virtual size, I would like to get rid
> of these big files:
> 1. It's ugly :-)
> 2. When tarring the file set, the files need tape blocks according to their
>    virtual size, not to their real size.
>    I've been told that gnu tar has an option for handling sparse files
>    efficiently, but not all programs are equipped like this.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-01-30 11:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-01-30 11:09 SUMMARY: large quotas, once more Gernot Salzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox