1Z0-106 practice question 1 of 15

Examine this udev device naming rule which gets processed successfully: makefile KERNEL=="hdb", DRIVER=="ide-disk", SYMLINK+="sparedisk" Which two statements are true?

Full set: 60 questions
Answer options
A: Symbolic link /dev/sparedisk is created linking to /dev/hdb and with an ide-disk device driver, thus overwriting existing symbolic links.
B: The matching device will be named /dev/sparedisk.
C: Symbolic link /dev/sparedisk is created for a device named /dev/hdb which has an ide-disk device driver if such a device is discovered. Correct answer
D: The matching device will have the kernel device name /dev/hdb. Correct answer
E: Symbolic link /dev/sparedisk is created for a device named /dev/hdb or one that has an ide-disk device driver, whichever is discovered first.
Correct Answer:
C. Symbolic link /dev/sparedisk is created for a device named /dev/hdb which has an ide-disk device driver if such a device is discovered.; D. The matching device will have the kernel device name /dev/hdb.
Explanation

The provided udev rule KERNEL=="hdb", DRIVER=="ide-disk", SYMLINK+="sparedisk" is processed based on a set of conditions and an action. The comma separating the key-value pairs acts as a logical AND operator. Therefore, the rule will only trigger if a device event occurs where the kernel-assigned name is "hdb" and the device is using the "ide-disk" driver. The SYMLINK+="sparedisk" directive instructs udev to create a symbolic link named /dev/sparedisk that points to the actual device node, which is /dev/hdb. This does not rename the original device node; it only provides an additional, persistent name.

Why Incorrect

A. The += operator adds a value to a list for the current device; the term "overwriting" is imprecise for how udev manages the /dev namespace.
B. The SYMLINK key creates a symbolic link, it does not rename the device. The NAME key is used for renaming the device node itself.
E. The comma separating match keys in a udev rule implies a logical AND, not an OR. Both conditions must be true for the rule to be applied.

References

1. udev(7) man page: "A rule is a set of one or more key-value pairs. If all keys match their values, the rule is applied... KERNEL==: Match the kernel name for the device... DRIVER==: Match the driver name for the device... SYMLINK=: The name of a symbolic link to be created for the device node." This confirms that all conditions must match (AND logic) and that SYMLINK creates a link, not a rename. (Source: man udev.rules(7) on Oracle Linux 7/8).

2. Oracle Linux 7 Documentation, Administrator's Guide, Chapter 26. Managing Devices with udev, Section 26.2. Udev Rules: "All conditions in a rule must be met for the rule to be applied... The SYMLINK key is used to create a symbolic link to the device node." This official vendor documentation confirms the AND logic of the rule and the function of the SYMLINK key.

3. Red Hat Enterprise Linux 7, Storage Administration Guide, Chapter 5. Managing Storage Devices with udev: "A udev rule is composed of one or more key-value pairs separated by a comma... SYMLINK: create a symbolic link to the device node." As Oracle Linux is derived from RHEL, this source is authoritative and corroborates that the comma implies an AND condition and that SYMLINK creates a link, leaving the original kernel name (/dev/hdb) intact.

Scroll to Top