Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I partition the HDD with Gparted (from 12.04 installation media), it encounters an error when trying to format partition named sda16. The error message reads:

mkdosfs: Device partition expected, not making filesystem on entire device '/dev/sda16' (use -l to override)

I can see sda16 is present in /dev. (ls -l sda* (selected output displayed))

brw-rw---- 1 root disk   8, 15 Sep 26 15:05 sda15
brw-rw---- 1 root disk 259,  0 Sep 26 15:05 sda16
brw-rw---- 1 root disk   8,  2 Sep 26 15:05 sda2

The strange difference is that all partitions are an 8, except sda16 which is marked 259.

I assume this is an artificial limit set somewhere by Ubuntu, as GPT can have some 128 partitions according to wikipedia.

Thanks.

Update:

After the first answer I tried to add more partitions after the sda16 and that worked without issues. Then I also noticed that sda and sda16 both have 0 (zero) as the second number. Could that be the reason it thinks it is overwriting a partition table as suggested by David Foerster.

brw-rw---- 1 root disk   8,  0 Sep 26 16:32 sda
brw-rw---- 1 root disk   8,  1 Sep 26 16:32 sda1
brw-rw---- 1 root disk   8, 10 Sep 26 16:32 sda10
brw-rw---- 1 root disk   8, 11 Sep 26 16:32 sda11
brw-rw---- 1 root disk   8, 12 Sep 26 16:32 sda12
brw-rw---- 1 root disk   8, 13 Sep 26 16:32 sda13
brw-rw---- 1 root disk   8, 14 Sep 26 15:05 sda14
brw-rw---- 1 root disk   8, 15 Sep 26 16:32 sda15
brw-rw---- 1 root disk 259,  0 Sep 26 16:32 sda16
brw-rw---- 1 root disk 259,  1 Sep 26 16:32 sda17
brw-rw---- 1 root disk 259,  2 Sep 26 16:32 sda18
brw-rw---- 1 root disk   8,  2 Sep 26 15:05 sda2

Cannot answer question, but this is what I found out:

In fact there is only a problem with sda16. Higher numbers can be created and formatted in Ubuntu 12.04 Gparted without issue.

This issue occurs by design. First the meaning of the numbers in the ls -l output: they are a major, minor device number pair. So 8, 10 refers to sda10 here. The usage of these numbers is specified centrally at kernel.org in a devices text.

Put simply: The major number specifies the type of device and the minor number is the "id". Major number 3 is for IDE devices, 8 is for SCSI devices. For HDD devices: the Minor number 0 stands for the complete HDD and the following numbers are the individual partitions.

Add to this that SCSI HDDs are supposed to have a maximum of 15 partitions according to the devices text. And I guess with a possibility to extend to major number 259 in case it exceeds 15. As you can see the number combination for sda16 is 259,0. This combination identifies a whole HDD according to the devices text. And that is why it throws the partition table error.

I believe that to be on the safe side I should not use number combinations that for HDD devices end in 0(zero). As other software probably uses the same specification it could have consequences later as well.

I believe that leaves for one GPT layout HDD a maximum of 2 x 15 partitions.

share|improve this question
    
"I assume this is an artificial limit set somewhere by Ubuntu" nope... it is an msdos thing "Normally you are not allowed to use any 'full' fixed disk devices. mkdosfs will complain and tell you that it refuses to work. Under other OSes this is known as the 'superfloppy' format." <- it is not specific to Ubuntu. –  Rinzwind Sep 26 '13 at 14:33
    
Ok, my assumption was wrong. But maybe I misunderstand you there, sda16 was just a small partition on the HDD. Why would it want to do this "super floppy format" for sda16 only (and now that I tried individually) not for sda17 and sda18. See my update. –  Arvo Sep 26 '13 at 14:58
    
Interesting update. It would make a nice answer. –  David Foerster Sep 26 '13 at 19:29

1 Answer 1

As the author of the question noted, disks and the 16th partition of a disk have the minor device number 0 (source). Contrary to what we know, mkdosfs seems to think, all devices with minor number 0 are disks.

I conclude, that it is generally safe to override that safety measure with -l and format the 16th partition, though other tools may complain as well.

share|improve this answer

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.