LX0-103 · Question #112
In GRUB's configuration file an administrator finds the following line: root (hd1,4) Which of the following is the corresponding device name on a Linux system?
The correct answer is D. /dev/hdb5. GRUB numbers hard disks from 0 and partitions from 0, while Linux names disks alphabetically from 'a' and numbers partitions from 1, requiring an offset conversion.
Question
In GRUB's configuration file an administrator finds the following line:
root (hd1,4) Which of the following is the corresponding device name on a Linux system?
Options
- A/dev/hda4
- B/dev/hda5
- C/dev/hdb4
- D/dev/hdb5
How the community answered
(53 responses)- A8% (4)
- B15% (8)
- C4% (2)
- D74% (39)
Why each option
GRUB numbers hard disks from 0 and partitions from 0, while Linux names disks alphabetically from 'a' and numbers partitions from 1, requiring an offset conversion.
/dev/hda4 is wrong on both counts - hd0 maps to hda (first disk), and partition 4 in GRUB is partition 5 in Linux.
/dev/hda5 uses the correct partition translation (GRUB 4 to Linux 5) but incorrectly maps hd1 to hda instead of hdb.
/dev/hdb4 correctly maps hd1 to hdb but fails to apply the partition offset, treating GRUB's 0-indexed partition 4 as Linux's partition 4 instead of 5.
In GRUB notation, hd1 refers to the second hard disk (Linux: /dev/hdb) because GRUB counts disks starting at 0. The partition number 4 in GRUB also starts from 0, so GRUB partition 4 maps to Linux partition 5 (Linux counts partitions starting at 1). Therefore (hd1,4) translates to /dev/hdb5.
Concept tested: GRUB to Linux device naming convention translation
Source: https://www.gnu.org/software/grub/manual/grub/grub.html#Naming-convention
Topics
Community Discussion
No community discussion yet for this question.