[parted-devel] [PATCH] Properly sync partitions with operating system

Joel Granados jgranado at redhat.com
Thu Feb 19 16:22:18 UTC 2009


On Thu, Feb 19, 2009 at 05:11:25PM +0100, Karel Zak wrote:
> On Thu, Feb 19, 2009 at 01:55:33PM +0100, Joel Granados wrote:
> > On Thu, Feb 19, 2009 at 12:28:14PM +0100, Petr Uzel wrote:
> > > On Wed, Feb 18, 2009 at 10:01:11PM +0100, Joel Granados Moreno wrote:
> > > > +/* Maximum number of partitions supported by linux. */
> > > > +#define MAX_NUM_PARTS		16
> > > 
> 
>  I think hardcoded Linux limit is 256 for disks with extended
>  partitions, otherwise the limit depends on maximal device minor
>  number (traditional limits are IDE 63 and SCSI 15). For more
>  details see Linux kernel include/linux/genhd.h and
>  Documentation/devices.txt.
> 
> > > I'd suggest to increase this to 64
> 
>  The limit in fdisk(8) is 60 ...don't ask me why :-)
> 
> > > > +static int
> > > > +gpt_get_max_partitoin_count(const PedDisk *disk)
> > > > +{
> > > > +	return 16;
> > > > +}
> > > > +
> > > 
> > > Are you sure about this? I think GPT has no such on the number of
> > > partitions.
> > > 
> > 
> > To be honest, have to do a background check on all the hardcoded number
> > that represent maximum amount of partitions.  If someone has a better
> > value, pls be my guest.
> 
>  The right number according to MS is 128, see:
>  http://www.microsoft.com/whdc/device/storage/GPT-on-x64.mspx
>  http://technet.microsoft.com/en-us/library/cc739412.aspx

Will give these a read..

> 
>  Anyway.. all sane people who need so many partitions use some
>  logical volume/disk manager (include Windows world).

Yep, this is also what I assume of the bat.  but still.  Being more
acqurate than less is better. :)

Also not that this value (MAX_NUM_PARTS) is a fallback value for when we
dont find a sysfs or when /sys/block/DEV/range is not there.

Thx for the review.
> 
>     Karel
> 
> -- 
>  Karel Zak  <kzak at redhat.com>

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.



More information about the parted-devel mailing list