Bug 503698 - grub is trying to open /dev/md1261 not /dev/md126p1
Summary: grub is trying to open /dev/md1261 not /dev/md126p1
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: grub
Version: 11
Hardware: i586
OS: Linux
low
high
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-02 09:46 UTC by Jacek Danecki
Modified: 2009-07-27 14:29 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-07-27 14:29:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
qemu screen dump with logs from grub console (69.79 KB, image/jpeg)
2009-06-05 16:36 UTC, Jacek Danecki
no flags Details
PATCH: add support for partitionable md (562 bytes, patch)
2009-07-09 10:36 UTC, Hans de Goede
no flags Details | Diff

Description Jacek Danecki 2009-06-02 09:46:19 UTC
Description of problem:

During installation of Fedora using patches for md installation support in anaconda, grub is trying open root partition with incorrect name. The first partition was created as /dev/md126p1, but grub is trying to open device /dev/md1261.

Version-Release number of selected component (if applicable):
grub-0.97-50.fc11.i586

Steps to Reproduce:
1. Apply patches from anaconda list for md installation support on isw raid1 array for anaconda
2. During installation create root partition on /dev/md126 device
3. Choose installation of grub on MBR of /dev/md126
  
Actual results:
Running... ['/sbin/grub', '--batch', '--no-floppy', '--device-map=/boot/grub/device.map']


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> root (hd0,0)

Error 21: Selected disk does not exist
grub> install --stage2=/boot/grub/stage2 /boot/grub/stage1 d (hd0) /boot/grub/stage2 p (hd0,0)/boot/grub/grub.conf

Error 12: Invalid device requested
grub> 

Expected results:
Grub opens correct device for root partition.

Additional info:

Comment 1 Jacek Danecki 2009-06-05 16:35:19 UTC
I've added some traces to grub source code. Results are shown in attachment.
grub was executed by command: /sbin/grub --device-map=/boot/grub/device.map
File device.map contains line:
(hd0) /dev/md125

Patch for traces for grub 0.97

diff --git a/lib/device.c b/lib/device.c
index 587cc3e..53d3673 100644
--- a/lib/device.c
+++ b/lib/device.c
@@ -1097,6 +1097,9 @@ write_to_partition (char **map, int drive, int partition,
  
+  fprintf(stderr, "\nwrite_to_partition: drive=%d dev=%s", 
+          drive, map[drive]); 
+  
+  fprintf(stdout, "\nwrite_to_partition: drive=%d dev=%s", 
+          drive, map[drive]); 
 
   strcpy (dev, map[drive]);
   if (have_devfs ())
@@ -1116,6 +1119,7 @@ write_to_partition (char **map, int drive, int partition,
   
   /* Open the partition.  */
   fprintf (stderr, "\nopen dev=%s\n", dev);
+  fprintf (stdout, "\nopen dev=%s\n", dev);
   fd = open (dev, O_RDWR);
   if (fd < 0)
     {

Comment 2 Jacek Danecki 2009-06-05 16:36:54 UTC
Created attachment 346680 [details]
qemu screen dump with logs from grub console

Comment 3 Peter Jones 2009-06-08 15:48:20 UTC
This is probably something wrong in grub-install , not in the grub binary itself.

Comment 4 Peter Jones 2009-06-08 15:48:46 UTC
Can you tell which commands are being passed in to grub?

Comment 5 Jacek Danecki 2009-06-08 16:08:08 UTC
The answer is in comment #1
As a workaround I'm creating during installation link /dev/md1261 using command:
ln -s /dev/md126p1 /dev/md1261
in directory /mnt/sysimage/dev

Comment 6 Peter Jones 2009-06-08 17:28:14 UTC
Please don't do it that way.

Comment 7 Jacek Danecki 2009-06-09 08:56:49 UTC
I'm creating this link manually. I'm not adding this workaround to the code.

Comment 8 Bug Zapper 2009-06-09 16:58:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Hans de Goede 2009-07-09 10:36:17 UTC
Created attachment 351034 [details]
PATCH: add support for partitionable md

Here is a patch fixing this.

Comment 10 Jacek Danecki 2009-07-13 17:30:53 UTC
I've checked grub-0.97-54.fc12.i586 and found next problem.
Error: 22r: No such partition

After link md1271 was created problem disappeared.
ln -s /dev/md127p1 /dev/md1271

I'm testing using commands:
/sbin/grub --device-map=/boot/grub/device.map
and then in grub:
root (hd0,0)
setup (hd0)

Comment 11 Jacek Danecki 2009-07-23 10:22:09 UTC
I've checked patch with install command instead of setup and it worked OK.

Comment 12 Hans de Goede 2009-07-27 14:29:14 UTC
grub-0.97-56.fc12 which includes the patch fixing this is on its way to rawhide, closing.


Note You need to log in before you can comment on or make changes to this bug.