Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't access sda16 sda17 and higher partitions from my linux. This linux is rather debian (very old); kernel 2.6.23. So, I know that so old linux kernel can't access > 16 partitions on single sata disk.

What version of kernel should I use to be able access sda16, sda17 etc? I want to update only a kernel, not a whole Linux distribution.

PS. There is an WindowsNT kernel which can access and format 16, 17 or higher partition, but my intention is to use sda16 and sda17 from linux (I want Linux Kernel).

PPS: dmesg:

sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 sda9 sda10 sda11 sda12 sda13 sda14 sda15 >
sd 2:0:0:0: [sda] Attached SCSI disk
sd 4:0:0:0: [sdb] xxx 512-byte hardware sectors ...

So, there is no mapping of sda16, sda17, ... to sdb. Sdb is the second physical hard drive.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
And of course, the LWN: lwn.net/Articles/199982 "LibATA and PATA drivers, hdparm/sdparm, and partitions" (2006): "Of course, the other big issue is that the traditional IDE interface has allowed for 63 partitions, while SCSI has only allowed for 15." –  osgx Feb 27 at 0:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.