GNOME Bugzilla – Bug 465664
gparted: allows more than 4 Primary partitions without error
Last modified: 2008-06-18 19:28:01 UTC
Please describe the problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=433871 Here is the fdisk -l Disk /dev/hda: 60.0 GB, 60011642880 bytes 255 heads, 63 sectors/track, 7296 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 1 1307 10498446 7 HPFS/NTFS /dev/hda2 1308 6047 38074050 f W95 Ext'd (LBA) /dev/hda3 6048 7168 9004432+ 83 Linux /dev/hda4 7169 7296 1028160 82 Linux swap / Solaris /dev/hda5 * 1308 1959 5237158+ 83 Linux /dev/hda6 1960 2989 8273443+ 7 HPFS/NTFS /dev/hda7 2990 3758 6176961 b W95 FAT32 /dev/hda8 3826 5989 17382298+ 83 Linux /dev/hda9 5990 6047 465853+ 82 Linux swap / Solaris /dev/hda10 3759 3825 538146 83 Linux I found out that partitioning was a problem when I was unable to obtain a UUID for hda8. What started the problem was when I thought I needed a second swap partition for a program I was testing on a reiserfs partition, I used hda3 and resized it giving me 1 gb for a hda4 swap. I didn't realize that it was creating a primary partiting. below is my new "fixed" partition with fdisk -l Disk /dev/hda: 60.0 GB, 60011642880 bytes 255 heads, 63 sectors/track, 7296 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 1 1307 10498446 7 HPFS/NTFS /dev/hda2 1308 6047 38074050 f W95 Ext'd (LBA) /dev/hda3 6048 7168 9004432+ 83 Linux /dev/hda5 * 1308 1959 5237158+ 83 Linux /dev/hda6 1960 2989 8273443+ 7 HPFS/NTFS /dev/hda7 2990 3758 6176961 b W95 FAT32 /dev/hda8 3826 5989 17382298+ 83 Linux /dev/hda9 5990 6047 465853+ 82 Linux swap / Solaris /dev/hda10 3759 3825 538146 83 Linux Now I was able to reinstall my debian sid sidux 2.6.21.3-slh-smp-4 #1 SMP and obtain the UUID for hda8ls -l /dev/disk/by-uuid total 0 lrwxrwxrwx 1 root root 10 2007-07-19 03:40 4f10b5bc-b440-4163-8ba3-5eb254cc453e -> ../../hda8 lrwxrwxrwx 1 root root 10 2007-07-19 03:40 6030699C30697A44 -> ../../hda6 lrwxrwxrwx 1 root root 10 2007-07-19 03:40 85980fe3-d6f9-4f0e-9c51-ce2f8061d602 -> ../../hda3 lrwxrwxrwx 1 root root 10 2007-07-19 03:40 a1de3a1e-3a3a-4852-b535-465ef3535b26 -> ../../hda7 lrwxrwxrwx 1 root root 10 2007-07-19 03:40 aee162b2-9f32-47ca-9095-ac1e0371a60b -> ../../hda9 lrwxrwxrwx 1 root root 10 2007-07-19 03:40 D298BC0498BBE4DF -> ../../hda1 lrwxrwxrwx 1 root root 10 2007-07-19 03:40 e0a5b570-425c-4af2-950b-bd8adea5010e -> ../../hda5 lrwxrwxrwx 1 root root 11 2007-07-19 03:40 f072b934-b9b3-46ad-828d-264b8e7e2df0 -> ../../hda10 Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Hi Mike, My name is Curtis Gedak and I am the new C++ developer for GParted. So far I have been unsuccessful in recreating the problem you described. Would you be able to provide the steps you took to arrive at this problem? HYPOTHESIS ========== My guess is that more than 4 primary partitions were NOT created. The problem is simply that the "ls -l /dev/disk/by-uuid" does not list the UUID until after the system has been rebooted. Following are the steps I attempted: ATTEMPT A ========= First attempt to recreate the problem. 1) Started with an blank drive with an MSDOS partition table 2) Created partitions to fill the drive: a) Primary - hda1 b) Extended - hda2 with sub partitions hda5, hda6, hda7 c) Primary - hda3 d) Primary - hda4 Drive Layout: |-- hda1 --|-- hda2 --|------- hda3 -------|-- hda4 --| /||\ [- hda5 -|- hda6 -|- hda7 -] 3) Shrunk hda3 by 1 GB (dragged right edge of hda3 to the left) 4) Applied partition operations Drive Layout: |-- hda1 --|-- hda2 --|-- hda3 --|=========|-- hda4 --| /||\ [- hda5 -|- hda6 -|- hda7 -] 5) Tried to create a new partition in the free space (shown above by the equal '=' signs), but a dialog popped up with the text: "It is not possible to create more than 4 primary partitions" NOTE: This is correct. Only 4 primary partitions should be allowed for an MSDOS partition table. An extended partition is a special type of primary partition that permits logical partitions to be created within. ATTEMPT B ========= I also tried to recreate the problem with by re-doing step 3, but with shrinking from the start of the partition. 1) Started with an blank drive with an MSDOS partition table 2) Created partitions to fill the drive: a) Primary - hda1 b) Extended - hda2 with sub partitions hda5, hda6, hda7 c) Primary - hda3 d) Primary - hda4 Drive Layout: |-- hda1 --|-- hda2 --|------- hda3 -------|-- hda4 --| /||\ [- hda5 -|- hda6 -|- hda7 -] *3) Shrunk hda3 by 1 GB (dragged left edge of hda3 to the right) *** This takes a much longer time to resize *4) Applied partition operation Drive Layout: |-- hda1 --|-- hda2 --|=========|-- hda3 --|-- hda4 --| /||\ [- hda5 -|- hda6 -|- hda7 -] *5) Tried to create a new partition in the free space, but again a dialog popped up with the text: "It is not possible to create more than 4 primary partitions" NOTE: This is as it should be for an MSDOS partition table ATTEMPT C ========= Next I tried growing the extended partition to use this adjacent space with the following steps: 1) Started with an blank drive with an MSDOS partition table 2) Created partitions to fill the drive: a) Primary - hda1 b) Extended - hda2 with sub partitions hda5, hda6, hda7 c) Primary - hda3 d) Primary - hda4 Drive Layout: |-- hda1 --|-- hda2 --|------- hda3 -------|-- hda4 --| /||\ [- hda5 -|- hda6 -|- hda7 -] *3) Shrunk hda3 by 1 GB (dragged left edge of hda3 to the right) *** This takes a much longer time to resize **4) Applied partition operation Drive Layout: |-- hda1 --|-- hda2 -----------|-- hda3 --|-- hda4 --| /||\ [- hda5 -|- hda6 -|- hda7 -|========] **5) Created new linux-swap partition in the empty space. **6) Applied partition operation Drive Layout: |-- hda1 --|-- hda2 -----------|-- hda3 --|-- hda4 --| /||\ [- hda5 -|- hda6 -|- hda7 -|- hda8 -] **7) Checked for UUID ls -l /dev/disk/by-uuid | grep hda8 Results: <empty> NOTE: This may have been what you saw. However, a UUID has been set for the partition as can be seen by using the "vol_id" command. The ls command will also show the UUID after a reboot. vol_id /dev/hda8 Results: ID_FS_USAGE=other ID_FS_TYPE=swap ID_FS_VERSION=2 ID_FS_UUID=d0362f8e-1ee9-400c-bf76-e46b0d1bfc5c ID_FS_UUID_ENC=d0362f8e-1ee9-400c-bf76-e46b0d1bfc5c ID_FS_LABEL= ID_FS_LABEL_ENC= ID_FS_LABEL_SAFE= NOTE: From above a UUID can be seen in the ID_FS_UUID entry. CONCLUSION ========== GParted appears to be working as expected. It correctly limits MSDOS partition tables to 4 primary partitions, and a UUID is set for new linux-swap partitions. Regards, Curtis Gedak
As I have been unable to create more than 4 primary partitions for an MS-DOS Master Boot Record partition table, I am closing this bug. If anyone is able to get GParted to create more than 4 primary partitions, then please feel free to either re-open this bug, or create a new bug and include how you did it.