Hello,

here are two patches for the current grub version (CVS head)
which fix a major problem in disk_io.c and a minor spelling
bug in pc_slice.h. The bug in disk_io.c was introduced after
grub-0.5.93.1.

Problem summary:

grub does not support a file system on an extended partitions.
Tab expansion recognizes the file system correctly, but command
"root" (and others) fail. See grub output logs for details.

Regards,
Stefan Weil


- grub output (CVS head version)
----------------------------------------------

grub> root (hd0,

 Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0x6
   Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 4,  Filesystem type unknown, partition type 0x82
   Partition num: 5,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 6,  Filesystem type is ext2fs, partition type 0x83

grub> root (hd0,6)
 Filesystem type unknown, partition type 0x5

- grub output (after bug fix)
-------------------------------------------------

grub> root (hd0,
 Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0x6
   Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 4,  Filesystem type unknown, partition type 0x82
   Partition num: 5,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 6,  Filesystem type is ext2fs, partition type 0x83

grub> root (hd0,6)
 Filesystem type is ext2fs, partition type 0x83

- fdisk output from Linux
-----------------------------------------------------

bash-2.03$ sudo fdisk
Using /dev/hda as default device!

Command (m for help): p

Disk /dev/hda: 64 heads, 63 sectors, 1023 cylinders
Units = cylinders of 4032 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       254    512032+   6  FAT16
/dev/hda2           255       610    717696   83  Linux
/dev/hda3           611      1023    832608    5  Extended
/dev/hda5           611       643     66496+  82  Linux swap
/dev/hda6   *       644       709    133024+  83  Linux
/dev/hda7           710      1023    632992   83  Linux

- values traced in grub function real_open_partition()
------------------------

slice_no current_slice
0         6
1        83
2         5
3         0
4        82
5         5         <--- real_open_partition(0) returned this entry ...
          0
          0
         83
6         5         <--- ... or this one.
          0
          0
         83
7         0


- patches
---------------------------------------------------------------------

bash-2.03$ cvs -q diff -u
Index: stage2/disk_io.c
===================================================================
RCS file: /gd/gnu/anoncvsroot/grub/stage2/disk_io.c,v
retrieving revision 1.23
diff -u -r1.23 disk_io.c
--- disk_io.c   1999/11/13 09:39:43     1.23
+++ disk_io.c   1999/11/27 21:08:06
@@ -574,6 +574,7 @@
                   *  If we've found the right partition, we're done
                   */
                  if (! flags
+                     && ! IS_PC_SLICE_TYPE_EXTENDED (current_slice)
                      && (part_no == slice_no
                          || (part_no == 0xFF
                              && IS_PC_SLICE_TYPE_BSD (current_slice))))
Index: stage2/pc_slice.h
===================================================================
RCS file: /gd/gnu/anoncvsroot/grub/stage2/pc_slice.h,v
retrieving revision 1.6
diff -u -r1.6 pc_slice.h
--- pc_slice.h  1999/09/13 13:32:31     1.6
+++ pc_slice.h  1999/11/27 21:08:06
@@ -1,4 +1,3 @@
-
 /*
  *  GRUB  --  GRand Unified Bootloader
  *  Copyright (C) 1996   Erich Boleyn  <[EMAIL PROTECTED]>
@@ -122,7 +121,7 @@
   (((type) == PC_SLICE_TYPE_EXTENDED)  \
    || ((type) == PC_SLICE_TYPE_WIN95_EXTENDED))

-/* these ones are special, as they use thier own partitioning scheme
+/* these ones are special, as they use their own partitioning scheme
    to subdivide the PC partitions from there.  */
 #define PC_SLICE_TYPE_FREEBSD          0xa5
 #define PC_SLICE_TYPE_OPENBSD          0xa6

Reply via email to