Page 1 of 1

#1 Cannot create more than 11 raw devices. WTF?

Posted: Sun Oct 15, 2006 10:34 pm
by Kreshna Aryaguna Nurzaman
Well, just like in my previous post (this and [http://www.libriumarcana.com/phpBB2/vie ... php?t=3040]this[/url]), I'm still struggling with my RHEL 4 ES, installed on VMWare 5.5.1.

The virtual machine has 1024 Mb of RAM, while the server itself (where the virtual machine resides) has 1.5 Gb of RAM. The hard drive space allocated for the VMWare virtual machine is about 10 Gb.


I created twelve logical partition on an extended partition (/dev/sda5 to /dev/sda/16). The partition table is shown below:

Code: Select all

Command (m for help): p

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         653     5245191   83  Linux
/dev/sda2             654         914     2096482+  82  Linux swap
/dev/sda3             915        1305     3140707+   5  Extended
/dev/sda5             915         946      257008+  83  Linux
/dev/sda6             947         978      257008+  83  Linux
/dev/sda7             979        1010      257008+  83  Linux
/dev/sda8            1011        1042      257008+  83  Linux
/dev/sda9            1043        1074      257008+  83  Linux
/dev/sda10           1075        1106      257008+  83  Linux
/dev/sda11           1107        1138      257008+  83  Linux
/dev/sda12           1139        1170      257008+  83  Linux
/dev/sda13           1171        1202      257008+  83  Linux
/dev/sda14           1203        1234      257008+  83  Linux
/dev/sda15           1235        1266      257008+  83  Linux
/dev/sda16           1267        1305      313236   83  Linux

Then, using /etc/sysconfig/rawdevices, I mapped the raw devices accordingly:

Code: Select all

# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:  <rawdev> <major> <minor>
#          <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sda5
/dev/raw/raw2 /dev/sda6
/dev/raw/raw3 /dev/sda7
/dev/raw/raw4 /dev/sda8
/dev/raw/raw5 /dev/sda9
/dev/raw/raw6 /dev/sda10
/dev/raw/raw7 /dev/sda11
/dev/raw/raw8 /dev/sda12
/dev/raw/raw9 /dev/sda13
/dev/raw/raw10 /dev/sda14
/dev/raw/raw11 /dev/sda15
/dev/raw/raw12 /dev/sda16

Naturally, the next thing I did was rebooting the system and executed raw -qa to query the raw devices. Oddly, all I got was only eleven raw devices instead of ten:

Code: Select all

[root@kreshna-redhat ~]# raw -qa
/dev/raw/raw1:  bound to major 8, minor 5
/dev/raw/raw2:  bound to major 8, minor 6
/dev/raw/raw3:  bound to major 8, minor 7
/dev/raw/raw4:  bound to major 8, minor 8
/dev/raw/raw5:  bound to major 8, minor 9
/dev/raw/raw6:  bound to major 8, minor 10
/dev/raw/raw7:  bound to major 8, minor 11
/dev/raw/raw8:  bound to major 8, minor 12
/dev/raw/raw9:  bound to major 8, minor 13
/dev/raw/raw10: bound to major 8, minor 14
/dev/raw/raw11: bound to major 8, minor 15
Well, that was certainly odd; where the fuck is /dev/raw/raw12?? :evil:


Then I rebooted the system and examined the booting messages, and here's what I got:

Code: Select all

           /dev/raw/raw1 --> /dev/sda5
/dev/raw/raw1: bound to major 8, minor 5
           /dev/raw/raw2 --> /dev/sda6
/dev/raw/raw2: bound to major 8, minor 6
           /dev/raw/raw3 --> /dev/sda7
/dev/raw/raw3: bound to major 8, minor 7
           /dev/raw/raw4 --> /dev/sda8
/dev/raw/raw4: bound to major 8, minor 8
           /dev/raw/raw5 --> /dev/sda9
/dev/raw/raw5: bound to major 8, minor 9
           /dev/raw/raw6 --> /dev/sda10
/dev/raw/raw6: bound to major 8, minor 10
           /dev/raw/raw7 --> /dev/sda11
/dev/raw/raw7: bound to major 8, minor 11
           /dev/raw/raw8 --> /dev/sda12
/dev/raw/raw8: bound to major 8, minor 12
           /dev/raw/raw9 --> /dev/sda13
/dev/raw/raw9: bound to major 8, minor 13
           /dev/raw/raw10 --> /dev/sda14
/dev/raw/raw10: bound to major 8, minor 14
           /dev/raw/raw11 --> /dev/sda15
/dev/raw/raw11: bound to major 8, minor 15
           /dev/raw/raw12 --> /dev/sda16
Cannot locate block device '/dev/sda16' (No such file or directory)
Cannot locate block device '/dev/sda16' (No such file or directory). Huh? WTF was that supposed to mean? When I query the partitions using fdisk, there is the /dev/sda16 partition. Why mapping it into raw device fails?


Oh, by the way, I'm not really sure whether it's irrelevant or not, but I also got this message when booting Linux:

Code: Select all

Uncompressing Linux... Ok, booting the kernel.
PCI: Cannot allocate resource region 4 of device 0000:00:07.1
audit(1160997070.293:0) initialized
Red Hat nash version 4.1.18 starting
sda: asking for cache data failed
sda: assuming drive cache: write through
INIT: version 2.85 booting
...etcetera.

#2

Posted: Sun Oct 15, 2006 10:53 pm
by Destructionator XV
A little googling points me to something that seems relevant:
IBM linka
SCSI disk devices have special device files that start with an ‘sd’ prefix, and have the following naming format:
/dev/sd[a-z][a-z][1-15]
Names without a trailing digit refer to the whole disk, while names with a trailing digit refer to a partition of that whole disk. 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). Figure 1 displays the device files for the whole disk /dev/sda, which has a major number of 8 and a minor number of 0, and its 15 partitions.
The bolded part is what is more relevant here.

If that is right, you should also not be able to mount the 16th partition, and there would be no way around it without some serious kernel hacking.

#3

Posted: Sun Oct 15, 2006 11:07 pm
by Kreshna Aryaguna Nurzaman
By convention, SCSI disks have a maximum of 16 minor numbers mapped to a single disk.
Ah, I see! So the limitation is the number of logical partitions in a single disk, am I correct? If I'm to create more than 16 partition (say, 20), then I'll need more than single disk (for instance, 1 to 15 on /dev/sda, 16 to 20 on /dev/sdb), am I correct?

Thanks!

By the way, haven't I told you how I hate development server so much?

#4

Posted: Mon Oct 16, 2006 9:43 am
by Destructionator XV
Kreshna Aryaguna Nurzaman wrote:Ah, I see! So the limitation is the number of logical partitions in a single disk, am I correct?
Yeah, it looks that way.
If I'm to create more than 16 partition (say, 20), then I'll need more than single disk (for instance, 1 to 15 on /dev/sda, 16 to 20 on /dev/sdb), am I correct?
Yup. If you have the extra disks to use, that should work.