PATCH: no more hda minor shifts (BSD/Solaris slices)

Heiko Eissfeldt (heiko@colossus.escape.de)
Sat, 21 Feb 1998 14:08:24 +0100 (MET)


Hello world,

As has been discussed here before, hda minors shift,
when BSD disklabel or Solaris partition support is switched on
under Linux using msdos partitions (mostly i386).

If you thus correct your /etc/fstab, and later boot a 2.0.33
kernel, the old mapping is in place again, yielding the
former assignments. What is even more unfortunate is that
(c)fdisk disagrees with 2.1.x kernels wrt the devices, since
(c)fdisk does not know of them (and probably should not).

So I did this patch to append the slices of alien partitions
at the end, leaving the previous mapping intact.

I have tested this patch very lightly (mounting of FreeBSD
partitions/slices works).

Happy hacking, Heiko

The patch is against 2.1.87:

--- drivers/block/genhd.c.or Sat Feb 14 22:37:19 1998
+++ drivers/block/genhd.c Sat Feb 21 13:41:18 1998
@@ -453,9 +453,19 @@
if (hd->part[minor].nr_sects > 2)
hd->part[minor].nr_sects = 2;
}
+ }
+
+#if defined CONFIG_BSD_DISKLABEL || defined CONFIG_SOLARIS_X86_PARTITION
+ /* Heiko Eißfeldt: Add alien slices/partitions at the end
+ (with higher otherwise unused minors). This gives same minors
+ with different configured kernels and fdisk. */
+ p -= 4; minor -= 4;
+ for (i=1 ; i<=4 ; minor++,i++,p++) {
+ if (!NR_SECTS(p))
+ continue;
#ifdef CONFIG_BSD_DISKLABEL
if (SYS_IND(p) == BSD_PARTITION) {
- printk(" <");
+ printk(" <BSD");
bsd_disklabel_partition(hd, MKDEV(hd->major, minor));
printk(" >");
}
@@ -473,6 +483,7 @@
}
#endif
}
+#endif
/*
* Check for old-style Disk Manager partition table
*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu