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

GRUB2 預設並不會有「device.map」檔案,但可以使用「grub-mkdevicemap」指令來產生出來。