tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Gernot Salzer <salzer () logic ! tuwien ! ac ! at>
To: tru64-unix-managers
Subject: SUMMARY: large quotas, once more
Date: Thu, 30 Jan 1997 11:09:40 +0000	[thread overview]
Message-ID: <96076450423533.tru64-unix-managers.marc@archive.invalid> (raw)


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.

                 reply	other threads:[~1997-01-30 11:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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