19

The device map file /boot/grub/device.map is in this format:

(disk) /dev/device

So, for example, on a system with a floppy and a single SCSI disk, the file would look like this:

(fd0) /dev/fd0
(hd0) /dev/sda

I try to display its content :

cat /boot/grub/device.map 

I get this error: No such file or directory

Is it renamed or it is a new hierarchy of Linux system?

2 Answers 2

25

The device map is not installed by default with grub2. You can create a device map by typing the following into your console:

sudo grub-mkdevicemap

This will put device.map into the /boot/grub directory.

5
  • 1
    how does linux determine the hdX to sdX mapping before grub-mkdevicemap is run ? Feb 7, 2019 at 6:37
  • linux uses whatever the grub boot location is in the grub.cfg 'root' property (or similar). 140.120.7.21/LinuxRef/BootingLinux/Grub2.html Feb 20, 2019 at 2:59
  • @satch_boogie Linux does not rely on the Grub device map, as clearly shown in the Grub manual. It's the other way around. Grub tries to guess the mapping that Linux chooses by itself. In fact, Linux works fine even without Grub installed.
    – jpaugh
    Apr 12, 2020 at 23:18
  • When I run grub-customize, it gives me an error if there's not device.map. Your solution is wonderful. And to generate grub.cfg, it's grub-mkconfig.
    – Quidam
    Apr 27, 2020 at 15:02
  • 1
    But I have the error that says that it's not possible to get the canonical path for /cow when trying grub-mkconfig.
    – Quidam
    Apr 27, 2020 at 15:06
0

Carefully modify /proc/sys/kernel/printk

Set the values to the following (tabs not spaces)

-1  -1  -1  -1

This locks all kernel log levels to zero.

This really cleans up a desktop boot sequence. Not recommended for servers which need these logs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .