0
votes

I am trying to partition hard disk using sgdisk. After running the sgdisk partitioning commands i can see that the gpt partition table is getting created but the logical partitions are not getting created. Below are the commands i used.

sgdisk -og /dev/sda

Creating new GPT entries.

sda: sda1

The operation has completed successfully.

sgdisk -n 1:2048:264191 -c 1:"kernel" /dev/sda

Setting name!

partNum is 0

REALLY setting name!

sda: sda1

The operation has completed successfully.

sgdisk -n 2:264192:395263 -c 2:"rootfs" /dev/sda

Setting name!

partNum is 1

REALLY setting name!

sda: sda1

The operation has completed successfully.

sgdisk -n 3:395263:460799 -c 3:"data" /dev/sda

Information: Moved requested sector from 395263 to 395264 in order to align on 2048-sector boundaries.

Setting name!

partNum is 2

REALLY setting name!

sda: sda1 The operation has completed successfully.

sgdisk -p /dev/sda

Disk /dev/sda: 3907029168 sectors, 1.8 TiB

Logical sector size: 512 bytes

Disk identifier (GUID): 1FE36D38-3427-40CC-A0B0-08664DC76C74 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 3907029134 Partitions will be aligned on 2048-sector boundaries

Total free space is 3906570349 sectors (1.8 TiB)

Number Start (sector) End (sector) Size Code Name 1 2048 264191 128.0 MiB 8300 kernel

2 264192 395263 64.0 MiB 8300 rootfs

3 395264 460799 32.0 MiB 8300 data

cat /proc/partitions

major minor #blocks name

8 0 1953514584 sda

8 1 1953514583 sda1

lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1.8T 0 disk

`-sda1 8:1 0 1.8T 0 part

I am using sgdisk version 0.8.10. I am doing this test on an ARM A9 board using initrd image.

thanks

2

2 Answers

0
votes

Need to enable EFI_PARTITION in kernel configuration. With this enabled the issue is fixed.

Thanks

0
votes

Need to enable CONFIG_EFI_PARTITION in linux kernel config.

make linux-menuconfig Enable the block layer –> Partition Types -> Select “EFI GUID Partition Support”

With this able to see partitions created are written to disk...

Also there is another setting need to be looked, if you are in plan of creating more than 8 partitions.

│ Symbol: MMC_BLOCK_MINORS [=8] │
│ Type : integer │
│ Range : [4 256] │
│ Prompt: Number of minors per block device │
│ Defined at drivers/mmc/card/Kconfig:17 │
│ Depends on: MMC [=y] && MMC_BLOCK [=y] │
│ Location: │
│ -> Device Drivers │
│ -> MMC/SD/SDIO card support (MMC [=y]) │
│ -> MMC block device driver (MMC_BLOCK [=y])

Changing the value will support upto 256 partitions...