1

I have C:\HardDrive1\name\ and D:\HardDrive2\name. I want to make (at least read-only) access to these folders at I:\name (for example). Is this possible at Windows? Also I'm interested is there UNIX way to do it?

ShyMan
  • 245
  • 3
  • 8

2 Answers2

1

In UNIX, symbolic links. Read the man page for ln (use the -s option). For Windows, use junctions.

1

On Windows 7 and Vista, there is the command line utility mklink to make symbolic links, for the rest, there's junction from sysinternals which creates so called junction points.

Some things to keep in mind:

  • Junctions and symbolic links are softlinks between two directories.
  • Never use recursive deletion tools to remove a junction (Windows 2000, XP), it will delete the files inside the junction first (thus deleting the real files). Use the tool rmdir to delete junction points.
  • If you delete a symbolic link (made with mklink, Windows Vista and 7), just that will disappear.

If you delete the real directory, the junction/symbolic link will be an empty directory from now on.

  • It is MANDATORY that both partitions be formatted as NTFS to make junctions or symlinks.

Usage:

First, create the folder(s) the junction(s)/symlink(s) will point to, in this example, I:\name1 and I:\name2. Junctions need an empty NTFS folder to point to!

C:\>mklink /d "I:\name1" "C:\HardDrive1\name"
C:\>mklink /d "I:\name2" "D:\HardDrive2\name"

Or, on XP using junction.exe

C:\>junction /d "I:\name1" "C:\HardDrive1\name"
C:\>junction /d "I:\name2" "D:\HardDrive2\name"
sinni800
  • 3,169