change directory to network drive in Cygwin
Solution 1:
You can look at mounted drives in the cygwin UNIX environment's view of the underlying Windows OS by looking in /cygdrive
. Do a df
at the cygwin shell prompt (usually bash
) to see where the drives are mounted. Here's the documentation as to where mounted drives are found. For instance, to change to the network drive mounted as Windows f:\
, you'd cd
to /cygdrive/f
, as in:
$ cd /cydrive/f
Here's an example:
- OS X Mavericks (UNIX) has a 3 TB drive mounted as
/Volumes/Time Machine
- A Virtual Windows XP (VM) is running on OS X, and sees
/Volumes/Time Machine
asX:\
- Cygwin is running on the XP VM, and sees
/Volumes/Time Machine
as/cygdrive/x
or evenx:
$ ls x:
Here's a picture:
If the external HD isn't currently mounted on the Windows host and already mapped to a mount point in /cygdrive
, then you may need to mount the network share yourself. Take a look at cygwin's implementation of the UNIX mount
command.
Another way to view the network folder is along the lines of the syntax which you used - I have my OS X server exporting my OS X login folder, whmcclos, as an SMB shared folder. I can set my current working directory to that shared folder from cygwin, on my Windows XP VM, running under OS X, as follows:
$ cd //192.168.0.2/whmcclos
That way, I don't even need to have the folder mounted as a drive letter to view it from within cygwin.
For backing up files that have changed, rsync
will recursively backup only the files in a directory tree that have changed - it computes a minimal backup set, and only backs up what has changed, and has loads of options, including copying to network drives and being able to be used with encryption via ssh
. Here's some hints as to using rsync
with cygwin. Here is a command to compress and archive (recurse) source on drive mounted as c:\
and put in target on drive mounted as f:\
on Windows host underlying cygwin.
$ rsync -avz /cygdrive/c/path/to/source /cygdrive/f/path/to/target
If you need any further assistance, please do leave a comment.