grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] grub-install fails on devices with high minor numbers


From: Andrei Borzenkov
Subject: Re: [BUG] grub-install fails on devices with high minor numbers
Date: Fri, 6 Nov 2015 21:26:01 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

06.11.2015 19:08, Tim Walberg пишет:
On some relatively large systems that are used for virtualization,
often containing upwards of 100 virtual machines, we've started running
into issues with GRUB not being able to install on a new virtual machine
(using the typical process of mounting all the VM file systems on the host
and running grub-install under chroot). We've tracked the issue down to this
code, which is clearly erroneous - device minor numbers have been more than
8 bits for quite some time now - in grub-core/osdep/devmapper/getroot.c:

     char *
     grub_util_devmapper_part_to_disk (struct stat *st,
                                   int *is_part, const char *path)
     {
       int major, minor;

       if (grub_util_get_dm_node_linear_info (st->st_rdev,
                                          &major, &minor, 0))
         {
           *is_part = 1;
           return grub_find_device ("/dev",
                                    (major << 8) | minor);         <<<<< 
--------- ERROR!
         }
       *is_part = 0;
       return xstrdup (path);
     }

When we have enough device-mapper devices (including all their partitions)
on a host that the next newly-added set of devices ends up with minor numbers
outside the 8-bit range, this code fails, with the result that grub-install
can't find the devices that it needs to complete the install.

There might be other places in the code where similar assumptions are made.
Someone more familiar with the code would probably be better for tracking
those down. But, this one at least needs to be fixed.



Does attached patch help?

Attachment: devmapper-getroot.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]