Linux kernel - can't access sda16 & sda17

Solution 1:

I can overwork this without changing a kernel and with mounting with offset:

$ fdisk -l -u /dev/sda
   Device Boot      Start 
...
/dev/sda16      123456783 ...
/dev/sda17      234567894 ...

$ mount -o ro,offset=$[512*123456783] /dev/sda /mount/sda16
$ mount -o ro,offset=$[512*234567894] /dev/sda /mount/sda17

The problem originates from moving SATA to the SCSI subsystem. SCSI can have only 15 partitions:

http://publib.boulder.ibm.com/infocenter/dsichelp/ds6000ic/topic/com.ibm.storage.smric.help.doc/f2c_linuxdevnaming_2hsag8.html - Linux device naming

By convention, SCSI disks have a maximum of 16 minor numbers mapped to a single disk. Thus, for each whole disk, there is a maximum of 15 partitions per disk because one minor number is used to describe the entire disk (for example /dev/sda), and the other 15 minor numbers are used to refer to partitions for that disk (for example /dev/sda1, /dev/sda2, etc).

So, there is no possibility to create special block devices for 16-th and 17-th partition using mknod, because minor 16 will be next drive, for example:

# ls -l /dev/sda? /dev/sda?? /dev/sdb
brw-rw----  1 root disk  8,   0 May 24 08:09 /dev/sda
brw-rw----  1 root disk  8,   1 May 24 08:09 /dev/sda1
brw-rw----  1 root disk  8,   2 May 24 08:09 /dev/sda2
...
brw-rw----  1 root disk  8,  14 May 24 08:09 /dev/sda14
brw-rw----  1 root disk  8,  15 May 24 08:09 /dev/sda15
brw-rw----  1 root disk  8,  16 May 24 08:09 /dev/sdb

The change was made in Linux kernel version around 2.6.20, according to thread http://forums.justlinux.com/showthread.php?149956-Howto-get-44-logical-partitions-out-of-a-SCSI-SATA-PATA-USB-disk - "Howto get 44 logical partitions out of a SCSI/SATA/PATA/USB disk"

A Linux using 2.6.20 kernel or later now calls every SCSI, Sata, Pata and USB hard disk by the same naming convention, using disk names sda, sdb, sdc, sdd, sde etc. A maximum of 16 device names is now standard for each disk. For the first disk sda the 16 devices names are sda, and sda1 to sda15. The sda1, sda2, sda3 and sda4 are permanently reserved for the 4 primary partitions, even if some of them are not used, and the rest sda5 to sda15 are 11 logical partition names.

This was made by "libata", which implements PATA/SATA on top of SCSI subsystem:

http://kernelnewbies.org/Linux_2_6_19#head-cdcbaa9c1b476decdc064e0a75d23d1328b1ddce

Libata PATA (Parallel ATA) merge By "Parallel ATA" we mean all the ATA/IDE controllers and drives that we have been using for years before SATA. Almost from the start, one of the objectives of some kernel hackers was to replace the IDE drivers available in drivers/ide (everything under the "Device drivers -> ATA/ATAPI/MFM/RLL support" configuration menu) with a reimplementation on top of libata (i.e.: the "SATA layer"). ... This means 2.6.19 may have two drivers for your PATA-based device: The old IDE driver under "Device drivers -> ATA/ATAPI/MFM/RLL support" and an alternative driver under "Device drivers -> Serial ATA (prod) and Parallel ATA (experimental) drivers" (along with the rest of the SATA drivers)

The problem was known as early as 2006: http://www.redhat.com/archives/rhl-list/2006-October/msg00218.html

  1. The SCSI subsystem only allows 15 (I think) partitions on a disk. And with the standard MS-DOS style partition tables, that always includes all four primary partitions. So one primary + eleven logical partitions is the limit.

  2. The libata support for SATA disks uses the SCSI subsystem, and inherits the same limitations.

  3. libata support for IDE (= PATA) has been merged and is scheduled to be available for 2.6.19. It won't be the default set of drivers, and it's very unlikely to become the default during a Fedora Core release, but given Fedora's aims and engineers, I would not be surprised to see this turned on in official Fedora kernels for the FC7 release. (If not, FC8. We're probably talking the next year or so.)

When libata support is turned on for parallel IDE, then existing partitions on IDE devices above /dev/hdx15 will become unmountable.