Bug#542422: Symbolic links in /dev/mapper break grub-probe if root device is handled by device-mapper

M. Vefa Bicakci bicave at superonline.com
Wed Aug 19 17:55:38 UTC 2009


Hello,

I have been "hit" by this bug too, albeit in a different way.
If one's root file-system device node is handled by device-mapper,
then the introduction of the symbolic links into "/dev/mapper" break
"grub-probe" program's detection of the device for the root file-
system. This in turn breaks the "update-grub" script.

To find the cause of this problem, I had a look at grub-common's
source package, and saw the following code in the "find_root_device"
function in "util/getroot.c", which is used by grub-probe:

=== 8< ===
219       if (S_ISLNK (st.st_mode))
220         /* Don't follow symbolic links.  */
221         continue;
222 
...
248           /* Skip device names like /dev/dm-0, which are short-hand aliases
249              to more descriptive device names, e.g. those under /dev/mapper */
250           if (ent->d_name[0] == 'd' &&
251               ent->d_name[1] == 'm' &&
252               ent->d_name[2] == '-' &&
253               ent->d_name[3] >= '0' &&
254               ent->d_name[3] <= '9')
255             continue;
=== >8 ===

So, as you see, if one just provides symlinks to dm-xx device nodes
from /dev/mapper, "grub-probe" and "update-grub" break because of the
assumptions made in GRUB's code.

I wanted to inform you about this problem.

Regards,

M. Vefa Bicakci






More information about the pkg-lvm-maintainers mailing list