Skip to content

Linux fdisk Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux fdisk Guide

Complete beginner-friendly guide to fdisk on Linux, covering Arch Linux, CachyOS, and other distributions including disk partitioning, creating partitions, and partition management.


Table of Contents

  1. Understanding fdisk
  2. fdisk Basics
  3. Creating Partitions
  4. Managing Partitions
  5. Troubleshooting

Understanding fdisk

What is fdisk?

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

fdisk Basics

List Devices

Find disk:

# List block devices
lsblk

# Or
fdisk -l

Start fdisk

Open disk:

# Open disk for editing
sudo fdisk /dev/sda

# Interactive mode
# Type 'm' for help

Creating Partitions

Create New Partition

Steps:

# 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 Enter

Write Changes

Apply changes:

# In fdisk
w

# Write partition table and exit

Managing Partitions

View Partitions

List partitions:

# In fdisk
p

# Print partition table

Delete Partition

Remove partition:

# In fdisk
d

# Select partition number
# Enter number

Change Partition Type

Modify type:

# In fdisk
t

# Select partition
# Enter hex code for type

Troubleshooting

Partition Not Showing

Update system:

# Reload partition table
sudo partprobe /dev/sda

# Or reboot

fdisk Errors

Check disk:

# Check disk
sudo fdisk -l /dev/sda

# Verify partition table
sudo sfdisk -V /dev/sda

Summary

This guide covered fdisk usage, partition creation, and disk management for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally