From: andrewd AT axonet DOT com DOT au (Andrew Dalgleish) Subject: RE: mount/umount from commandline... 14 May 1998 11:01:39 -0700 Message-ID: <91A8FD196436D1118EC2006008186C9608C5A3.cygnus.gnu-win32@server1.axonet.com.au> To: gnu-win32 AT cygnus DOT com Cc: "Robertson, Jason V" > -----Original Message----- > From: Robertson, Jason V [SMTP:jason DOT v DOT robertson AT intel DOT com] > Sent: 1998 May 14, Thursday 08:43 > To: gnu-win32 AT cygnus DOT com > Subject: mount/umount from commandline... > > Hello, > > Is there a way to use mount/umount from a command prompt? What > happens is > we have / mounted to a path, say C:/Blah. Now from a command prompt > we do: > C:\> umount / > C:\> mount C:/temp / > mount failed: Device or resource busy > > Anyone have any ideas? [Andrew Dalgleish] You need to do both steps within a single script (because cygwin will remount the current drive as a default root when you call anything after the umount, so the mount fails as you described.) You need to specify the full path to the mount command (because the search path is relative to the non-existent root) (I have my CygWin32 under U:\ - edit to suit) del temp.sh REM unmount the current root echo //u/Cygnus/B19/H-i386-cygwin32/bin/umount.exe />>temp.sh REM Remount our new root echo //u/Cygnus/B19/H-i386-cygwin32/bin/mount.exe 'C:\Temp' />>temp.sh REM Show the mount table echo //u/Cygnus/B19/H-i386-cygwin32/bin/mount.exe>>temp.sh REM run the shell script bash temp.sh (It would probably work if you passed it all to bash separated by semi-colons.) Cheers - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".