Skip to content

Instantly share code, notes, and snippets.

@robertodr
Created September 28, 2022 18:18
Show Gist options
  • Save robertodr/2508aba1aa7a6511e51d336e1455dc0a to your computer and use it in GitHub Desktop.
Save robertodr/2508aba1aa7a6511e51d336e1455dc0a to your computer and use it in GitHub Desktop.
Formatting with `sgdisk`
DISK='/dev/disk/by-id/disk1'

sgdisk --zap-all ${DISK}

# syntax: --new=partnum:start:end
# syntax: --typecode=partnum:{hexcode|GUID}

# EFI system partition
sgdisk --new=1:1M:+1G --typecode=1:EF00 ${DISK}

# Linux LVM 
sgdisk --new=2:0:0 --typecode=2:8E00 ${DISK}

# BIOS boot
sgdisk --set-alignment=1 --new=3:24K:+1000K --typecode=3:EF02 ${DISK}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment