Partition Table/Master Boot Record: Logical/ExtendedContinuing with the CHS model, we can achieve more than four partitions by utilizing extended partitions within a primary partition. Extended partitions are also known as logical partitions, and they can only exist within a primary partition with an extended flag, also known as a partition type (05) set. In the following example, partition 1 is defined as "extended," as depicted by the fact that byte 1C2's value is equal to "05." We then define partition 1 to occupy 39690 sectors and contain two logical partitions. [root@localhost root]# cfdisk -P rst /dev/hde Disk Drive: /dev/hde Sector 0: 0x000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ~~~~~ 0x190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 0x1C0: 01 00 05 0E 3F 29 3F 00 00 00 CB 9A 00 00 00 00 0x1D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA Sector 63: 0x000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ~~~~~~ 0x1A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 02 0x1C0: 01 00 83 0E 3F 14 3F 00 00 00 07 4D 00 00 00 00 0x1D0: 01 15 05 0E 3F 29 46 4D 00 00 85 4D 00 00 00 00 0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA Sector 19845: 0x000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ~~~~~~ 0x1A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 0x1C0: 01 15 83 0E 3F 29 3F 00 00 00 46 4D 00 00 00 00 0x1D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA Partition Table for /dev/hde First Last # Type Sector Sector Offset Length Filesystem Type (ID) Flags -- ------- -------- --------- ------ --------- ---------------- --------- 1 Primary 0 39689 63 39690 Extended (05) None (00) 2 0x00 0 0 0 0x00 0 0 0 0 0 3 0x00 0 0 0 0x00 0 0 0 0 0 4 0x00 0 0 0 0x00 0 0 0 0 0 5 Logical 63* 19844 63 19782* Linux (83) Boot (80) 6 Logical 19845 39689 63 19845 Linux (83) None (00) Pri/Log 39690 12594959 0 12555270 Free Space None (00) Partition Table for /dev/hde ---Starting--- ----Ending---- Start Number of # Flags Head Sect Cyl ID Head Sect Cyl Sector Sectors -- ----- ---- ---- ---- ---- ---- ---- ---- -------- --------- 1 0x00 1 1 0 0x05 14 63 41 63 39627 5 0x80 2 1 0 0x83 14 63 20 63 19719 6 0x00 1 1 21 0x83 14 63 41 63 19782 A few items about logical partitions need to be noted. Notice how primary partitions are represented with numeric values 1, 2, 3, and 4, whereas logical partitions are represented with numeric values 5 and greater. In addition, notice the location of the bootable partition. We set the logical partition number to 5 for the boot device. When using LILO, this boot configuration will fail with old versions of LILO due to the 1024 sector limit. This limitation on LILO has been removed and never existed on GRUB. Scenario 6-2: Multiple Partitions Exist, but fdisk Only Reports a Single PartitionAs previously discussed, primary and extended partitions can be displayed through cfdisk, fdisk -l, or another tool. However, with Linux on IA64, fdisk reports only a primary partition. In the following example, we depict multiple partitions with extensible firmware interface (EFI), and fdisk reports only a single partition. [root@atlorca2 root]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda2 32891620 6077808 25143012 20% / /dev/sda1 102182 4598 97584 5% /boot/efi none 2067344 0 2067344 0% /dev/shm [root@atlorca2 root]# fdisk -l /dev/sda Disk /dev/sda: 36.4 GB, 36420075520 bytes 255 heads, 63 sectors/track, 4427 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 4428 35566479+ ee EFI GPT fdisk reports only a single partition because the Global Unique Identification (GUID) Partition Table (or GPT) is used with the extensible firmware interface (EFI) on IA64. Before we go into detail about the solution, let's discuss EFI for a moment. EFI is nothing more than a firmware interface for the system's firmware (BIOS) that has the capability to call an OS's bootloader. A complete history can be found at http://developer.intel.com/technology/efi/efi.htm. Now let's proceed to the solution. Solution 6-2You can use other tools to review the partition table, such as partx, partx /dev/sda # 1: 34- 204833 ( 204800 sectors, 104 MB) # 2: 204834- 67036926 ( 66832093 sectors, 34218 MB) # 3: 67036927- 71132926 ( 4096000 sectors, 2097 MB) or parted, as shown in the following example: parted GNU Parted 1.6.3 Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software, covered by the GNU General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Using /dev/sda (parted) p Disk geometry for /dev/sda: 0.000-34732.890 megabytes Disk label type: gpt Minor Start End Filesystem Name Flags 1 0.017 100.016 fat16 boot 2 100.017 32732.874 ext3 3 32732.875 34732.874 linux-swap (parted) ? check MINOR do a simple check on the filesystem cp [FROM-DEVICE] FROM-MINOR TO-MINOR copy filesystem to another \ partition help [COMMAND] prints general help, or help on COMMAND mklabel LABEL-TYPE create a new disklabel (partition table) mkfs MINOR FS-TYPE make a filesystem FS-TYPE on partition MINOR mkpart PART-TYPE [FS-TYPE] START END make a partition mkpartfs PART-TYPE FS-TYPE START END make a partition with a \ filesystem move MINOR START END move partition MINOR name MINOR NAME name partition MINOR NAME print [MINOR] display the partition table, or a \ partition quit exit program rescue START END rescue a lost partition near START and \ END resize MINOR START END resize filesystem on partition MINOR rm MINOR delete partition MINOR select DEVICE choose the device to edit set MINOR FLAG STATE change a flag on partition MINOR |