comparing lsblk and fdisk -l, I sometimes wondered, which was better and more suitable.

dhubs

Member
Joined
Nov 5, 2024
Messages
32
Reaction score
6
Credits
461
g day :)

When comparing lsblk and fdisk -l, I sometimes wondered which was better and more suitable.

I think lsblk is more suitable for a quick, clear display - it shows the disk with its structure, including mount points and logical volumes.

I personally find lsblk a bit simpler - readable and clearer

In my opinion, lsblk shows a tree-like structure that shows the hard disk, partitions, partition types, volume groups and logical volumes,
(while fdisk -l (disk) only shows the partition and partition type that are present on the hard disk - hmmm - if it is an MBR-style hard disk.)


how you use the both commands!?
Where are the "risks" - and the benefits of the both
 


I find fdisk -l very useful as it provides information on each drive, the manufacturer and size of each drive, sector, size, partition and id. More information about the system in the output than lsblk. The information given by running fdisk -l has more benefits to viewing all details if there are issues with partitions that won't boot or drives that are on their way out.

Usually I won't use lsblk unless the menu-entries in the grub config get misconfigured and I have to compare it to the swaps and UUID's.

If there were no other commands to use fdisk -l would be my first go to choice. G-parted Live just works.

Risk's you ask?

With lsblk you run a risk of not knowing which partition has the boot flag on a dual or triple booted rig.
Also, there isn't a disk identifier that can be confirmed should one need to know exact details when trouble shooting any issue's. ie) a partition that may need edited, resized or given a boot flag.

Cheers,
Alex
 
Last edited:
They serve different purposes. If you're looking for a compact view and you know what your devices should look like, lsblk is a handy tool to check how they were enumerated. If you just want the UUID and LABEL, blkid is the go-to. If you want the full information, fdisk -l. It's easier to have these commands the way it's easier to have wrapper scripts.
 
I use inxi -d for basic info, and fdisk on the rare occasions I need fuller information
 

Members online


Latest posts

Top