Linux parted Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux parted Guide
Complete beginner-friendly guide to parted on Linux, covering Arch Linux, CachyOS, and other distributions including disk partitioning, GPT/MBR tables, and advanced partition management.
Table of Contents
- Understanding parted
- parted Installation
- parted Basics
- Creating Partitions
- Managing Partitions
- Troubleshooting
Understanding parted
What is parted?
parted is GNU partition editor.
Features:
- GPT support: Works with GPT partition tables
- MBR support: Works with MBR partition tables
- Resize: Can resize partitions
- Advanced: More features than fdisk
Uses:
- Create partitions: Make new partitions
- Resize partitions: Change partition size
- Move partitions: Relocate partitions
- Create tables: Initialize partition tables
parted Installation
Install parted
Arch/CachyOS:
# Install parted
sudo pacman -S parted
# Usually pre-installed
Debian/Ubuntu:
sudo apt install parted
Fedora:
sudo dnf install parted
Launch parted
Start parted:
# Open disk
sudo parted /dev/sda
# Interactive mode
# Type 'help' for commands
parted Basics
View Partitions
List partitions:
# In parted
print
# Or command line
sudo parted /dev/sda print
Select Disk
Choose device:
# In parted
select /dev/sda
# Or start with device
sudo parted /dev/sda
Creating Partitions
Create Partition Table
Initialize table:
# In parted
mklabel gpt
# Or MBR
mklabel msdos
Create Partition
New partition:
# In parted
mkpart primary ext4 1MiB 10GiB
# Format:
# mkpart [type] [fs-type] [start] [end]
Managing Partitions
Resize Partition
Change size:
# In parted
resizepart 1 20GiB
# Resize partition 1 to 20GB
Delete Partition
Remove:
# In parted
rm 1
# Delete partition 1
Troubleshooting
parted Errors
Check disk:
# Print partition table
sudo parted /dev/sda print
# Check for errors
sudo parted /dev/sda check
Summary
This guide covered parted usage, partition management, and disk partitioning for Arch Linux, CachyOS, and other distributions.
Next Steps
- fdisk Guide - fdisk partitioning
- cfdisk Guide - cfdisk partitioning
- Disk Utilities - Disk tools
- parted Documentation:
man parted
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.