Why umount -A is a really bad idea

Reini Urban rurban@x-ray.at
Thu Aug 26 11:39:00 GMT 2004


Igor Pechtchanski schrieb:
> On Wed, 25 Aug 2004, Mike wrote:
>>On Wed, 25 Aug 2004, Colin JN Breame wrote:
>>>I tried this once, just to see what would happen.  I then spent the 
>>>next hour restoring the mount points.  I've learnt a valuable 
>>>lesson...
>>
>>Why would a 'mount -a' not work after your 'umount -a' to restore the 
>>mounts?
>>
>>Mike
> 
> Because Cygwin's mounts aren't the same as Unix mounts.  The mount and 
> umount commands on Cygwin modify the mount table directly, so that a 
> umount really is permanent.  However (and this concerns the OP, too), you 
> can save the mount table as the output of "mount -m", which you can later 
> use to restore the mounts.

not really.
I used to do that quite often, but since /bin and /usr/bin are not known 
to cygwin anymore after umount -a (and not in the path) I came with this 
workaround.

#!/bin/sh
# save mounts
BIN=`cygpath -w /bin | sed 's|\\\\|/|g'`
mount -m | sed "s|^mount|$BIN/mount|" | tee savemounts
umount -a

# nano or $EDITOR will not work now to fix savemounts!

# restore
. savemounts

it will look like "f:/cygnus/bin/mount" now. This will be found, on NT 
at least.


> For those unfortunate enough to have done a "umount -a" without saving the 
> mounts via "mount -m", the minimum necessary mounts for Cygwin to work are
> 
> mount -sbc /cygdrive
> mount -fsb c:/cygwin /
> mount -fsb c:/cygwin/bin /usr/bin
> mount -fsb c:/cygwin/lib /usr/lib
> 
> (that is provided that you installed Cygwin in c:/cygwin).
-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list