Skip to contentSkip to conversation

Disable partition scan

PATCH In review Hannes Reinecke 3 participants 3 messages Jul 22, 2009 – Aug 5, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Disable partition scan

For some setups (multipath or dmraid) the in-kernel partition scan is pointless as the (block) partitions won't be used anywhere. Worse, it might trigger I/O errors as the partition table might not be accessible (eg for the passive path of a multipath device) or even invalid (eg for RAID0 dmraid).
This patch allows to switch off the in-kernel partition scan by adding 'no_partition_scan' to the kernel commandline. Partitions scan can be allowed for individual disk by echoing a positive number into /sys/block/XXX/range and rescan the disk.

---
 Documentation/kernel-parameters.txt |    5 ++++
 block/genhd.c                       |   41 ++++++++++++++++++++++++++++++++--
 2 files changed, 43 insertions(+), 3 deletions(-)
Documentation/kernel-parameters.txt +5 -0
index d08759a..47bed29 100644
@@ -1424,6 +1424,11 @@ and is between 256 and 4096 characters. It is defined in the file
 	mtdparts=	[MTD]
 			See drivers/mtd/cmdlinepart.c.
 
+	no_partition_scan	[KNL] Inhibit in-kernel partition scan
+			for all block devices. Partition scan can be
+			re-enabled for individual devices by writing
+			a non-zero value in /sys/block/XX/range.
+
 	onenand.bdry=	[HW,MTD] Flex-OneNAND Boundary Configuration
 
 			Format: [die0_boundary][,die0_lock][,die1_boundary][,die1_lock]
block/genhd.c +38 -3

71 lines not on this page · raw message

Signature · 1 line
1.5.3.2
#1 lore raw
Quoted 3 lines · Hannes Reinecke

Worse, it might trigger I/O errors as the partition table might not be accessible (eg for the passive path of a multipath device) or even invalid (eg for RAID0 dmraid).

Not that it removes the need or motivation for this patch but the case of an array partition table being mis-interpreted by the kernel for a RAID member device should no longer trigger I/O errors. Kernels since 2.6.27 should truncate any over-size partitions to the size of the device:

commit ac0d86f5809598ddcd6bfa0ea8245ccc910e9eac

Author: Kay Sievers <[email protected]>
Date:   Wed Oct 15 22:04:21 2008 -0700

block: sanitize invalid partition table entries

We currently follow blindly what the partition table lies about the disk, and let the kernel create block devices which can not be accessed.
Trying to identify the device leads to kernel logs full of:
sdb: rw=0, want=73392, limit=28800
attempt to access beyond end of device
[snip]

I've tested this patch with a few dmraid setups that previously spat I/O errors whenever something probed a member device. Although this isn't exactly a solution it does quiet down the log noise (I'd thought about submitting a patch to dmraid to issue a BLKPG_DEL_PARTITION for each partition on each member device that it discovers but didn't get around to doing anything about it yet).

Regards,
Bryn.

#2 lore raw
Quoted 25 lines · Bryn M. Reeves
Quoted 3 lines · Hannes Reinecke

Worse, it might trigger I/O errors as the partition table might not be accessible (eg for the passive path of a multipath device) or even invalid (eg for RAID0 dmraid).

Not that it removes the need or motivation for this patch but the case of an array partition table being mis-interpreted by the kernel for a RAID member device should no longer trigger I/O errors. Kernels since 2.6.27 should truncate any over-size partitions to the size of the device:

commit ac0d86f5809598ddcd6bfa0ea8245ccc910e9eac

Author: Kay Sievers <[email protected]>
Date:   Wed Oct 15 22:04:21 2008 -0700

block: sanitize invalid partition table entries

We currently follow blindly what the partition table lies about the disk, and let the kernel create block devices which can not be accessed.
Trying to identify the device leads to kernel logs full of:
sdb: rw=0, want=73392, limit=28800
attempt to access beyond end of device
[snip]

Quoted 6 lines

I've tested this patch with a few dmraid setups that previously spat I/O errors whenever something probed a member device. Although this isn't exactly a solution it does quiet down the log noise (I'd thought about submitting a patch to dmraid to issue a BLKPG_DEL_PARTITION for each partition on each member device that it discovers but didn't get around to doing anything about it yet).

We've got that in RHEL/Fedora dmraid already with option "--rm_partitions".

Regards,
Heinz

Quoted 9 lines

Regards,
Bryn.

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel