Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to create a hardlink on my C drive that points to a file on my D drive. I open up a terminal with Administrator privileges and try the following:

C:\Users\sandro>mklink /H _vimrc D:\sandro-desktop\.vimrc

The error that I get is: The system cannot move the file to a different disk drive.

When I try a softlink I get the issue that for some reason changes to the link contents aren't reflected on the targeted file.

Thank you!

share|improve this question
    
How about _vimrc in the destination instead of .vimrc? –  ulidtko Feb 9 '11 at 5:45
    
Not an answer, but you'll find good information here, schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html. –  therube Feb 9 '11 at 8:17

3 Answers 3

up vote 9 down vote accepted

A hard link is a file system feature that cannot cross a file system boundary. You can't hard link files on C: to D: because they are separate file systems. They might each contain the same type of file sytem (eg. NTFS) but they are separate file systems.

share|improve this answer
    
I believe s/different/separate/ would be more apropriate. –  grawity Feb 9 '11 at 11:03
    
@grawity: Yep, agreed. So edited. –  Mike Fitzpatrick Feb 9 '11 at 11:14
    
Do you have ideas on how I can get around this? –  Sandro Feb 9 '11 at 17:04
    
You could migrate your Windows 7 user profile (or just the My Documents folder) to drive D, then hardlinks will work. If you do this, make sure you use the proper methods in Windows 7 (generally through properties tabs) - don't manually move folders from C: to D: –  Mike Fitzpatrick Feb 9 '11 at 23:21

If its windows 7, you can use symlinks - steammover does just that

share|improve this answer
    
How is that different from what I am doing now? I guess I can give it a try :) –  Sandro Feb 9 '11 at 7:31
    
symlinks works between directories - quite a few of the older junction related options do not. In addition, since there's a neat front end, which tells you the command, its easier to work out what is done. I'm mostly using XP, so i'm not sure if its 'better' but from what i've read, it should do the job you need it to do with the least fuss –  Journeyman Geek Feb 9 '11 at 7:57
2  
@Sandro: Technical details: two hardlinks point to the same inode (on Unix; very similar in Windows' NTFS though), which only works within a single filesystem. Two hardlinks are completely identical; there's no "original". A symlink, on the other hand, points to a path, which can be any text in fact. –  grawity Feb 9 '11 at 11:57
    
If that's how symlinks work then how come when I make a change to one file the other doesn't show the changes? –  Sandro Feb 9 '11 at 17:05

Try this:

mklink /H "C:\Users\sandro_vimrc" "D:\sandro-desktop\.vimrc"

I'm guessing this has something to do with the filename of the target. Try using quotes around the target link.

I think your link has to be a full path as well.

share|improve this answer
    
I tried those and still nothing. Thanks for the idea though! –  Sandro Feb 9 '11 at 7:31
    
It's probably the dot-name of the target. Does it work for other files? –  user3463 Feb 9 '11 at 7:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.