Recover HDD Data
 
Blog
 
Using Symbolic and Hard Links in Windows

Using Symbolic and Hard Links in Windows

Below we will analyze the notion of hard and symbolic links in Windows, tell you about their primary purpose and key differences. You can also learn how to create links using standard Windows methods or special software quickly.

Using Symbolic and Hard Links in Windows

Content:

  1. Symbolic links
  2. Hard links
  3. How can I use symbolic links?
  4. How can I simplify the creation of the symbolic and hard link?

Symbolic links

Symbolic links (also known as “Soft Links” or “SymLink”) are particular objects in which, instead of information and data, there is a path to a specific file or directory on your computer’s hard drive

Such functionality has some similarities to shortcuts, but in contrast, it creates a hard link to a specific place. The usage of these links saves the hard drive space and gets a kind of access point to information between different file systems without filling the drive with unnecessary data copies.

The key point in using symbolic links is to keep programs and their individual objects, to which symbolic links have been created, functional. Also, conventional shortcuts are links that can be used to navigate to the original folders.

If a user navigates to the original folder by shortcut, all actions with files (deleting, changing the name, etc.) will directly impact the original. If symbolic links are used, the user will be able to create a symbolic image of the directory (folder), which will contain symbolic links to the original files.

It should be noted that such data are lightweight. Their size is approximately comparable to shortcuts, although due to the peculiarities of work (symbolic links literally “cheat” programs and the operating system, giving out under the guise of a symbolic link is a real existing object), the weight of the folder will always be shown equal to the weight of the original.

Hard links

The Hard Link has similar functionality with symbolic links, but its key differences are:

  • The ability to work in only one particular file system.
  • The ability to work within only one logical partition.
  • The system perceives hard link as well as the symbolic link as the original file, but hard link keeps its originality (all hard link files are originals), while when you change the current file or directory of symbolic link, such links will lose their relevance, because they have nowhere to link.

Thus, hard links have a much smaller range of applications but provide security when used, as all hard links are independent of their original.

How can I use symbolic links?

Symbolic links can have an excellent potential for use. For example, such links can be used when working with virtual machines or for more convenient work with cloud storage. Symbolic links do not waste hard drive resources by moving large folders and files but simply creating symbolic links with the same characteristics, full functionality, and other data capabilities as the symbolic link was created.

In this way, you can move and synchronize large folders under the guise of symbolic links to the repository or move programs from the main computer to the virtual machine without installation, waste of space, and with the preservation of utility functionality. It allows you to edit, work or change the virtual machine’s data structure, synchronized with the data on the real PC, without opening access from the virtual machine to the real computer.

For example, let’s try to create a symbolic link to the data recovery program RS Partition Recovery to save space, move it to another disk, and at the same time do not reinstall the utility to the root of the folder on the new system disk.

Important: Features of symbolic links are available from Windows Vista. Older versions of the operating system do not support working with them because their functionality includes the ability to create only hard and soft (shortcuts) links.

The process of creating a symbolic link looks like this:

Step 1: Work with symbolic links is done through the standard Windows utility “Command Prompt”. Press the Win+R key combination and enter the “cmd” command in the window that opens.

Using Symbolic and Hard Links in Windows

Step 2: In the window that opens, enter the command “mklink”, which will help you to get the description of the functionality and possible actions with symbolic links.

Using Symbolic and Hard Links in Windows

Step 3. After reading the keys, let’s try to create a symbolic link to the “C:\Program Files\Recovery Software\RS Partition Recovery″ directory. To do this, we need to enter the following command “mklink /j “D:\recoverymk” C:\Program Files\Recovery Software\RS Partition Recovery””

Let’s analyze each item of the command in more detail.

  • Mklink – is the main command associated with the creation of symbolic links. It is written in the beginning.
  • /j is a key to create a symbolic link for a directory. The /d key must be used to create the file. The /h key is used to create a hard link.
  • “D:\recoverymk” key is a path where a symbolic link to a directory will be saved.
  • “C:\Program Files (x86)\Recovery Software\RS Partition Recovery 2.8” is the source from which the symbolic link was created.

In our case, a successful symbolic link creation looks like this:

Using Symbolic and Hard Links in Windows

Check the created link and its work in the place that was specified when creating it. In our case, it is “D:\recoverymk”

Using Symbolic and Hard Links in Windows

Try to launch the utility via a symbolic link.

Using Symbolic and Hard Links in Windows

RS Partition Recovery program (as well as any other programs, archives, games, etc.) has successfully worked through a symbolic link.

We will also demonstrate a visual guide to create a symbolic link to a specific file. For example, create a symbolic link to the archive “maps”, located on disk C

For this purpose, we enter “mklink /d “D:\maps” “C:\maps”

In this case, each part of the command is responsible for the following:

  • Mklink is the main command for working with links.
  • /d – key for creating symbolic links to specific files.
  • “D:\maps” – the place where a symbolic link will be created.
  • “C:\maps” – source (original) of the file.
Using Symbolic and Hard Links in Windows

Important: To perform actions, you need to open a command prompt with administrator rights. Otherwise, the utility will generate an error “You have no enough rights”.

How can I simplify the creation of the symbolic and hard link?

For inexperienced users, working in the command prompt can be quite challenging and inconvenient, so many prefer to use a special utility that adds the ability to quickly create links of different types from the context menu (the menu that appears when you right-click on a file).

One of the most popular programs for quick link creation from the context menu is Link Shell Extension.

The process of symbolic link creation with additional utilities looks like this:

Step 1: Right-click on the desired object and select “Pick Link Source”

Using Symbolic and Hard Links in Windows

Step 2: Go to any directory where the link will be placed. Right-Click on the empty space and choose the item “Drop as”, after which you should select “Hard link” or “Symbolic link”

Using Symbolic and Hard Links in Windows

Regardless of the creation method, the links will function in the normal mode.

Comments are closed.