PDA

View Full Version : Assumptions in grub affect Kali on boot



Merle
2018-12-28, 19:01
Fought this one for a long time; finally found the problem.
Grub has the underlying assumption that the device (computer) will not change the number and type of devices (drives) available. When Linux is installed and grub installed, by default, it writes the grub boot script configuration (grub.cfg) on the assumption that this device will always be at /dev/sdX, where X is the currently location of the disk (/dev/sda; /dev/sdb; /dev/sdc, etc.)
Kali might be installed to a removable drive (USB / flash media), which might go from computer to computer, with other volumes (disks) added or removed before boot. Therefore, installation "from" a USB device (/dev/sdb), "to" an other USB device (/dev/sdc), writes the grub.cfg to "look for" /dev/sdc1, etc. However, removing the installation volume changes the "installed" volume to then be /dev/sdb. Boot fails because grub is still looking for /dev/sdc.
This is not a Kali bug. It is a grub assumption. But it makes life difficult for people using Kali.
The brute force solution is to manually edit grub.cfg -- which the file very pointedly warns against.
Perhaps the assumption should be revisited?
Merle