🚀 Introduction
Storage management is a critical skill for every Linux administrator. Whether you're setting up a new server, managing cloud storage, or optimizing disk space, understanding disk partitioning is essential. From identifying different storage types to formatting and mounting partitions, this guide will walk you through the entire process in a simple and efficient way.
By the end of this guide, you'll be able to:
✅ Identify and analyze disk storage
✅ Create and format partitions with confidence
✅ Mount and manage partitions like a pro
Let's dive in! 🏗️💽
🗄️ Types of Storage
- DAS (Direct Attached Storage) 🖴 - Directly connected to a single server.
- NAS (Network Attached Storage) 🌐 - Shared over a network.
- SAN (Storage Area Network) 🏗️ - High-speed storage network.
- LVM (Logical Volume Manager) 🔄 - Flexible partition management.
🔧 Disk Naming in Linux 🏷️
-
Old HDDs (IDE):
/dev/hda🏛️ -
Newer Disks (SCSI/SAS):
/dev/sda🆕 -
Xen Hypervisor Disks:
/dev/xvda🖥️ -
KVM/QEMU Disks:
/dev/vda🎭 -
Multipath Disks:
/dev/mpath🔗 -
NVMe SSDs:
/dev/nvme0n1⚡
👀 Disk names are assigned by the kernel and can be managed via /etc/udev/rules
🔍 Checking Disk Information 🏗️
- List all block devices 🗂️
lsblk -f
- View partition table 📜
sudo fdisk -l
- Check free space 📊
parted /dev/sda print free
🛠️ Creating a Partition ⚙️
- Open
fdisk:
fdisk /dev/sda
- Press
mfor help 🆘 - Press
nto create a new partition ➕ - Choose partition type:
-
MSDOS (Legacy) 🏛️
- Max disk size: 8TB
- Max partition size: 2TB (use extended partitions)
-
GPT (Modern) 🚀
- Supports larger disks and more partitions
-
MSDOS (Legacy) 🏛️
- Save changes with
w💾
🔄 Updating Kernel with New Partition 🖥️
partx -a /dev/sda
partprobe -s
If errors occur, reboot with:
init 6
📝 Formatting the Partition 🗄️
- Check available filesystems:
mkfs + [Tab]
- Create a filesystem (example ext4):
mkfs.ext4 /dev/sda3
📌 Mounting the Partition 🏠
- Create a mount point:
mkdir /apppart3
- Mount temporarily:
mount /dev/sda3 /apppart3
✅ Verify Everything 🧐
df -h
blkid
🚀 You're all set! Now, make the mount permanent by adding it to /etc/fstab 🎯
🎯 Conclusion 🏁
Understanding disk partitioning is crucial for system administrators and developers alike. Whether you're setting up a new storage device or troubleshooting an existing one, knowing how to check, partition, format, and mount disks is essential.
🔥 Key Takeaways:
- Always check disk space before partitioning 🔍
- Choose the correct partition type (MSDOS/GPT) based on system needs ⚙️
- Use
mkfsto format andmountto attach partitions 📌 - Make changes permanent via
/etc/fstab🏗️
Mastering these commands will give you full control over your storage devices and ensure optimal system performance! 🚀😃

Top comments (0)