-
-
Notifications
You must be signed in to change notification settings - Fork 1
Arch Linux Filesystem Management
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to managing filesystems on Arch Linux, including ext4, btrfs, xfs, mounting, formatting, and filesystem optimization.
- Understanding Filesystems
- Common Filesystems
- Creating Filesystems
- Mounting Filesystems
- fstab Configuration
- Filesystem Maintenance
- Troubleshooting
Filesystem organizes data on storage devices.
Functions:
- Organize files
- Manage permissions
- Track free space
- Provide access methods
Common types:
- ext4: Default Linux filesystem
- btrfs: Modern with snapshots
- xfs: High performance
- NTFS: Windows compatibility
- FAT32: Universal compatibility
ext4 features:
- Stable and reliable
- Good performance
- Journaling
- Widely supported
Use cases:
- General purpose
- Root filesystem
- Most common choice
btrfs features:
- Snapshots
- Compression
- Copy-on-write
- Subvolumes
Use cases:
- System with snapshots
- Data integrity
- Advanced features
xfs features:
- High performance
- Large files
- Scalability
Use cases:
- Servers
- Large files
- Performance-critical
Create ext4:
# Format partition
sudo mkfs.ext4 /dev/sda1
# With label
sudo mkfs.ext4 -L "MyData" /dev/sda1Create btrfs:
# Format partition
sudo mkfs.btrfs /dev/sda1
# With label
sudo mkfs.btrfs -L "MyData" /dev/sda1Create xfs:
# Format partition
sudo mkfs.xfs /dev/sda1
# With label
sudo mkfs.xfs -L "MyData" /dev/sda1NTFS:
# Install ntfs-3g
sudo pacman -S ntfs-3g
# Format
sudo mkfs.ntfs /dev/sda1FAT32:
# Format FAT32
sudo mkfs.fat -F32 /dev/sda1Mount filesystem:
# Create mount point
sudo mkdir /mnt/mydata
# Mount
sudo mount /dev/sda1 /mnt/mydata
# Check
df -hUnmount filesystem:
# Unmount
sudo umount /mnt/mydata
# Or
sudo umount /dev/sda1Common options:
# Mount with options
sudo mount -o rw,noatime /dev/sda1 /mnt/mydata
# Read-only
sudo mount -o ro /dev/sda1 /mnt/mydata
# Remount
sudo mount -o remount,rw /dev/sda1Configure fstab:
# Edit fstab
sudo vim /etc/fstabEntry format:
UUID=xxxx-xxxx-xxxx /mnt/mydata ext4 defaults 0 2
│ │ │ │ │ │
│ │ │ │ │ └─ fsck order
│ │ │ │ └──── dump
│ │ │ └────────────── options
│ │ └──────────────────── filesystem
│ └───────────────────────────────── mount point
└────────────────────────────────────────────────────── device
Common entries:
# Root filesystem
UUID=xxxx-xxxx / ext4 defaults 0 1
# Data partition
UUID=xxxx-xxxx /mnt/data ext4 defaults,noatime 0 2
# btrfs with compression
UUID=xxxx-xxxx /mnt/data btrfs defaults,compress=zstd 0 2
# Swap
UUID=xxxx-xxxx none swap defaults 0 0
Get UUID:
# List UUIDs
lsblk -f
# Or
blkidCheck ext4:
# Check filesystem
sudo fsck.ext4 /dev/sda1
# Auto-repair
sudo fsck.ext4 -a /dev/sda1Check btrfs:
# Check btrfs
sudo btrfs check /dev/sda1Resize ext4:
# Resize (grow)
sudo resize2fs /dev/sda1
# Resize to specific size
sudo resize2fs /dev/sda1 50GResize btrfs:
# Resize btrfs
sudo btrfs filesystem resize +10G /mnt/dataCheck usage:
# Disk usage
df -h
# Directory usage
du -h /path/to/directory
# Largest files
du -h | sort -rh | head -20Fix errors:
# Unmount first
sudo umount /dev/sda1
# Check and repair
sudo fsck.ext4 -y /dev/sda1
# Remount
sudo mount /dev/sda1 /mnt/mydataCheck logs:
# Check dmesg
dmesg | tail
# Check journal
journalctl -b | grep mountFix permissions:
# Check permissions
ls -l /mnt/mydata
# Change ownership
sudo chown -R user:group /mnt/mydata
# Change permissions
sudo chmod -R 755 /mnt/mydataThis guide covered:
- Filesystem basics - What they are
- Common filesystems - ext4, btrfs, xfs
- Creating - Format partitions
- Mounting - Mount filesystems
- fstab - Auto-mount configuration
- Maintenance - Check and resize
- Troubleshooting - Common issues
Key Takeaways:
- ext4 is default choice
- btrfs for advanced features
- Use UUIDs in fstab
- Check filesystems regularly
- Backup before operations
- Arch Linux Installation Guide - Installation
- Arch Linux System Configuration - System setup
- ArchWiki Filesystems: https://wiki.archlinux.org/title/File_systems
This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.