home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!lrz-muenchen.de!regent!svb
- From: svb@svb.guug.de (Sebastian v. Bomhard)
- Newsgroups: comp.sys.sun.admin
- Subject: Re: tunefs on /usr
- Message-ID: <193@svb.guug.de>
- Date: 15 Dec 92 16:00:24 GMT
- References: <ByG0ny.KK1@uxa.ecn.bgu.edu> <1992Dec6.000641.3438@nic.csu.net>
- Organization: v. Bomhard Unternehmensberatung
- Lines: 75
-
- >In article <ByG0ny.KK1@uxa.ecn.bgu.edu> mflll@uxa.ecn.bgu.edu (Dr. Laurence Leff) writes:
- >>I am trying to run tunefs on the /usr file system. Of course this
- >>is part of the two file systems (/root and /usr) that are brought up
- >>on bootup.
- >>
- >>Thus, we can't dismount it to run tunefs. This is even true when we
- >>come up single user (boot with -s option)
- >>
- >>We are on 4.1.1 operating system on Sun III's.
- >>
- >>Does anyone know a method of running tunefs on the /usr file system.
- >>We want to reduce the disk space allocated to root on this file system.
- >>
-
- Well, the easiest way is to just just unmount /usr. The problem are
- the shared libraries, so all you have to do is to write a staticaly linked
- umount of your own (I assume you don't have the sources) and put it
- into /sbin, then boot single user and umount /usr, no problem at all!
-
- And, you don't have to write your own umount, here it comes (without
- warranty, but it works for me since I wrote it). Please ignore the
- german comments :-). The /etc/mtab part is sort of an ugly hack, you
- perhaps might want to edit it, but the unmount(2) syscall doesn't keep
- track of that file. And YES, I will use symbolic constants next time :-)
-
-
- HTH,
-
- -svb.
-
- ----------------------------cut here----------------------------------
- /* unmount_usr -- Umount /usr, is to be linked statically
- * Synopsis: unmount_usr, no args provided
- * May 1992 svb
- * Works if / is on /dev/sd3a. Change, if wrong.
- * OS 4.1.1
- */
-
- #include <stdio.h>
-
- main()
- {
- FILE *mtab;
- switch(unmount("/usr")) {
- case 0:
- break;
- case -1:
- fprintf(stderr,"Cannot unmount /usr\n");
- perror("unmount()");
- return 1;
- default:
- fprintf(stderr, "Unexpected Returncode from umount!\n");
- perror("unmount()");
- return 2;
- }
- mtab = fopen("/etc/mtab", "w");
- if(!mtab) {
- fprintf(stderr, "%s\nDas sollte drinstehen: %s\n",
- "Peinlich, peinlich, Deine /etc/mtab ist wahrscheinlich weg!",
- "/dev/sd3a / 4.2 rw,dev=0718 1 1" );
- perror("/etc/mtab");
- return 3;
- }
-
- fprintf(mtab, "/dev/sd3a / 4.2 rw,dev=0718 1 1\n");
- fclose(mtab);
- printf("/usr unmounted\n");
- return 0;
- }
- ----------------------------cut here----------------------------------
-
- --
- Sebastian v. Bomhard <svb@svb.guug.de>
- St.-Anna-Str. 13, D-W-8000 Muenchen 22 (Lehel), +49-89-298934
- >>>>>>>>>>> A neat desk is a sign of a sick mind. <<<<<<<<<<<<<
-