Partitioning issue with sgdisk

时间:2015-06-25 18:23:50

标签: linux

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 个答案:

答案 0 :(得分:0)

需要在内核配置中启用EFI_PARTITION。启用此功能后,问题就解决了。

由于

答案 1 :(得分:0)

需要在linux内核配置中启用CONFIG_EFI_PARTITION。

制作linux-menuconfig 启用阻止层 - >分区类型 - >选择“EFI GUID分区支持”

通过这种方式可以看到创建的分区被写入磁盘......

如果您计划创建超过8个分区,还需要查看另一个设置。

│ 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])

更改该值最多可支持256个分区...

相关问题