[parted-devel] partprobe gives errors with dvh partition no. >16

Bryn M. Reeves bmr at redhat.com
Tue Jun 24 13:41:52 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Petr Uzel wrote:
> Then run partprobe:
> ========================================================================
> foxbat:~ # partprobe -s /dev/sdb
> Error: Error informing the kernel about modifications to 
> partition /dev/sdb17 -- Invalid argument.  This means Linux won't know about 
> any changes you made to /dev/sdb17 until you reboot -- so you shouldn't mount 
> it or use it in any way before rebooting.
> /dev/sdb: dvh partitions 9 <17>
> ========================================================================
> 
> I think that the problem is in function _disk_sync_part_table() in 
> libparted/arch/linux.c. When determining last partition which is to be 
> removed/added, PED_MIN() has to be used instead of PED_MAX(). This ensures 
> that it would be never done for partition with number greater than 16.

This does look like a bug - we shouldn't be trying to use a partition
number greater than 16 here, at least, not for a Linux SCSI disk. Thanks
for the report!

I'm not sure of the best fix right now as just switching to PED_MIN may
break some setups that are currently working (e.g. the Linux IDE minor
numbering scheme allows up to 63 partitions per device (not that that is
a good idea anyway...)) and that would be broken by such a change.

> Same problem (if it is actually a problem) is in _dm_reread_part_table().

I don't think this one is a problem. Device-mapper devices don't use the
in-kernel partitioning code (dm "partitions" are normally created as new
dm maps by the userspace kpartx tool), so they don't suffer the same
numbering limitations.

I'll do some tests to make sure this is OK though but if anything I
think the bug here is limiting dm devices to a maximum number of
partitions at all (although some "sane" upper limit is probably still
wise!).

Regards,
Bryn.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFIYPmg6YSQoMYUY94RAtzTAJsFOx3EAyCeSNhBQWzEe1WOrLBHFwCgo2pH
gwdrZtte8hs3auacbbCIono=
=4OTR
-----END PGP SIGNATURE-----



More information about the parted-devel mailing list