How-To: Use Symbolic Links to Master Vista's File System

31

Comments

+ Add a Comment
avatar

Angel_88

Great info. Thanks for sharing.

 

myblogs:  http://www.knowifagirllikesyou.com |http://www.makeagirlfallinlove.org

avatar

Garyburse

This one is too good. thanks for sharing.

my blogs: cityville cheats | master cleanse

avatar

dwaynez

Nice trick to have in to back pocket. Great for those syncing programs, like dropbox that want everything in a single directory.

avatar

RobbyDesmond

I have found out about the importance of links in general, not only when it comes to Windows Vista. For example, while working for a Orange County SEO company, I've learned that having various sites linking to yours is a good way to gain trust and visibility over search engine results. This is the best way to gain viral, targeted traffic on your site.

avatar

gudenau

In this you have:

mklink /J D:\Games\Steam\steamapps\common\sid meier's civilization iv E:\Games\sid meier's civilization iv

When you should have:

mklink /J "D:\Games\Steam\steamapps\common\sid meier's civilization iv" "E:\Games\sid meier's civilization iv"

The quotes make all the difference.

avatar

gudenau

I love this! It is a great tool for some people to use.

I am making a batch file for this.

avatar

say_no_to_holly...

There's no reason to become a mascochist (Win7) to use HardLinks. 

 

In XP download "Link Shell Extension"

 http://schinagl.priv.at.nyud.net/nt/hardlinkshellext/hardlinkshellext.html

 

or upgrade to *nix

 

 

___

the Peoples Cube awaits

avatar

William Lee

GREAT idea, but I got a comment and a question about this.

Comment:  WinDirStat continues to work, but will report sizes including the files/directories you link rather than reporting their sizes as 0.  RidNacs does more what I would expect, albiet not as pretty.

Question:  I have Windows Home Server.  Say I create a partition (e.g. G:), move some game files from my c: partition to the new g: partition and redirect from my C: partition to my G: partition using softlinks.  At that point should I tell WHS to just backup my c: drive or backup both c: and g:?  I.e. Do backup programs, specifically Windows Home Server's backup program, follow the links and backup the original files or do they just backup the links?  If they backup the original files how would you go about doing a restore when your total data ends up exceeding the size of the physical drive due to the redirects?

avatar

clapp14

Can you use symbolic links to sync mozilla thunderbird account between two computers using dropbox?

avatar

Rasta Monsta

The article states that a "hard" link was chosen in the Civ example, but that iTunes did not "need" a hard link, so "symbolic" link was chosen instead. 

 Why?  This needs to be explained in greater detail.

avatar

easye55

The major reason why they did not use a hard link (or junction) in the iTunes case was because they were referencing a directory on a network share. From my understanding of junctions, they can be used on different volumes on the same PC. However, can not be used to reference a remote directory.

Therefore, it isn't that they didn't "need" a hard link in this case, but rather, could NOT use a hard link. A symbolic link using the /D parameter was the only option.

avatar

bruffstuff

Symbolic links are to point you at a location which is mostly useful for file folders or if you want to only have to delete one copy of a file to free up space.  Hard links would be chosen if you want to be able to update a specific file and not have the file content erased if the original file was deleted.

 In other words Hard links point to data and symbolic links point to files.  As the article stated, symbolic is a shortcut that any program can use since it is part of the OS. 

To the original point, the chose a symbolic link because the data only had to be in one spot so a shortcut to the folder was the best solution.  Most people want a song gone if they delete it and not to hang around because of a hard link at another location, which makes it easier to manage.  You can also have another hard drive that can be used as a folder so you get to have the link to the folder and not take up space on the first drive.

avatar

thinsoldier

((Symbolic links are to point you at a location which is mostly useful for file folders or if you want to only have to delete one copy of a file to free up space.))

So that means if I have a SYMBOLIC Link on my C: drive pointing to a folder on my D drive and I delete the file C: then the real file on D: will also be deleted?

If that's the case then that means with HARD Links if I delete the HARD Link on C: the real file on D: will still exist?

Which means HARD Links are most like common shortcut (.lnk) files in that their deletion has no effect on the real file and the intentional deletion of the real file just makes the shortcut not work anymore.

Am I on the right track?

avatar

triclops41

how would one best optimize using the steam example with one ssd and one hdd?

if the link from the hdd led to the folder in the ssd, would the files still be read at ssd speeds?

this may be obvious to some, but im wondering it the extra step that needs to be taken will negate the fast read speeds of the ssd if it first has to search the hdd for the link. 

avatar

dizzy1

there was also a small utility made by sysinternals to do the same thing

 

avatar

KaylaKaze

I've recently been playing a lot of NWN2 and was really annoyed by the horrible performance I was getting during loads. I read up on it and found out the game used temp data stored in the %TEMP% folder, which happens to point to my C:\ which is my slowest drive. I'm running XP 32-bit so I used Winbolic Link to create 2 junctions: one I junctioned the game's data, such as save games, modules, and overrides to a faster drive, and one to junction the temp data to a RamDrive (I have 6GB of RAM but since 32-bit can only use 4 GB of it, I use the space above 4 GB as a RamDrive). I get MUCH faster loads now.

avatar

nightkiller

Kudos to MS for continuing to add useful functionality to their operating system. 

After spending some thirty hours (!) installing Fedora Core 10 on a lousy P4 board where the updates to the OS took twice as long as the actual install (through yum), I know the kind of life I deserve. And it ain't one with Linux in it.

And as for the usual Linux whiners complaining about stealing ideas, why don't you investigate the history of minix and Torvalds?

Freetards. 

You choose a flightless bird as a mascot and wonder why it doesn't take off?

avatar

codepath

The first sentence of the second paragraph under "What is a symbolic link?" reads:

"With a symbolic link, if the target directory or file is deleted, the link becomes non-functioning, as it points to a file that no longer exists."

I think it should read:

"With a shortcut, if the target directory or file is deleted, the link becomes non-functioning, as it points to a file that no longer exists."

Correct?

avatar

thefuzz4

This functionality has been around for a long time already in the Unix and Linux world.  If your a Linux user just use ln -s <Source> <Target> and you don't need any other special switches whether it be a particular file or a directory.  Way to go MS steal something that works great and try and beef it up as oh look what we just made up.

avatar

almax

This "functionality" has been around since NT 3.1 and DOS 3.1
With commands like "SUBST" and "NET USE"

BTW,  Shouldn’t:
"If you’re a Linux user just use..."

READ:
"If you’re a Linux user, just continue using your ripped off version of UNIX"

avatar

horzo

Erm, other than the GUI front end, OS X is nothing but a Unix box. Does that mean Apple should be critisized for stealing an entire operating system?

Nothing wrong with re-using something that works.

avatar

Defiant

So?

avatar

NAYRhyno

Nice work Alex, another great how-to article.

___________________________
Game-Central.org

avatar

GrimResistance

Can you use this with dropbox to sync your firefox profiles between computers?

avatar

frankos72

I recommend the xmarks plugin.  I have my bookmarks and saved password synced between 4 different computers.  It doesn't take my cookies but that's not really important anyway.  I've had to do two reinstalls since using xmarks and it makes getting your firefox back in working order a breeze.

I'm really start to take a strong liking to all these online sync programs.

avatar

GrimResistance

I have xmarks and it is really great, but I want my extensions too!

avatar

frankos72

Well as I was 1st setting it up it had great potential.  THe file would link and everything appeared to syncronize from one spot to the other.  Then I fired up the game.  It doesn't matter how I link the files, COD will not recognize a link.  In fact at one point I had linked the whole profiles directory.  When I did so it would ask for my name at the start as if it were creating a new profile.  But the name wouldn't stick and it would be asking again in short order.   So , is there a trick to make this work?  I guess I'm going back to the batch files.  :(

 

Jev

avatar

ddimick

What kind of link are you creating?

 

I used a junction (/J) to relocate my entire C:\Users folder to a different drive for a long time now, works perfectly for me. Also use /J when I want to move a game to a different drive without reinstalling, also works great.

avatar

frankos72

There is only one important file for the player profile it's the mpdata file.  I've tried soft and hard links to it and soft and hard links to the directory structure.  When I link to the directory, the changes show up fine in the OS so I know it's working.  However none of these options work for the game.  So, I guess I'm back to the batch file thing.

 

 

avatar

frankos72

Wow! I had already setup drop box after reading about it in your magazine this month.  Then I was thinking about how I could use it to keep my profiles for Call of Duty current between my pc and laptop.  I was going to write a couple little batch files for me to run before and after playing on each pc.  Then I thought I remembered reading on here about 5 ways to tweak your dropbox.  It might have been about gmail but anyway, I thought I'd look to see if there was something easier.  You know closer to a set it and forget it option.  Low and behold you have a story about mklink on the homepage of your website.  I set this up and I'm completly amazed at how awesome it is.  Now since I only play on one or the other PC at a time both will have my current profile all the time without me ever having to do anything but play and enjoy my game.  THANK YOU MAXIMUM PC!  YOU GUYS ROCK. 

 I do have one more tip for anyone using mklink.  Since the file paths can be quite long, I just copied and pasted them into a command in a batch file.  Then I exectued the batch file from the command line.  I found this easier than trying to type those long paths perfectly without a typo.

Lastly, in your example of the /D command you left out the /D   ;)

Thanks again!

 

Jev Vandegrift

Moore, OK

avatar

sgaggerj

"I do have one more tip for anyone using mklink.  Since the file paths
can be quite long, I just copied and pasted them into a command in a
batch file.  Then I exectued the batch file from the command line.  I
found this easier than trying to type those long paths perfectly
without a typo."

 

Windows has the auto-complete feature in it's command prompts, so start typing a path and then hitt the tab key, it will auto complete the path - no typos!

If more than one matching path is found, keep using the tab to cycle through the available paths.  It will also auto-quote long path names.

 

I find this easier if you know the path you want.

 J Sgaggero

RI

Log in to MaximumPC directly or log in using Facebook

Forgot your username or password?
Click here for help.

Login with Facebook
Log in using Facebook to share comments and articles easily with your Facebook feed.