fdisk Command Generator
Generate fdisk commands to view and partition disks
Getting Started with fdisk
## What is fdisk?
`fdisk` views and manipulates disk partition tables (MBR and GPT). It can list partitions and start an interactive session to create, resize, or delete partitions.
## How to Use
1. **Choose List Mode**: For a quick read-only view, enable `-l` to list partition tables. 2. **Enter Device** (optional): Provide a specific device path like `/dev/sda` to inspect one disk. 3. **Copy & Run**: Copy the generated command into your terminal (requires root).
Editing partitions is destructive — always back up data and unmount the disk first.
Common Options
### `-l` List List the partition tables for all detected disks, or for a specific device when one is given. Read-only and safe to run.
### Device argument When a device path (e.g. `/dev/sda`) is supplied without `-l`, fdisk opens an interactive session to edit that disk's partition table.
### Interactive session (no flag) Once inside, you use single-key commands such as `m` (help), `p` (print), `n` (new), `d` (delete), `w` (write and quit), and `q` (quit without saving).
▶How do I list all partitions on the system?
▶How do I safely edit a partition table?
▶Does fdisk -l change anything?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee