-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux fdisk Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to fdisk on Linux, covering Arch Linux, CachyOS, and other distributions including disk partitioning, creating partitions, and partition management.
fdisk is disk partition manipulator.
Uses:
- Create partitions: Make new partitions
- Delete partitions: Remove partitions
- Modify partitions: Change partition properties
- View partitions: List partition table
Warning:
- Data loss: Can erase data
- Backup first: Always backup important data
- Be careful: Double-check before writing
Find disk:
# List block devices
lsblk
# Or
fdisk -lOpen disk:
# Open disk for editing
sudo fdisk /dev/sda
# Interactive mode
# Type 'm' for helpSteps:
# Start fdisk
sudo fdisk /dev/sda
# Create new partition
n
# Choose partition type
# p = primary, e = extended
# Partition number
# Enter number or press Enter
# First sector
# Press Enter for default
# Last sector
# Enter size (e.g., +10G) or press EnterApply changes:
# In fdisk
w
# Write partition table and exitList partitions:
# In fdisk
p
# Print partition tableRemove partition:
# In fdisk
d
# Select partition number
# Enter numberModify type:
# In fdisk
t
# Select partition
# Enter hex code for typeUpdate system:
# Reload partition table
sudo partprobe /dev/sda
# Or rebootCheck disk:
# Check disk
sudo fdisk -l /dev/sda
# Verify partition table
sudo sfdisk -V /dev/sdaThis guide covered fdisk usage, partition creation, and disk management for Arch Linux, CachyOS, and other distributions.
- Disk Utilities - Disk tools
- Filesystem Management - Filesystem setup
- lsblk Guide - List devices
-
fdisk Documentation:
man fdisk
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.