Thomas Seeling wrote:
Hallo,
took me some time to try more things.
I'd like to return with some thoughts, suggestions and a new problem, too ;)
Try adding a -f switch to that to force the umount
I introduced an "early" unmount kill script long before shutdown of the
network fileserver services.
When thinking about the general sysV init concept I now find it quite
strange that I have to add kill scripts to the "new" runlevel. Wouldn't
it be more logical to add kill scripts to to "old" runlevel and then run
the start scripts from the "new" runlevel? Usually I know exactly what
I'm starting in a runlevel, and I should take care of exactly that
collection of services when I "leave" that runlevel, shouldn't I?
umount -a -f -O _netdev >/dev/null
here comes my new problem. I used "umount -a -t nfs,cifs" and it does -
nothing. I invoke the command, e.g. with one NFS mount, and it's still
mounted afterwards. I have no idea why umount does not work.
But that will not handle any network mounts that are not in fstab.
Because of the aforementioned problem I simply use awk to parse mount's
output and unmount any network filesystem one by one, avoiding the "-a"
switch which does not work on my systems (one still 7.10, one 8.0).
mount | awk '/nfs|cifs/{printf"umount -t %s %s\n",$5,$3;}' | sh
for device in `cut -d" " -f1 /proc/mounts|grep :`; do
umount -f $device 2>$1 >/dev/null
done
this is more or less the same logic. I'm a big fan of awk, so I suggest
you combine grep and cut into one awk command ;). Searching for either a
colon or the mount type is more or less a matter of preference ;)
awk '/:/{print$1}' /proc/mounts
-or-
awk '/cifs|nfs|whatever/{print$1}' /proc/mounts
perhaps this would be better:
umount -af --types nfs,cifs
We might want to add nfs4 also. I'm not sure if other file systems are
used like smb or a sshfs. It depends on how they show up in /proc/mounts.
-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page