Learn to list, create and alter partitions with the classic Linux disk tool. 12.03.2026 | reading time: 3 min fdisk is the classic command-line tool to inspect and edit disk partition tables on Linux; use it to list devices, create or remove partitions, and prepare disks for filesystems. Hands-on example Try this on a throwaway VM disk to avoid data loss. First list attached disks and existing tables: ```bash sudo fdisk -l Disk /dev/sdb: 10 GiB, 10737418240 bytes Disk model: Virtual Disk /dev/sdb1 2048 20971519 20969472 10G 83 Linux ``` Then create a new partition interactively: ```bash sudo fdisk /dev/sdb Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) Select (default p): p Partition number (1-4, default 1): First sector (2048-..., default 2048): Last sector (..., default ...): Command (m for help): w The partition table has been altered. ``` Key commands you will use Use `sudo fdisk -l` to list tables, and run `sudo fdisk /dev/sdX` to enter the interactive prompt; inside press `m` for help and use `p`, `n`, `d`, `t`, `w` and `q` to print, create, delete, change type, write and quit; after writing run `sudo partprobe` or `sudo partx -a` so the kernel re-reads the table to avoid stale device mappings. Pitfalls and precautions fdisk writes partition tables directly and can destroy data if misused, so stop and back up when unsure; it handles both MBR and modern GPT on current util-linux builds, but for complex GPT operations prefer specialized tools; always ensure no partitions are mounted when you write changes. When to reach for other tools For scripted partitioning use `sfdisk`; for flexible label- and unit-aware editing use `parted`; for advanced GUID Partition Table work choose `gdisk`; use `lsblk` and `blkid` to inspect block devices and existing filesystem signatures before changing anything. Next steps Practice on throwaway disks until the command sequence feels familiar. Next, learn to create filesystems with `mkfs` and to mount partitions; expand your skills and consider formal certification like CompTIA Linux+ or LPIC-1, and use bitsandbytes.academy for intensive exam preparation. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem storage utilities boot-process troubleshooting