fdisk -l and lsblk - how to compare these two commands?


Recommended Posts

Hello and good morning dear community,


So from time to time I'm on the console more or less.

And if you don't always use it - if you're not at home every day - then questions keep coming up - which an experienced Linux user probably never comes up with.

In any case, the question arises for me - how to compare lsblk and fdisk -l - how and what possible errors can arise when using them.

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

hmmm - I think that lsblk is actually better suited for a quick, clear display
With lsblk I get the data of the contents on the drive with their structure, including mount points and logical volumes.

Seen this way, I find lsblk a bit easier – more readable and clearer

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

How do you see that!?

I'm looking forward to hearing from you

cheers

 

update:

 

btw: i have found - with some research  a thread that might help here:

https://stackoverflow.com/questions/67124677/why-fdisk-and-lsblk-show-different-partition-size

what do you think!?

 

Well, it's the same with comparing top to htop. Or GIMP to Krita.

They give out the same info/usage.

Saying something is "best" doesn't mean it's best for the next person.

And showing different partition sizes, right in that link:

"lsblk shows size in IEC units (GiB, MiB, etc). A gibibyte (GiB) is larger than a gigabyte (GB)
fdisk shows size in SI (GB, MB, etc)."

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.