What if a few simple commands could save your data and sanity when managing disks?
Why fdisk and lsblk in Linux CLI? - Purpose & Use Cases
Imagine you just bought a new hard drive and want to use it on your Linux computer. You try to figure out its size, partitions, and how to set it up by opening multiple windows, guessing device names, and writing notes on paper.
Doing this by hand is slow and confusing. You might mix up device names, miss important details, or accidentally delete data. Without clear commands, it's easy to make mistakes that can cause data loss or system problems.
Using fdisk and lsblk commands lets you quickly see all disks and partitions, and safely create or modify partitions. They give clear, organized information and simple interactive tools to manage disks without guesswork.
cat /proc/partitions
ls /dev/sd*
# guess which device is new
lsblk
fdisk -l
# see all disks and partitions clearly
You can confidently manage disk partitions and storage devices, making your system setup faster, safer, and less stressful.
When installing a new Linux system, you use lsblk to list all drives and fdisk to create partitions for system, swap, and data, ensuring everything is correctly set up before installation.
Manual disk management is confusing and risky.
fdisk and lsblk provide clear, safe ways to view and edit disk partitions.
They save time and prevent costly mistakes when handling storage devices.