How to Use Hard Links
Hard links create a second directory entry for a single file, whereas symbolic links create a new file that references an existing file. This subtle difference yields significantly different behavior.
You can create hard links by adding the /H parameter to the mklink command. For example, the following command creates a hard link from Link.txt to Target.txt.
C:\>mklink /H link.txt target.txt
Hardlink created for link.txt <<===>> target.txt
As with symbolic links, any changes made to the hard link are made automatically to the target (including attribute changes) and vice versa because the file itself is stored only once on the volume. However, hard links have several key differences:
- Hard links must refer to files on the same volume, while symbolic links can refer to files or folders on different volumes or shared folders.
- Hard links can refer only to files, while symbolic links can refer to either files or folders. n Windows maintains hard links, so the link and the target remain accessible even if you move one of them to a different folder.
- Hard links survive deleting the target file. A target file is deleted only if the target file and all hard links are deleted.
- If you delete a symbolic link target and then create a new file with the same name as the target, the symbolic link will open the new target. Hard links will continue to reference the original target file, even if you replace the target.
- Hard links do not show up as symbolic links in dir command-line output, and Windows Explorer does not show a shortcut symbol for them. Hard links are indistinguishable from the original file.
- Changes made to file permissions on a hard link apply to the target file and vice versa. With symbolic links, you can configure separate permissions on the symbolic link, but the permissions are ignored.
Windows XP supports hard links by using the fsutil hardlink command. Windows Vista and Windows 7 hard links are compatible with Windows XP hard links, and the fsutil hardlink command continues to function in Windows Vista and Windows 7.
In this tutorial:
- Managing Disks and File Systems
- Overview of Partitioning Disks
- How to Choose Between MBR or GPT
- Converting from MBR to GPT Disks
- GPT Partitions
- Choosing Basic or Dynamic Disks
- Working with Volumes
- How to Create a Simple Volume
- How to Create a Spanned Volume
- How to Create a Striped Volume
- How to Resize a Volume
- How to Delete a Volume
- How to Create and Use a Virtual Hard Disk
- File System Fragmentation
- Backup And Restore
- How File Backups Work
- File and Folder Backup Structure
- How System Image Backups Work
- How to Start a System Image Backup from the Command Line
- How to Restore a System Image Backup
- System Image Backup Structure
- Best Practices for Computer Backups
- How to Manage Backup Using Group Policy Settings
- Previous Versions and Shadow Copies
- How to Manage Shadow Copies
- How to Restore a File with Previous Versions
- How to Configure Previous Versions with Group Policy Settings
- Windows ReadyBoost
- BitLocker Drive Encryption
- How BitLocker Encrypts Data
- How BitLocker Protects Data
- TPM with External Key (Require Startup USB Key At Every Startup)
- TPM with PIN (Require PIN At Every Startup)
- TPM with PIN and External Key
- BitLocker To Go
- BitLocker Phases
- Requirements for Protecting the System Volume with BitLocker
- How to Enable the Use of BitLocker on the System Volume on Computers Without TPM
- How to Enable BitLocker Encryption on System Volumes
- How to Enable BitLocker Encryption on Data Volumes
- How to Manage BitLocker Keys on a Local Computer
- How to Manage BitLocker from the Command Line
- How to Recover Data Protected by BitLocker
- How to Disable or Remove BitLocker Drive Encryption
- How to Decommission a BitLocker Drive Permanently
- How to Prepare AD DS for BitLocker
- How to Configure a Data Recovery Agent
- How to Manage BitLocker with Group Policy
- The Costs of BitLocker
- Windows 7 Encrypting File System
- How to Export Personal Certificates
- How to Import Personal Certificates
- How to Grant Users Access to an Encrypted File
- Symbolic Links
- How to Create Symbolic Links
- How to Create Relative or Absolute Symbolic Links
- How to Create Symbolic Links to Shared Folders
- How to Use Hard Links
- Disk Quotas
- How to Configure Disk Quotas on a Single Computer
- How to Configure Disk Quotas from a Command Prompt
- How to Configure Disk Quotas by Using Group Policy Settings
- Disk Tools
- EFSDump
- SDelete
- Streams
- Sync
- MoveFile and PendMoves