π Mount points, symbolic links, and hard links in Window 7 (8 MCQs)
Alternative Paths to Files and Volumes in NTFS
Windows 7 supports several filesystem mechanisms for connecting names and storage locations. A mount point attaches a volume to an empty directory, a symbolic link redirects pathname resolution to another target, and a hard link provides an additional directory entry for the same file record. These features support flexible organisation without requiring applications to know physical disk layouts.
Why File Locations Need Flexible Naming
Fixed drive letters and physical paths can become inconvenient when storage volumes are added or data is reorganised. Links provide alternate names, while mount points integrate another volume into an existing directory hierarchy. Each mechanism has different rules for target type, filesystem location, and deletion behaviour.
Volume Mounting and Link Resolution
A mount point associates a volume with an empty directory on an NTFS volume. A symbolic link stores a target path that the filesystem resolves when accessed. A hard link creates another directory entry referring to the same underlying file record and therefore shares the file's contents and metadata.
Example of a Hard Link and Symbolic Link
Two hard links point to the same NTFS file record. Modifying the contents through either name changes the same file. A symbolic link instead contains a reference to a target pathname; replacing or moving the target can affect whether the link resolves successfully.
Storage Flexibility and Link Constraints
Mount points help organise large volumes, while symbolic and hard links support alternate access paths. NTFS hard links are restricted to files on the same volume, whereas symbolic links can target files or directories and may cross volumes. Link permissions, privileges, target availability, and application compatibility affect practical use.
Misconceptions About Windows Links
'A hard link is a separate copy of a file' is false because it refers to the same file record. 'A symbolic link must point to the same volume' is incorrect because it can target another volume. 'A mount point is merely a renamed drive letter' ignores its integration into a directory path.
Exam Focus: Comparing Mount Points and Link Types
Distinguish volume mount points, symbolic links, and hard links by their targets and storage relationships. Explain what happens when a target is moved or one hard-link name is deleted. Questions may test same-volume restrictions, shared file records, directory links, and the use of mount points in storage organisation.
Key Terms of Windows Links
- Mount point - Directory path attached to a volume.
- Symbolic link - Filesystem reference to a target path.
- Hard link - Additional name for one file record.
- Target - Referenced file, directory, or volume.
- File record - NTFS metadata record for a file.
π All Mount points, symbolic links, and hard links in Window 7 MCQs
Q1. Which of the following best defines a symbolic link in a Unix-like file system?
π Explanation: The correct answer is A because a symbolic link is a special file that stores a pathname pointing to the target, allowing the link to reference files across different directories or file systems. Option B describes a regular copy, which consumes separate storage. Option C describes a hard link, which shares the same inode. Option D is unrelated; hidden files are still regular files. In practice, using a symbolic link lets administrators redirect configuration files without moving the original data.
Q2. How does a hard link differ from a symbolic link regarding the way the operating system tracks the target?
π Explanation: The correct answer is A because a hard link creates another directory entry that points directly to the same inode, so both names refer to identical data on disk. Option B describes a symbolic link, which stores a pathname rather than an inode reference. Option C is incorrect; hard links do not use separate metadata structures. Option D is false because hard links work on local file systems, not only network ones. Understanding this distinction helps administrators choose the appropriate link type for file sharing.
Q3. Why does the operating system prevent the deletion of a file that still has active hard links?
π Explanation: The correct answer is A because a file cannot be removed from the file system while any hard link still points to its inode; the data remains needed until the link count drops to zero. Option B is wrong since symbolic links are independent path references and do not affect the target's existence. Option C misstates inode locking; the inode is released only after the link count reaches zero, not based on open handles. Option D is irrelevant because directory protection does not govern link deletion. This rule ensures data integrity when multiple names reference the same file.
Q4. A system administrator wants to replace a large log directory with a new location without changing any application configurations. Which link type should they use to point /var/log to /mnt/storage/logs, and what is a key advantage of that choice?
π Explanation: The correct answer is B. A symbolic link can point to a directory located on a different file system, allowing /var/log to redirect to /mnt/storage/logs without moving the original files. Option A is incorrect because hard links cannot span file system boundaries. Option C is false; hard links do not automatically update when the target moves. Option D is misleading; while symbolic links use minimal disk space, the primary advantage here is crossβfilesystem capability. Using a symbolic link lets the administrator change the log location transparently for all applications.
Q5. What is the effect of mounting a separate file system at /mnt/data on existing symbolic links that point to /home/user/docs inside the original root file system?
π Explanation: The correct answer is B because symbolic links are resolved at the time of pathname traversal, after the mount operation, so a link that points to /home/user/docs still reaches the original target even if another file system is mounted elsewhere. Option A would only be true if the mount point replaced part of the path the link references. Option C is incorrect; the kernel does not convert links. Option D is false; mounts do not ignore existing symbolic links. This behavior is essential for maintaining link functionality across mounts.
Q6. A developer copies a directory tree from /src to /dst using the command `cp -r /src /dst`. After the copy, they notice that changes in /src affect files in /dst. Which link type likely caused this behavior, and how should the command be altered to avoid it?
π Explanation: The correct answer is A. The observed shared changes indicate that the destination contains hard links to the source files, which occurs when the copy command is invoked with the `-l` (link) option. Removing that option and running a plain `cp -r` copies the actual file contents, breaking the link relationship. Option B misidentifies symbolic links, and option C suggests `-a` would fix the issue, but `-a` preserves links rather than copying data. Option D also confuses link types. Using the proper copy command ensures independent copies for backup or deployment.
Q7. On a server, /var/www is a mount point for a separate file system. An administrator creates a symbolic link /var/www/html -> /srv/web/html. Later, they move /srv/web to /opt/web and update the link accordingly. However, a running web service still serves content from the old location. What kernel mechanism explains this behavior, and how can the service be forced to use the updated link without restarting the entire server?
π Explanation: The correct answer is D. The kernel resolves a symbolic link each time a process opens the file, so if a service keeps file descriptors open, it will continue to read from the original inode even after the link is changed. Options A and B refer to cache dropping, which does not affect already opened handles. Option C mentions mount namespaces, unrelated to link resolution. To make the service use the new target without a full restart, the administrator can close and reopen the affected file descriptors, or reload the service configuration, prompting the kernel to resolve the updated link.
Q8. A backup script uses `rsync -a` to synchronize /home/user to /backup/user. The user has several hard links within /home/user to save space. After the backup, the administrator notices that the backup contains duplicate copies of the linked files, consuming extra space. Which rsync option should be added to preserve hard links, and why does this option work?
π Explanation: The correct answer is A. Adding the `--hard-links` option tells rsync to preserve the hardβlink relationships found in the source tree, recreating them on the backup side instead of copying each linked file as a separate file. Option B (`--copy-links`) would follow symbolic links, creating copies, which is not desired here. Option C (`--links`) is not a valid rsync flag; the correct flag is `--hard-links`. Option D disables hardβlink preservation, worsening the problem. Preserving hard links saves space and keeps the backup consistent with the original file structure.)