3

I have a SSD, and a RamDisk in other disc drive. I use MKLINK /D to move Google Chrome cache, from my SSD to my RamDisk. Please, my questions are:

  1. With MKLINK /D, where physically is my cache? SSD? RamDisk? Both? Am I moving cache to my RamDisk? Or just duplicating cache on my SSD and RamDisk? I ask because the same files and folders appear in both drives (SSD and RamDisk).

  2. Does MKLINK /D work with files, folders and sub-folders? Only one MKLINK /D is enough for every file, folder and sub-folder under this symlink? Files, folders and sub-folders are physically going to be in the SSD or RamDisk?

  3. Should I use MKLINK /J? In my case, what's the technical difference using MKLINK /D or MKLINK /J?

Thanks!

PS1: I already googled the issue, but is very confuse.

PS2: I am not interested in the --disk-cache-dir="x:" solution.

Seth
  • 9,165
  • 3
    Just setup your ramdisk and use the --disk-cache-dir= option. To make it also work from the command-line you'll need to enter it manually each time: chrome.exe --disk-cache-dir="x:" (the chrome.lnk shortcut is doing this automatically—check its Properties). – martineau Feb 15 '17 at 00:37
  • 3
  • Please see the link above where this question was already asked. If this does NOT answer your question or solve your problem, respond back with how your question differs. – music2myear Feb 15 '17 at 00:42
  • Martineau, thanks! The --disk-cache-dir="x:" is an alternative. But I still need the answers to my questions related to MLINK /D, /J, my SSD, RamDisk and cache. – Esther Moellman Feb 15 '17 at 11:36
  • Music2myear, thanks! No, my questions are not answered. My issue is slightly different from the link you posted. I edited my questions in order to clarify the difference. – Esther Moellman Feb 15 '17 at 11:38

1 Answers1

2

If you run mklink /? you will get the information that it's used to create a symbolic link. While the /J switch would make it a junction instead of a link. For a view of the differences you could check the question What is the difference between NTFS Junction Points and Symbolic Links? or the information on Wikipedia.

In both cases the files would not exist at two points at once but rather you would be redirected to the other point by accessing one of them. So by setting up a symbolic link for a directory you would merely access another location. As such the cache remains only on your target (your RAM disk).

An easy example:

mkdir target
mklink /D linkname target
echo "This is a test" > linkname/test.txt
rmdir linkname
dir target

The result will be a file named test.txt in your target folder while there isn't a link to it anymore. So a cd linkname would fail.

Seth
  • 9,165
  • Seth, thanks a lot! Please, let me see if I understand:

    a) According to your explanation, in my case, files, folders, sub-folders physically are always going to be ONLY in the RAM Disk.

    b) And according the links you added, in brief "MKLINK /D" can be used to link to either files or folders and those files or folders can be located either on the same system (same drive or different drives) or to a network share.

    Please, can you confirm or correct me?

    – Esther Moellman Feb 15 '17 at 15:17
  • Seth, final question (and I know is a silly question): Taking my same example with SSD, RAM disk, and cache... normally a browser cache folder has lot of files and sub-folders... so, by creating a "MKLINK /D" of folder cache in SSD to RAM disk, this symbolic link automatically will move all cache content (files and sub-folders) to the RAM disk? I ask, sorry, in order to be 100% sure that cache and all its content, are going to be in the RAM disk with just 1 symlink.

    Thanks again!

    – Esther Moellman Feb 15 '17 at 15:19
  • Yes, those files should only reside in your RAM disk and yes, symbolic links are more flexible but I haven't tested them for remote systems. – Seth Feb 16 '17 at 06:24
  • Perfect Seth, thanks! Just remain my final question: By creating a "MKLINK /D" of folder cache in SSD to RAM disk, 1 symbolic link automatically will move all cache content (files and sub-folders) to the RAM disk? All its content, are going to be in the RAM disk with just 1 symlink? – Esther Moellman Feb 16 '17 at 11:43
  • Yes, it will redirect everything. If someone thinks this answer is incorrect or deems it to be incomplete please provide some feedback instead of just down voting it in order to improve it! – Seth Oct 14 '17 at 09:12