This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Not able to create more than 7 partitions on the am335x(beaglebone black) based custom board

I am trying to partition eMMC of BBB(am335x) based custom board, I am using sfdisk to do that. I am using following command to do that,

#Partition emmc 
sfdisk -D -H 255 -S 63 -C 467 /dev/mmcblk0 -uM << EOF
,32,C,*
,200,L
,200,L
,,E
,100,L
,60,L
,200,L
;1269,L
;
EOF 

But sfdisk shows following partitions and

# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 3841 MB, 3841982464 bytes
255 heads, 63 sectors/track, 467 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1   *           1           5       40131   c Win95 FAT32 (LBA)
/dev/mmcblk0p2               6          31      208845  83 Linux
/dev/mmcblk0p3              32          57      208845  83 Linux
/dev/mmcblk0p4              58         467     3293325   5 Extended
/dev/mmcblk0p5              58          70      104391  83 Linux
/dev/mmcblk0p6              71          78       64228+ 83 Linux
/dev/mmcblk0p7              79         104      208813+ 83 Linux
/dev/mmcblk0p8             105         266     1301233+ 83 Linux
/dev/mmcblk0p9             267         467     1614501  83 Linux

but I don't see /dev/mmcblk0p8 and /dev/mmcblk0p9. Because of that i am not able to format the /dev/mmcblk0p8. Can anyone suggest what could be the problem ?

is there a limit on creating extended partitions ?

  • Hi Ankur,
    Do you have "SD card" or "USB" interface in your board ?
    If yes, you can follow the same command for that 4GiB SD card and check it.
    Also, you can try the same command in PC for 4GiB SD card/USB.

  • HI Titus,
    I was expecting first reply form you only :)
    Thank you for reply,

    Unfortunately I don't have SD card or USB interface :(

    Regards,
    Ankur
  • Provide the logs when you use that command in your board.
  • # sfdisk -D -H 255 -S 63 -C 467 /dev/mmcblk0 -uM << EOF
    > ,32,C,*
    > ,200,L
    > ,200,L
    > ,,E
    > ,100,L
    > ,60,L
    > ,200,L
    > ;1269,L
    > ;
    > EOF
    Checking that no-one is using this disk right now ...
    [ 4889.774695]  mmcblk0: p1 p2 p3 p4 < p5 p6 p7 >
    OK
    
    Disk /dev/mmcblk0: 467 cylinders, 255 heads, 63 sectors/track
    Old situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
    
       Device Boot Start   End    MiB    #blocks   Id  System
    /dev/mmcblk0p1   *     0+    39-    40-     40131    c  W95 FAT32 (LBA)
    /dev/mmcblk0p2        39+   243-   204-    208845   83  Linux
    /dev/mmcblk0p3       243+   447-   204-    208845   83  Linux
    /dev/mmcblk0p4       447+  3663-  3217-   3293325    5  Extended
    /dev/mmcblk0p5       447+   549-   102-    104391   83  Linux
    /dev/mmcblk0p6       549+   611-    63-     64228+  83  Linux
    /dev/mmcblk0p7       611+   815-   204-    208813+  83  Linux
    /dev/mmcblk0p8       815+  2086-  1271-   1301233+  83  Linux
    /dev/mmcblk0p9      2086+  3663-  1577-   1614501   83  Linux
    New situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
    
       Device Boot Start   End    MiB    #blocks   Id  System
    /dev/mmcblk0p1   *     0+    39-    40-     40131    c  W95 FAT32 (LBA)
    /dev/mmcblk0p2        39+   243-   204-    208845   83  Linux
    /dev/mmcblk0p3       243+   447-   204-    208845   83  Linux
    /dev/mmcblk0p4       447+  3663-  3217-   3293325    5  Extended
    /dev/mmcblk0p5       447+   549-   102-    104391   83  Linux
    /dev/mmcblk0p6       549+   611-    63-     64228+  83  Linux
    /dev/mmcblk0p7       611+   815-   204-    208813+  83  Linux
    /dev/mmcblk0p8       815+  2086-  1271-   1301233+  83  Linux
    /dev/mmcblk0p9      2086+  3663-  1577-   1614501   83  Linux
    Successfully wrote the new partition table
    
    Re-reading the partition table ...
    [ 4890.031774]  mmcblk0: p1 p2 p3 p4 < p5 p6 p7 >
    
    If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
    to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
    (See fdisk(8).)
    

    Here it is.
    Actually sfdisk also reports 7 partitions instead of 8/9 :(

  • Hi Ankur,
    The command seems good,
    I've tried on my linux machine for 4GiB SD card and got the following, also able to mount all the partitions.


    Checking that no-one is using this disk right now ...
    [ 4889.774695] mmcblk0: p1 p2 p3 p4 < p5 p6 p7 >


    It seems, the print is from kernel, so we may need to look into kernel too.

    What is the "sfdisk" command version ?

    On my Linux machine:

    ti@e2e:~/test$ sfdisk --version
    sfdisk from util-linux 2.20.1

    Log:

    ti@e2e:~/test$ sudo sfdisk -D -H 255 -S 62 -C 1023 /dev/sdd -uM << EOF
    > ,32,C,*
    > ,200,L
    > ,200,L
    > ,,E
    > ,100,L
    > ,60,L
    > ,200,L
    > ;1269,L
    > ;
    > EOF
    Checking that no-one is using this disk right now ...
    OK

    Disk /dev/sdd: 1023 cylinders, 255 heads, 62 sectors/track
    Old situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

    Device Boot Start End MiB #blocks Id System
    /dev/sdd1 0 - 0 0 0 Empty
    /dev/sdd2 0 - 0 0 0 Empty
    /dev/sdd3 0 - 0 0 0 Empty
    /dev/sdd4 0 - 0 0 0 Empty
    New situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

    Device Boot Start End MiB #blocks Id System
    /dev/sdd1 * 0+ 38- 39- 39494 c W95 FAT32 (LBA)
    /dev/sdd2 38+ 239- 201- 205530 83 Linux
    /dev/sdd3 239+ 440- 201- 205530 83 Linux
    /dev/sdd4 440+ 3774- 3335- 3414960 5 Extended
    /dev/sdd5 440+ 540- 101- 102734 83 Linux
    /dev/sdd6 540+ 602- 62- 63209 83 Linux
    /dev/sdd7 602+ 802- 201- 205499 83 Linux
    /dev/sdd8 802+ 2076- 1274- 1304294 83 Linux
    /dev/sdd9 2076+ 3774- 1699- 1739069 83 Linux
    Successfully wrote the new partition table

    Re-reading the partition table ...

    If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
    to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
    (See fdisk(8).)
    ti@e2e:~/test$
    ti@e2e:~/test$
    ti@e2e:~/test$
    ti@e2e:~/test$
    ti@e2e:~/test$ sudo fdisk -l

    Disk /dev/sda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0004d7a6

    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 148123647 74060800 83 Linux
    /dev/sda2 148125694 156301311 4087809 5 Extended
    /dev/sda5 148125696 156301311 4087808 82 Linux swap / Solaris

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0000e2a7

    Device Boot Start End Blocks Id System
    /dev/sdb1 2048 957241343 478619648 83 Linux
    /dev/sdb2 957243390 976771071 9763841 5 Extended
    /dev/sdb5 957243392 976771071 9763840 82 Linux swap / Solaris

    Disk /dev/sdd: 3965 MB, 3965190144 bytes
    255 heads, 62 sectors/track, 489 cylinders, total 7744512 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000c2719

    Device Boot Start End Blocks Id System
    /dev/sdd1 * 62 79049 39494 c W95 FAT32 (LBA)
    /dev/sdd2 79050 490109 205530 83 Linux
    /dev/sdd3 490110 901169 205530 83 Linux
    /dev/sdd4 901170 7731089 3414960 5 Extended
    /dev/sdd5 901232 1106699 102734 83 Linux
    /dev/sdd6 1106762 1233179 63209 83 Linux
    /dev/sdd7 1233242 1644239 205499 83 Linux
    /dev/sdd8 1644302 4252889 1304294 83 Linux
    /dev/sdd9 4252952 7731089 1739069 83 Linux
    ti@e2e:~/test$
  • Hi Titus,

    Thank you for reply,
    My sfdisk version "sfdisk from util-linux 2.21.2" which seems to be latest. :)
    Partitions are fine but are you able to format the file system on the /dev/sdd9 and mount the same ?

    Thank you,

    Regards,
    Ankur
  • Thanks to Robert C Nelson who replied my query on Beaglebone black community.
    One of the configuration, MMC_BLOCK_MINORS [=8] was set to 8 which was preventing driver to create more than 8 device files. I changed number and i am able to see all the partitions and respective device files.

    Location:
    │ -> Device Drivers
    │ -> MMC/SD/SDIO card support (MMC [=y])
    │ -> MMC block device driver (MMC_BLOCK [=y])

    Hope this helps some having same problem.
  • Hi Ankur,
    Sounds good.
    Thanks for your update.