101-500 practice question 8 of 30
Creating a hard link to an ordinary file returns an error. What could be the reason for this?
Full set: 246 questionsA hard link is an additional directory entry that points to the same inode as the original file. Inodes are data structures that store information about files and are unique only within a single filesystem. Because an inode number from one filesystem has no meaning on another, a hard link cannot be created across different filesystems. Attempting to do so results in an "Invalid cross-device link" error.
A: Hidden files (names starting with a dot) are functionally regular files and can be hard-linked without issue. B: File permissions do not affect the ability to create a hard link, as this operation only modifies directory data. C: A shell script is a regular text file and can be hard-linked just like any other ordinary file. D: A file can have many hard links. Creating an additional hard link to a file that already has one is a valid operation.
1. The ln(2) system call man page (from The Linux man-pages project): "EXDEV: oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple points, but link() does not work across different mount points, even if the same filesystem is mounted on both.)"
2. Red Hat Enterprise Linux 8 Documentation, "Configuring and managing storage devices", Section 9.1.3. "Understanding hard links": "A hard link cannot span across file systems."
3. Arpaci-Dusseau, R. H., & Arpaci-Dusseau, A. C. (2018). Operating Systems: Three Easy Pieces. Arpaci-Dusseau Books. Chapter 40, "Files and Directories", Section 40.3, page 7: "Hard links are generally not allowed to span file systems".
Keep practicing
Take the free 101-500 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 101-500 practice questions
- Question 1Which of the following commands prints a list of available package updates when using RPM…
- Question 2Which of the following commands changes the number of days before the ext3 filesystem on …
- Question 3During a system boot cycle, what program is executed after the BIOS completes its tasks?
- Question 4Which of the following commands reboots the system when using SysV init? (Choose TWO corr…
- Question 5Which of the following commands updates the linker cache of shared libraries?
- Question 6Which of the following commands can be used to create a USB storage media from a disk ima…
