Linux Disk Utilities - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux Disk Utilities Guide
Complete beginner-friendly guide to disk utilities on Linux, covering Arch Linux, CachyOS, and other distributions including disk partitioning, formatting, disk health checks, and disk management tools.
Table of Contents
Partitioning Tools
fdisk
Use fdisk:
# Install fdisk
sudo pacman -S util-linux
# Partition disk
sudo fdisk /dev/sda
# Commands:
# n - new partition
# d - delete partition
# w - write changes
cfdisk
Use cfdisk:
# Install cfdisk
sudo pacman -S util-linux
# Partition disk
sudo cfdisk /dev/sda
parted
Use parted:
# Install parted
sudo pacman -S parted
# Partition disk
sudo parted /dev/sda
GParted
Install GParted:
# Install GParted
sudo pacman -S gparted
# Launch
sudo gparted
Formatting Tools
mkfs
Format partitions:
# Format as ext4
sudo mkfs.ext4 /dev/sda1
# Format as btrfs
sudo mkfs.btrfs /dev/sda1
# Format as xfs
sudo mkfs.xfs /dev/sda1
Disk Health
SMART
Check disk health:
# Install smartmontools
sudo pacman -S smartmontools
# Check disk
sudo smartctl -a /dev/sda
# Short test
sudo smartctl -t short /dev/sda
badblocks
Check for bad blocks:
# Check bad blocks
sudo badblocks -v /dev/sda
Disk Cloning
dd
Clone disk:
# Clone disk
sudo dd if=/dev/sda of=/dev/sdb bs=4M status=progress
# Warning: Can destroy data!
Clonezilla
Use Clonezilla:
# Download ISO from clonezilla.org
# Boot from ISO
# Follow wizard
Troubleshooting
Disk Not Detected
Check disk:
# List disks
lsblk
# Check kernel messages
dmesg | grep -i disk
Summary
This guide covered disk utilities for Arch Linux, CachyOS, and other distributions, including partitioning, formatting, and disk health.
Next Steps
- Filesystem Management - Filesystem setup
- Backup and Restore - Backups
- ArchWiki Disk Utilities: https://wiki.archlinux.org/title/Partitioning
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.