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」指令來產生出來。