e42.uk Circle Device

 

Quick Reference

sfdisk howto

sfdisk howto

For this howto I will use /dev/nvme0n1 for the disk, this should be changed to whatever disk you would like to partition.

Print Partition Table

sfdisk -l /dev/nvme0n1

Erase all Partitions

label:gpt
label:dos

New EFI Partition (GPT Partition Table)

1M,512M,C12A7328-F81F-11D2-BA4B-00A0C93EC93B,*

New NTFS Partition (GPT)

,,ebd0a0a2-b9e5-4433-87c0-68b6b72699c7,*

Or you can use type=

type=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7

New NTFS Partition (DOS / MBR)

type=7

Example

VMBLKDEV=/dev/sda
VMSWAPSIZE=8192M
# Creating a GPT Partition Table
sfdisk --no-reread ${VMBLKDEV} <<EOF
label:GPT
1M,256M,C12A7328-F81F-11D2-BA4B-00A0C93EC93B,*
,${VMSWAPSIZE},S
,,L
EOF

The above will make:

  • /dev/sda1 256M EFI System partition
  • /dev/sda2 8192M Linux Swap Partition
  • /dev/sda3 Remainder of the disk Linux Partition

References

Quick Links: Techie Stuff | General | Personal | Quick Reference