Hands-on steps to plan and create partitions with fdisk and get disks ready for filesystems or OS installs 15.11.2025 | reading time: 3 min Use fdisk when you need a small, dependable, interactive partitioning tool that ships on virtually every Linux distro; it is best for quick MBR or GPT edits and for scripting sequences of commands in maintenance scenarios. Quick demonstration Follow this live example to create a 1 GiB primary partition on a spare disk device; run `sudo fdisk /dev/sdb` and interact as shown in the code block then create a filesystem on the new partition; ```sudo fdisk /dev/sdb Command (m for help): o Created a new DOS disklabel. Command (m for help): n Partition type: p Partition number (1-4): 1 First sector (2048-...): (press Enter) Last sector, +sectors or +size{K,M,G,T,P}: +1G Command (m for help): t Selected partition 1 Hex code or alias (type L to list): 83 Command (m for help): w The partition table has been altered. ``` What to watch and use Always back up data and check the target device with `lsblk` or `fdisk -l` before changes; prefer `g` inside fdisk to create a GPT label when handling disks larger than 2 TiB; choose sizes with +size suffixes like +500M or +10G; use the `t` command to set partition type codes and `a` to toggle bootable flags for BIOS boots. When fdisk is not enough Turn to higher level utilities for advanced tasks such as moving partitions, resizing in place, or scripting complex layouts; use those tools when you need GUID partition table features beyond simple creation or when partition alignment for SSDs and RAID must be enforced automatically. Parting thought Practice on a loopback file or a disposable virtual disk until the sequence is second nature; mastering fdisk gives direct control over disk layout and is a foundational skill for any Linux engineer, so keep learning and consider certifying skills with programs like CompTIA Linux+ or LPIC-1 and intensive exam prep at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. setup filesystem utilities storage