Where to start First steps track · 15 stages
Linux Labs

fdisk and parted — partition a disk

cheat sheet · Ubuntu 24.04 · util-linux 2.39 · parted 3.6 https://lab.dimsanych.ru/en/wiki/fdisk-parted/

Cheat sheet

  • lsblk which disks exist
  • sudo fdisk -l /dev/vdb the disk's partition table
  • sudo parted /dev/vdb print the same with parted
  • sudo parted -s /dev/vdb mklabel gpt new table (wipes the old one)
  • sudo parted -s /dev/vdb mkpart data ext4 1MiB 100%
  • sudo parted /dev/vdb unit MiB print free partitions and free space
  • sudo fdisk /dev/vdb step by step: g, n, w
  • sudo partprobe /dev/vdb kernel re-reads the table

Options

parted has few options; the work is done by commands: mklabel, mkpart, print, rm, resizepart, name. Inside fdisk you type one-letter commands; m lists them. The full lists are in man parted and man fdisk.

Loading…