[clug] Mounting Win XP DIRECTORY in Linux

Martin Pool mbp at sourcefrog.net
Sat May 28 03:07:06 GMT 2005


On 28 May 2005, Peter Anderson <pjafrombbay at yahoo.com.au> wrote:
> Hi!
> 
> I am a 'newish' Linux user.  I have a PC with two hard drives; one has
> WinXP Home and the other Umbutu 5.04 (and very good it is too).  I have
> modified fstab to mount 'hda1' at Linux boot time.  However, I would
> like to mount at the Windows "My Documents" directory to save all the
> clicking and mousing required to navigate down the directory tree each
> time I want to access a document stored there.  I have tried to create
> a link to "My Documents" but I get error messages about the drive being
> write protected (or something similar).
> 
> I have experimented with commands such as:
> 
> sudo mount
> /dev/hda1/Documents\040and\040Settings/Peter\040Anderson/My\040Documents/
> /media/windocs -t ntfs -o umask=0222
> 
> But can't get anything to work.  I have also 'Googled' extensively and
> not been able to find much help (except the use of the '\040' escape
> sequence for 'space' characters.
> 
> Does anyone know how to do this?  Can it be done?  Or, does 'mount'
> only mount at the root volume level?

Yes, mount only mounts whole volumes.  (With a couple of exceptions like
NFS.) 

  (The first parameter to /dev/hda1 needs to be a device node, which
   doesn't directly contain any subdirectories but rather represents
   the disk partition itself.  So that's why you can't say
   /dev/hda1/subdir.)

What you want to do is mount the whole thing as say /mnt/c, and then
expose that subdirectory at a convenient location.  So

sudo mount /dev/hda1 -t ntfs -o umask=0222 /mnt/c

(or the equivalent in your fstab.)

Then there are two options; the simplest is to just make a symlink

ln -s '/mnt/c/Documents and Settings/Peter Anderson/My Documents' ~/windocs

will make a symlink in your home directory.  If you want to make it look
like a whole filesytem for some reason then you could also do

sudo mount --bind '/mnt/c/Documents and Settings/Peter Anderson/My Documents' /media/windocs

Cheers, and welcome to Linux.

-- 
Martin


More information about the linux mailing list