partition table problems, and patch

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

 



I have been having a lot of trouble getting a striped array working on
my Fedora box, first my system:
Gigabyte ga-7vaxp with the MBFastTrack133 Lite chipset (PDC20276)
AMD Athlon XP 2200+ 
512 MB RAM 
2, 200GB Seagate baracuda drive on the PDC202706 configured as a single
striped array 
I have an extra harddrive on the primary controller for booting.

As a side note: The fix applied in one of the 2.4.25-pre kernels fixed a
problem I was having where the kernel couldn't find the raid array
superblock, so if your drives report 255 heads get the latest pre kernel
for the fix.

Once it did recognize the array I went ahead and repartitioned with
fdisk. On exit it gave a somewhat cryptic message about not being able
to re-read the partition table, so I rebooted.

On reboot the kernel hung during the partition check with numerous
messages about not being able to find sector with lba=[some big number].
The kernel found the partition table on the first drive (hde) which was
a valid partition table for the whole array but clearly pointed at
partitions well off the end of the single drive hde.

My solution was to write a kernel patch that adds a kernel 'command line
parameter' that allows the kernel to ignore the partition table for
certain drives by appending something like this:
hde=notable hdg=notable

[BEGIN PATCH:]

diff -urN -X dontdiff linux-2.4.25-pre6/drivers/ide/ide.c
linux-2.4.25-pre6-notable/drivers/ide/ide.c
--- linux-2.4.25-pre6/drivers/ide/ide.c	2004-01-19 12:01:25.000000000
-0500
+++ linux-2.4.25-pre6-notable/drivers/ide/ide.c	2004-01-16
16:59:55.000000000 -0500
@@ -2089,6 +2089,8 @@
  * "hdx=scsi"		: the return of the ide-scsi flag, this is useful for
  *				allowwing ide-floppy, ide-tape, and ide-cdrom|writers
  *				to use ide-scsi emulation on a device specific option.
+ * "hdx=notable"        : Do not attempt to read or interpret a 
+ *                              partition table on this disk.
  * "idebus=xx"		: inform IDE driver of VESA/PCI bus speed in MHz,
  *				where "xx" is between 20 and 66 inclusive,
  *				used when tuning chipset PIO modes.
@@ -2188,7 +2190,7 @@
 		const char *hd_words[] = {"none", "noprobe", "nowerr", "cdrom",
 				"serialize", "autotune", "noautotune",
 				"slow", "swapdata", "bswap", "flash",
-				"remap", "noremap", "scsi", NULL};
+				"remap", "noremap", "scsi", "notable", NULL};
 		unit = s[2] - 'a';
 		hw   = unit / MAX_DRIVES;
 		unit = unit % MAX_DRIVES;
@@ -2254,6 +2256,9 @@
 			case -14: /* "scsi" */
 				drive->scsi = 1;
 				goto done;
+			case -15: /* notable */
+				drive->notable=1;
+				goto done;
 			case 3: /* cyl,head,sect */
 				drive->media	= ide_disk;
 				drive->cyl	= drive->bios_cyl  = vals[0];
diff -urN -X dontdiff linux-2.4.25-pre6/drivers/ide/ide-probe.c
linux-2.4.25-pre6-notable/drivers/ide/ide-probe.c
--- linux-2.4.25-pre6/drivers/ide/ide-probe.c	2003-11-28
13:26:20.000000000 -0500
+++ linux-2.4.25-pre6-notable/drivers/ide/ide-probe.c	2004-01-16
18:01:01.000000000 -0500
@@ -1249,6 +1249,8 @@
 			hwif->channel, unit, hwif->drives[unit].lun);
 		if (hwif->drives[unit].present)
 			hwif->drives[unit].de = devfs_mk_dir(ide_devfs_handle, name, NULL);
+		if (hwif->drives[unit].notable)
+			gd->flags[unit]|=GENHD_FL_NOTABLE;
 	}
 	return;
diff -urN -X dontdiff linux-2.4.25-pre6/fs/partitions/check.c
linux-2.4.25-pre6-notable/fs/partitions/check.c
--- linux-2.4.25-pre6/fs/partitions/check.c	2004-01-19
12:01:28.000000000 -0500
+++ linux-2.4.25-pre6-notable/fs/partitions/check.c	2004-01-16
18:06:58.000000000 -0500
@@ -256,17 +256,22 @@
 	bdev = bdget(kdev_t_to_nr(dev));
 	bdev->bd_inode->i_size = (loff_t)hd->part[MINOR(dev)].nr_sects << 9;
 	bdev->bd_inode->i_blkbits = blksize_bits(block_size(dev));
-	for (i = 0; check_part[i]; i++) {
-		int res;
-		res = check_part[i](hd, bdev, first_sector, first_part_minor);
-		if (res) {
-			if (res < 0 &&  warn_no_part)
-				printk(" unable to read partition table\n");
-			goto setup_devfs;
+	if (hd->flags && 
+           (hd->flags[MINOR(dev) >> hd->minor_shift] &
GENHD_FL_NOTABLE) ) {
+		printk(" ignoring partition table\n");
+	} else {
+		for (i = 0; check_part[i]; i++) {
+			int res;
+			res = check_part[i](hd, bdev, first_sector, first_part_minor);
+			if (res) {
+				if (res < 0 &&  warn_no_part)
+					printk(" unable to read partition table\n");
+				goto setup_devfs;
+			}
 		}
-	}
 
-	printk(" unknown partition table\n");
+		printk(" unknown partition table\n");
+	}
 setup_devfs:
 	invalidate_bdev(bdev, 1);
 	truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
diff -urN -X dontdiff linux-2.4.25-pre6/include/linux/genhd.h
linux-2.4.25-pre6-notable/include/linux/genhd.h
--- linux-2.4.25-pre6/include/linux/genhd.h	2002-11-28
18:53:15.000000000 -0500
+++ linux-2.4.25-pre6-notable/include/linux/genhd.h	2004-01-16
18:01:57.000000000 -0500
@@ -85,6 +85,7 @@
 };
 
 #define GENHD_FL_REMOVABLE  1
+#define GENHD_FL_NOTABLE    2
 
 struct gendisk {
 	int major;			/* major number of driver */
diff -urN -X dontdiff linux-2.4.25-pre6/include/linux/ide.h
linux-2.4.25-pre6-notable/include/linux/ide.h
--- linux-2.4.25-pre6/include/linux/ide.h	2003-11-28 13:26:21.000000000
-0500
+++ linux-2.4.25-pre6-notable/include/linux/ide.h	2004-01-16
18:09:11.000000000 -0500
@@ -747,6 +747,7 @@
 	unsigned ata_flash	: 1;	/* 1=present, 0=default */
 	unsigned dead		: 1;	/* 1=dead, no new attachments */
 	unsigned id_read	: 1;	/* 1=id read from disk 0 = synthetic */
+	unsigned notable	: 1;    /* 1=ignore partition table */
 	unsigned addressing;		/*      : 3;
 					 *  0=28-bit
 					 *  1=48-bit

[END PATCH]

-- 
Kevin Fitch <kevin_fitch@xxxxxxxxx>




[Index of Archives]     [Linux RAID]     [Linux Device Mapper]     [Linux IDE]     [Linux SCSI]     [Kernel]     [Linux Books]     [Linux Admin]     [GFS]     [RPM]     [Yosemite Campgrounds]     [AMD 64]

  Powered by Linux