[Bug 922673] [NEW] grub install/update boot device /dev/sdap1

Launchpad Bug Tracker 922673 at bugs.launchpad.net
Sat Jan 28 01:14:40 UTC 2012


You have been subscribed to a public bug:

My boot disk in /dev/sdap1 in linux, I was unable to update grub. I tracked the
problem down to grub-probe

./grub-probe -v --device /dev/sdap1 --target=fs_uuid
./grub-probe: info: »/boot/grub/device.map« kann nicht geöffnet werden.
./grub-probe: info: /dev/sdap1 starts from 2048.
./grub-probe: info: opening the device /dev/sda.
./grub-probe: info: the size of /dev/sda is 289406976.
./grub-probe: info: DOS partition 0 starts from 498048.
./grub-probe: info: DOS partition 2 starts from 17773312.
./grub-probe: info: DOS partition 3 starts from 63.
./grub-probe: error: cannot find a GRUB drive for /dev/sdap1.  Check your device.map.

and this is my solution

*** /tmp/hostdisk.c	2012-01-27 16:19:31.380013407 +0100
--- hostdisk.c	2012-01-27 16:54:35.160011194 +0100
***************
*** 1099,1114 ****
        p[6] = '\0';
        return path;
      }
        if ((strncmp ("hd", p, 2) == 0
         || strncmp ("vd", p, 2) == 0
         || strncmp ("sd", p, 2) == 0)
!       && p[2] >= 'a' && p[2] <= 'z')
      {
        /* /dev/[hsv]d[a-z][0-9]* */
        p[3] = '\0';
        return path;
      }

        /* If this is a Xen virtual block device.  */
        if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
      {
--- 1099,1128 ----
        p[6] = '\0';
        return path;
      }
+
        if ((strncmp ("hd", p, 2) == 0
         || strncmp ("vd", p, 2) == 0
         || strncmp ("sd", p, 2) == 0)
!       && p[2] >= 'a' && p[2] <= 'z'
!       && p[3] >= '0' && p[3] <= '9')
      {
        /* /dev/[hsv]d[a-z][0-9]* */
        p[3] = '\0';
        return path;
      }

+       if ((strncmp ("hd", p, 2) == 0
+        || strncmp ("vd", p, 2) == 0
+        || strncmp ("sd", p, 2) == 0)
+       && p[2] >= 'a' && p[2] <= 'z'
+       && p[3] >= 'a' && p[3] <= 'z'
+       && p[4] >= '0' && p[4] <= '9')
+     {
+       /* /dev/[hsv]d[a-z][0-9]* */
+       p[4] = '\0';
+       return path;
+     }
+
        /* If this is a Xen virtual block device.  */
        if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
      {

** Affects: grub (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: bot-comment
-- 
grub install/update boot device /dev/sdap1
https://bugs.launchpad.net/bugs/922673
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to grub in Ubuntu.




More information about the foundations-bugs mailing list