Linux tune2fs Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux tune2fs Guide
Complete beginner-friendly guide to tune2fs on Linux, covering Arch Linux, CachyOS, and other distributions including ext filesystem tuning, filesystem parameters, and ext filesystem management.
Table of Contents
Understanding tune2fs
What is tune2fs?
tune2fs adjusts ext filesystem parameters.
Uses:
- Tune filesystem: Adjust filesystem settings
- Set label: Set filesystem label
- Mount options: Set default mount options
- Filesystem management: Manage ext filesystems
Note: Only works with ext2, ext3, ext4 filesystems.
tune2fs Basics
View Information
Show info:
# Show filesystem information
sudo tune2fs -l /dev/sda1
# -l = list (shows information)
Set Label
Filesystem label:
# Set label
sudo tune2fs -L "MyLabel" /dev/sda1
# -L = label (sets filesystem label)
Filesystem Parameters
Mount Count
Max mount count:
# Set max mount count
sudo tune2fs -c 30 /dev/sda1
# -c = count (checks every 30 mounts)
Check Interval
Time interval:
# Set check interval
sudo tune2fs -i 2w /dev/sda1
# -i = interval (checks every 2 weeks)
Label and UUID
Change UUID
Generate new UUID:
# Generate new UUID
sudo tune2fs -U random /dev/sda1
# -U = UUID (random = new UUID)
View UUID
Show UUID:
# Show UUID
sudo tune2fs -l /dev/sda1 | grep UUID
# Shows filesystem UUID
Troubleshooting
Unmount First
Unmount device:
# Unmount before tuning
sudo umount /dev/sda1
# Then tune
sudo tune2fs -L "NewLabel" /dev/sda1
Summary
This guide covered tune2fs usage, ext filesystem tuning, and filesystem management for Arch Linux, CachyOS, and other distributions.
Next Steps
- mkfs Guide - Creating filesystems
- fsck Guide - Filesystem checking
- Filesystem Management - Filesystem setup
- tune2fs Documentation:
man tune2fs
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.