unmounting file systems

unmounting file systems

Post by Kra » Sat, 02 Jun 1990 14:35:00



The discussion a few months ago regarding autodump procedures inspired me to
push on with my own autodump procedures I had started a few months earlier.
I have the major task down, but some of the details are really beginning to dig
in.  I am running 4.2BSD on an 11/780 with a TU78, RM03, and an RP07.

The basic algorithm runs like this.  At the designated time I run a script
which takes the system down to single user mode.  This is achieved by:

        running a script which returns 0 status if no one else is logged in,
        else returns a non-zero status.  If no one is logged in, the system is
        shutdown immediately.  Otherwise the system is shutdown in 5 minutes.

        /.profile is set to search for a particular file.  If it exists, it
        takes the first line of the file as a command to execute.  Before
        executing the command, it unmounts the file system (umount -a).  If the
        command finishes successfully, it reboots to multi-user mode.
        Otherwise it sits in single user mode for an operator to take
        appropriate action.

I have several problems, but the one I wish to address here is a problem with
automatically unmounting all partitions reliably.  The main culprit seems to be
the line printer spooler.  If there is anything spooled (say a printer is out
of paper and one or more jobs are waiting) then /usr won't unmount.  This isn't
really a problem as far as the backups are concerned, but when the system
reboots and mounts the other file systems, things get confused when a mount of
an already mounted file system is attempted.  (Symptom of confusion: when you
do a 'df', the file system which was doubly mounted appears with no name, as
in:

        Filesystem    kbytes    used   avail capacity  Mounted on
        /dev/hp0a       7653    6336     551    92%    /
        /dev/hp0e     150099   46453   88636    34%    /guest

Quote:>    /dev/hp0h     142172   76068   51887    59%    

        /dev/hp1g      38639   23865   10910    69%    /uts
        /dev/hp0f     150799  119650   16069    88%    /work
)

So the question is: how does one reliably unmount all file systems so that
the reboot doesn't foul things up?

--
kral            408/647-6112            ...amdahl!drivax!braun
"Dream lightyears...    Challenge miles...    Walk in steps"
DISCLAIMER: If DRI knew I was saying this stuff, they would shut me d~-~oxx

 
 
 

unmounting file systems

Post by Chris Tor » Sat, 02 Jun 1990 09:56:00



>... I am running 4.2BSD on an 11/780 with a TU78, RM03, and an RP07.
>... a problem with automatically unmounting all partitions reliably.
>The main culprit seems to be the line printer spooler.  If there is
>anything spooled (say a printer is out of paper and one or more jobs
>are waiting) then /usr won't unmount.

Since shutdown is supposed to kill everything, the spooler should
die too.  (If you are getting the infamous

        WARNING: something is hung (wont die); ps axl advised

message, your kernel probably has a device driver bug.)

Quote:>... when the system reboots and mounts the other file systems,
>things get confused when a mount of an already mounted file system
>is attempted.

If you are in fact rebooting, no file systems save `/' are mounted.
I guess that you are simply returning to multi-user mode.  You
can either leave the file systems mounted throughout---the shutdown
guarantees that nothing is running, so once synced, the file systems
are stable---or you can use `mount -f -a' to force mount to ignore
any errors.  The latter will pretend to mount such things as file
systems with corrupted superblocks.  It may also not exist in stock
4.2BSD (which crashes when you mount bad superblocks anyway).
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)