Which file tells GRUB the paths of the filesystem partitions in both Linux format and in the GRUB syntax? (Specify the file name only with no path information)
Answer: device.map
题解
GRUB Legacy 的硬盘设备代号从 0 开始,分割区代号从 0 开始;GRUB2 的硬盘设备代号从 0 开始,分割区代号从 1 开始。如果要自行指定硬盘设备在 GRUB 中的代号,使它去对应到我们想对应的 Linux 设备路径,可以设置「/boot/grub/device.map」文件。
「device.map」文件的内容写法如下:
(fd0) /dev/fd0
(hd0) /dev/hda
(hd0) /dev/hda
GRUB2 预设并不会有「device.map」文件,但可以使用「grub-mkdevicemap」指令来产生出来。
