Disk Management in Linux
Posted on June 1, 2024 (Last modified on June 8, 2024) • 1 min read • 181 wordsLearn how to manage disks and filesystems in Linux, including partitioning, formatting, and mounting disks.
Managing disks and filesystems is a critical skill for system administrators. This guide covers partitioning, formatting, and mounting disks in Linux.
Use fdisk
to create and manage disk partitions.
fdisk /dev/sda
Use parted
for advanced partitioning tasks.
parted /dev/sda
Use mkfs
to format partitions with different filesystems.
mkfs.ext4 /dev/sda1
mkfs.xfs /dev/sda1
Use mount
to mount filesystems.
mount /dev/sda1 /mnt
Edit /etc/fstab
for persistent mounts.
/dev/sda1 /mnt ext4 defaults 0 0
Use df
to check disk space usage.
df -h
Use du
to check directory space usage.
du -sh /path/to/directory
Use iostat
to monitor disk I/O.
iostat
Use lsblk
to display block devices.
lsblk
Mastering disk management in Linux is essential for maintaining system performance and stability. Practice partitioning, formatting, and mounting disks, and use monitoring tools to manage disk usage effectively.