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

Re: Problems with limited numbers of partitions



>  The limitation of 16 partitions on a SCSI disk (err, make that 15, since
> the whole-disk device takes up a minor number, too) is determined by the
> device number allocation.

More specific, the kernel uses a certain number of bits in in the minor
number to encode the partition, the rest for the device ID (SCSI target
ID). See blk.h:

--- snip ---
#elif (SCSI_DISK_MAJOR(MAJOR_NR))

#define DEVICE_NAME "scsidisk"
#define TIMEOUT_VALUE (2*HZ)
#define DEVICE_NR(device) (((MAJOR(device) & SD_MAJOR_MASK) << (8 - 4)) +
(MINOR(device) >> 4))
--- snip ---

The SCSI disk minor occupies 6 bits, 4 of which are allocated to the
device ID, and 4 remain for the partitions.

#define DEVICE_NR(device) (((MAJOR(device) & SD_MAJOR_MASK) << (8 - 6)) + (MINOR(device) >> 6))

would give 64 partitions per SCSI disk but only 4 disks on the usual major
8. Remember to change assorted defs in sd.c as well.
Disclaimer: Playing with this looks like a perfect opportunity to shoot
yourself in the foot. Have a recent backup. I wouldn't do it :-)

>  I bet it's really easy to change a non-devfs kernel to use more minors per
> SCSI device, but this problem would go away with devfs.  (It's not hard

How would devfs make this go away? 2.4.4 still has the hardcoded DEVICE_NR
macro used all over sd.c ...

	Michael



Reply to: