HOW ARE PARTITIONS NAMED

Asked by JIMR122783

Actually I was seeking information on the reason for the 1 number offset between sda and hda numbering for the same drive.

Thank you one and all!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu ubiquity Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jim Hutchinson (jphutch) said :
#1

I'm not really sure what you are asking. In general, Linux names partitions like this:

/dev/sda1
/dev/sda2

etc.

The "a" refers to the first drive. If there are two drives, the second one will be /dev/sdb1 and so on.

Knowing where to install means knowing what partitions you have and what's on them. From Ubuntu you can open a terminal and type

sudo fdisk -l

Give your password (nothing shows as you type) and you will see output like this:

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00026af0

   Device Boot Start End Blocks Id System
/dev/sda1 1 36230 291017443+ 83 Linux
/dev/sda2 * 36231 38662 19535040 83 Linux
/dev/sda3 38663 38913 2016157+ 82 Linux swap / Solaris

In order to help you understand where to install you will need to give more info on what you are trying to do (dual boot, just ubuntu, how many drives, what you want to keep, etc.). You should probably include the sudo fdisk -l output as well.

Revision history for this message
steakunderscore (steakunderscore) said :
#2

I'm not sure if this is the correct answer to your question, but it is worth a go.

There is a disk label set on the ext partition which seems to control the name that appears in gnome. For example looking at the partition that stores my music (sda1) and using the 'vol_id' command I get:
henry@gawkgawk:~$ sudo vol_id /dev/sda1
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=493c39b9-fe7a-404d-9b6d-33c1013bef67
ID_FS_UUID_ENC=493c39b9-fe7a-404d-9b6d-33c1013bef67
ID_FS_LABEL=music
ID_FS_LABEL_ENC=music
ID_FS_LABEL_SAFE=music

To set this Label use the 'e2label' command. For example re-naming my music partition to "Music":
henry@gawkgawk:~$ sudo e2label /dev/sda1 Music

This then changes the output too:
henry@gawkgawk:~$ sudo vol_id /dev/sda1
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=493c39b9-fe7a-404d-9b6d-33c1013bef67
ID_FS_UUID_ENC=493c39b9-fe7a-404d-9b6d-33c1013bef67
ID_FS_LABEL=Music
ID_FS_LABEL_ENC=Music
ID_FS_LABEL_SAFE=Music

For more info see the man pages for both vol_id and e2label.

Hope this helps,

Henry

Revision history for this message
Nikolas Poniros (nponiros) said :
#3

i assume that u are talking about the different numbering in linux in general and in grub (linux in general uses sda1 for first hdd first partition and grub uses hd0,0 for the same disk same partition).

i have no idea why it is like that and if there is a specific reason for this. maybe u should ask the grub developers since they are the once with the different numbering

im sorry that i couldnt be more help full..

cheers
Nikolas

Revision history for this message
Colin Watson (cjwatson) said :
#4

If Nikolas' guess at your meaning is correct (I suspect it is), then this has been fixed in GRUB 2; we may switch to that at some point in the future but have not done so yet.

GRUB 2's web page describes this change as follows: "Fix design mistakes in GRUB Legacy, which could not be solved for backward-compatibility, such as the way of numbering partitions." So I don't think there's any point in trying to defend the reasoning for the partition numbering! My guess is that it was either some misguided notion that everything should be counted from zero, or else it was inheritance from the traditional partition numbering on some other operating system.

Can you help with this problem?

Provide an answer of your own, or ask JIMR122783 for more information if necessary.

To post a message you must log in.