Basic Partitioning
Primary, Extended, and Logical partitions
Primary partitions: The original partitioning scheme for PC hard disks allowed only four partitions, thus you are allowed up to 4 primary partitions. Linux numbers primary partitions 1-4.
Note: Some OSs (Windows, BSD) can ONLY be installed into a PRIMARY partition.
Linux (and swap) can be installed into a primary or logical partition.
Extended and Logical partitions: To overcome this limitation, extended partitions are used. A single primary partition may "converted" into an "extended" partition which is then further divided into sub-partitions called logical partitions. Sorry you may not convert more then 1 primary partition into an extended partition. You then create logical partitions within the extended partition. It may be possible to create further extended partitions within an extended partition, although this becomes complicated and I am not sure of any advantage this offers.
Linux numbers Logical partitions starting with 5: The numbers 1,2,3 and 4 are reserved for the primaries, even if you have just one primary partition. So if you make one primary partition and one extended extended partition with one logical partition:
The primary would be hda1
The entire extended partition (and any logical partition(s) it contains) would be hda2.
The logical partition within the extended partition would be hda5.
Clear as mud ?
Naming of partitions
Windows: Windows uses lettering (c:\ ; e:\ , etc) for identifying partitions, regardless of which physical drive or partition, floppy devices, usb devices, CDROM/DVD, and networked shared drives.
Linux: Linux uses /dev/hdxy or /dev/sdxy (see below) to refer to the physical partition. In order to have access to the contents of a partition it must be mounted.
x will be a letter starting with a, then b,c,....
y will be a number starting with 1, then 2,3,....
Thus hda1 = First partition on the master HD.
GRUB: Grub uses the format (hdx,y) where x = hard drive and y = partition.
Grub numbers drives starting with 0.
Grub also names partitions starting with 0.
Thus grub (hd0,0) = Linux hda1 or sda1 (depending on if you have ATA, SATA, or SCSI drives).
Examples of partition names
In this example I will use a single hard drive at the first, or master position, with several primary and logical partitions (3 Primary + a single Extended partition which, as above, is divided into 3 logical Partitions.)
Note: (Linux device) Names without a trailing digit refer to the whole disk, while names with a trailing digit refer to a partition of that whole disk.
Using hda as an example with multiple partitions:
/dev/hda = Entire HD
3 primary partitions:
/dev/hda1 = First partition = GRUB (hd0,0) = Windows C:\
/dev/hda2 = Second partition = GRUB (hd0,1) = Windows E:\
/dev/hda3 = Third partition = GRUB (hd0,2) = Windows F: \
3 logical partitions (Note you can have more then 3 logical partitions within an extended partition:
Note: /dev/hda4 = Entire Extended partition. hda4 is "theoretical" in that it can not be mounted as such, but it "takes up a number".
This is true for both Linux and grub speak !
/dev/hda5 = fourth partition = GRUB (hd0,4) = Windows G:\
/dev/hda6 = fifth partition = GRUB (hd0,5) = Windows H:\
/dev/hda7 = sixth partition = GRUB (hd0,6) = I:\
HD vs SD
IDE/ATA cable = hdxy
1. Hard Drives
/dev/hda = Entire first HD, master drive on primary IDE cable.
/dev/hda1 = First partition on master drive.
/dev/hdb = Entire second HD, slave drive on primary IDE cable.
2. CDROM/DVD
/dev/hdc = Master CD on secondary IDE cable = Windows D:\
/dev/hdd = Slave CD on secondary IDE cable
SCSI devices = sdxy
1. SATA HD
2. SCSI HD
3. Zip drives
Note: Although they contain only 1 partition, zip drives are numbered "4".
ie /dev/sda4.
4. USB devices- both flash drives and hard drives.
5. Firewire devices.
Floppy
/dev/fd0 = First Floppy Drive = Windows A:\
CategoryInformation
There is one comment on this page. [Display comment]