How To – Linux List Disk Partitions Command

How do I list all hard disk partitions under a Linux operating systems using the CLI?

Usually, your hard disk drive divided into one or more logical disks called partitions. This division is described in the partition table found in sector 0 of the hard disk. The device is usually /dev/sda, /dev/sdb or so on. A device name refers to the entire disk, and the device name will be as follows:

  1. /dev/hd* – IDE disks. /dev/hda will be first IDE hard disk, /dev/hdb will be second IDE hard disk, and so on.
  2. /dev/sd* – SCSI or SATA disks including SSDs. /dev/sda will be first SATA/SCSI hard disk, /dev/sdb will be second SATA/SCSI hard disk, and so on.
  3. /dev/nvme* – NVM Express (NVMe) pci SSD. /dev/nvme0n1 will be first NVMe SSD, /dev/nvme1n1 will be second NVMe SSD, and so on.


lsblk Command to list block device on Linux

To list all block devices, run:
# lsblk
# lsblk /dev/DEVICE
# lsblk /dev/sda
# lsblk -l
# lsblk -d | grep disk

Linux list block devices
We can also fine-tune information displayed by lsblk as follows to list only Linux partitions and other data:

How To List Disk Partitions In Linux

Listing disks and partitions on Linux using lsblk

Pass the following -f and -m to see detailed info:
# lsblk -f -m
# lsblk -f -m | grep ext4

Here is a list of disk partitions and block devices in Linux:

NAME                 FSTYPE            LABEL    UUID                                   FSAVAIL FSUSE% MOUNTPOINT   SIZE OWNER GROUP MODE
sda                                                                                                              931.5G             brw-rw----
├─sda1               vfat                       DE61-52C6                                 946M     1% /boot/efi    953M             brw-rw----
├─sda2               linux_raid_member debian:0 2213c9e0-bde0-c07a-5dc6-fa92db3b9aeb                               954M             brw-rw----
│ └─md0              ext4                       62343176-6dcf-4b0d-b440-825dc83a7553    769.5M    10% /boot        953M             brw-rw----
└─sda3               linux_raid_member debian:1 89a83a31-7c6c-7b4a-6313-7dc17b1f5b5d                             929.7G             brw-rw----
  └─md1              crypto_LUKS                45b8c33e-a710-4062-b98f-a32a45c9d947                             929.5G             brw-rw----
    └─md1_crypt      LVM2_member                uQEZdt-Fdjc-QMUj-4Jn7-y712-xkU7-IOby2F                           929.5G             brw-rw----
      ├─md1_vg0-swap swap                       b04c0ffc-46b5-4e6d-9c73-8da81cd71eb0                  [SWAP]       7.5G             brw-rw----
      └─md1_vg0-root ext4                       c493757e-56a9-4d2b-bb05-437b8a1863cb      791G     8% /          922.1G             brw-rw----
sdb                                                                                                              931.5G             brw-rw----
├─sdb1               vfat                       DE61-E2ED                                                          953M             brw-rw----
├─sdb2               linux_raid_member debian:0 2213c9e0-bde0-c07a-5dc6-fa92db3b9aeb                               954M             brw-rw----
│ └─md0              ext4                       62343176-6dcf-4b0d-b440-825dc83a7553    769.5M    10% /boot        953M             brw-rw----
└─sdb3               linux_raid_member debian:1 89a83a31-7c6c-7b4a-6313-7dc17b1f5b5d                             929.7G             brw-rw----
  └─md1              crypto_LUKS                45b8c33e-a710-4062-b98f-a32a45c9d947                             929.5G             brw-rw----
    └─md1_crypt      LVM2_member                uQEZdt-Fdjc-QMUj-4Jn7-y712-xkU7-IOby2F                           929.5G             brw-rw----
      ├─md1_vg0-swap swap                       b04c0ffc-46b5-4e6d-9c73-8da81cd71eb0                  [SWAP]       7.5G             brw-rw----
      └─md1_vg0-root ext4                       c493757e-56a9-4d2b-bb05-437b8a1863cb      791G     8% /          922.1G             brw-rw----

Understanding lsblk option that displays block devices and partitions

  • -m : Show info about Linux permissions
  • -f : List info about Linux filesystems
  • -l : Force list format output option
  • -d : Avoid printing holders. In other words just see block device/disk names
  • -o NAME,FSTYPE,SIZE,MOUNTPOINT : Only display selected columns as per Table 1.
Table 1
Column Descripton
NAME device name
KNAME internal kernel device name
PATH path to the device node
MAJ:MIN major:minor device number
FSAVAIL filesystem size available
FSSIZE filesystem size
FSTYPE filesystem type
FSUSED filesystem size used
FSUSE% filesystem use percentage
MOUNTPOINT where the device is mounted
LABEL filesystem LABEL
UUID filesystem UUID
PTUUID partition table identifier (usually UUID)
PTTYPE partition table type
PARTTYPE partition type UUID
PARTFLAGS partition flags
RA read-ahead of the device
RO read-only device
RM removable device
HOTPLUG removable or hotplug device (usb, pcmcia, …)
MODEL device identifier
SERIAL disk serial number
SIZE size of the device
STATE state of the device
OWNER user name
GROUP group name
MODE device node permissions
ALIGNMENT alignment offset
MIN-IO minimum I/O size
OPT-IO optimal I/O size
PHY-SEC physical sector size
LOG-SEC logical sector size
ROTA rotational device
SCHED I/O scheduler name
RQ-SIZE request queue size
TYPE device type
DISC-ALN discard alignment offset
DISC-GRAN discard granularity
DISC-MAX discard max bytes
DISC-ZERO discard zeroes data
WSAME write same max bytes
WWN unique storage identifier
RAND adds randomness
PKNAME internal parent kernel device name
HCTL Host:Channel:Target:Lun for SCSI
TRAN device transport type
SUBSYSTEMS de-duplicated chain of subsystems
REV device revision
VENDOR device vendor
ZONED zone model

How to locate/print block device attributes using blkid

Apart from physical block storage and logical partitions, your Linux box may have software RAID and encrypted hard disks too. We can determine the type of filesystem that a block device holds and also the attributes:
# blkid
The ugly output provided as follows; hence it is recommended to use lsblk:

/dev/sda1: UUID="DE61-52C6" TYPE="vfat" PARTUUID="f865858a-df77-4f1a-b18c-a494134f412b"
/dev/sda2: UUID="2213c9e0-bde0-c07a-5dc6-fa92db3b9aeb" UUID_SUB="126de583-13fd-b611-2860-7f6fc9b2f07e" LABEL="debian:0" TYPE="linux_raid_member" PARTUUID="e0beeb54-9bec-4cfe-8a61-70e64f8bb666"
/dev/sda3: UUID="89a83a31-7c6c-7b4a-6313-7dc17b1f5b5d" UUID_SUB="3beaaf76-2166-dabf-7ffe-8e26a185cac6" LABEL="debian:1" TYPE="linux_raid_member" PARTUUID="ce1568c8-073f-4891-843f-1ea97d7e3f2b"
/dev/sdb1: UUID="DE61-E2ED" TYPE="vfat" PARTUUID="4e5121bd-f9ff-4d7c-9d76-b5d4b2f997a3"
/dev/sdb2: UUID="2213c9e0-bde0-c07a-5dc6-fa92db3b9aeb" UUID_SUB="2e8ddb77-48e0-57f1-aafb-2353541e4ff4" LABEL="debian:0" TYPE="linux_raid_member" PARTUUID="8680225f-2cd5-47dd-a99a-13add748e88d"
/dev/sdb3: UUID="89a83a31-7c6c-7b4a-6313-7dc17b1f5b5d" UUID_SUB="a3b5b4a3-3455-17ee-7a6c-d0480688baab" LABEL="debian:1" TYPE="linux_raid_member" PARTUUID="9d20666b-d2df-4a31-9b9b-c28819b5deb4"
/dev/md0: UUID="62343176-6dcf-4b0d-b440-825dc83a7553" TYPE="ext4"
/dev/md1: UUID="45b8c33e-a710-4062-b98f-a32a45c9d947" TYPE="crypto_LUKS"
/dev/mapper/md1_crypt: UUID="uQEZdt-Fdjc-QMUj-4Jn7-y712-xkU7-IOby2F" TYPE="LVM2_member"
/dev/mapper/md1_vg0-swap: UUID="b04c0ffc-46b5-4e6d-9c73-8da81cd71eb0" TYPE="swap"
/dev/mapper/md1_vg0-root: UUID="c493757e-56a9-4d2b-bb05-437b8a1863cb" TYPE="ext4"

List partitions ynder Linux using the fdisk command

Open a terminal window (select Applications > Accessories > Terminal). Switch to the root user by typing the su - and entering the root password, when prompted by the su command. Or use the sudo command:
$ su -
# fdisk -l

$ sudo fdisk -l
Here is what I see from my Linux desktop:

Disk /dev/sda: 251.1 GB, 251059544064 bytes
255 heads, 63 sectors/track, 30522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008fcd3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          14      104448   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              14       13068   104857600   83  Linux
/dev/sda3           13068       13198     1048576   82  Linux swap / Solaris
/dev/sda4           13198       30523   139163648    5  Extended
/dev/sda5           13198       30523   139162624   83  Linux

The -l options shows the partition tables for the specified devices and then exit. If no devices are given, those mentioned in /proc/partitions (if that exists) are used. You can specify device name as follows (in this example list partitions for /dev/sda):
# fdisk -l

Display disk partitions using sfdisk command in Linux

The sfdisk command act as a partition table manipulator for Linux. You can use this tool to list partitions too:
# sfdisk -l /dev/sda
# sfdisk -lu /dev/sda
# sfdisk -ls /dev/sda

Linux partitions info:


Disk /dev/sda: 8922 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+    104-    105-    838656   83  Linux
/dev/sda2        104+    235-    131-   1048576   82  Linux swap / Solaris
/dev/sda3        235+   8922-   8688-  69781504   83  Linux
/dev/sda4          0       -       0          0    0  Empty


  1. -l : List the partitions of a device.
  2. -s : List the size of a partition.
  3. -u or -uS or -uB or -uC or -uM : Accept or report in units of sectors (blocks, cylinders, megabytes, respecpively). The default is cylinders, at least when the geometry is known.

Listing Linux a Partition Size Larger Than 2TB

The fdisk or sfdisk command will not list any partition size larger than 2TB. To solve this problem you need to use GNU parted command with GPT partitions. It supports Intel EFI/GPT partition tables. Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk. It is a part of the Extensible Firmware Interface (EFI) standard proposed by Intel as a replacement for the outdated PC BIOS, one of the few remaining relics of the original IBM PC. EFI uses GPT where BIOS uses a Master Boot Record (MBR). In this example list partitions on /dev/sdb using the parted command:
# parted /dev/sdb
GNU/Linux parted prompt:

GNU Parted 3.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.

Set unit type to TB or GB by typing ‘unit TB‘ or ‘unit GB‘ at the (parted) prompt:
(parted) unit TB
(parted) unit GB
To list partitions type print command at the (parted) prompt:
(parted) print
Detailed information:

Model: ATA ST33000651AS (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      0.00GB  3001GB  3001GB  ext4         primary


To exit from parted session type ‘quit’ at the (parted) prompt:
(parted) quit

How Do I List All Partitions Layout On All Block Devices?

Pass the -l OR –list option to the parted command to lists partition layout on all block devices:
# parted -l
Sample outputs:

Show Linux Disk Partitions Command

Fig.01: Show Linux Disk Partitions With GNU parted Command

lssci command to list SCSI devices (or hosts) and their attributes

Use the lsscsi command to show SCSI devices (or hosts) and their attributes:
# lsscsi
Sample outputs:

[0:0:0:0]    disk    ATA      TOSHIBA MK5061GS MF00  /dev/sda
[1:0:0:0]    cd/dvd  MATSHITA BD-RE UJ232A     1.10  /dev/sr0
[2:0:0:0]    disk    ATA      ST9500420ASG     0004  /dev/sdb

Here is another outputs:
Linux List Disk Partitions Command

A note about GUI tools

Linux desktop comes with “Disks & storage” utility to show disk information and perform everyday tasks. Open Disks from the Activities overview under Gnome.
Linux GNOME Desktop NVMe PCI SSD
A dialog will open where we can see disks. For instance, I have two 1 TB Samsung NVMe SSD installed in my system. Make sure you choose the disk to see partition information. See the gnome help section for other options.

Using hardware detction tools to print disk paritions on Linux

You can install and use the following tools. I don’t use and promote third party tools on Linux servers as inbuilt tools provide all information. But, I added them here as they might be useful to someone. We can use the hwinfo command to probe for hardware as follows:
hwinfo | more
hwinfo --block | more
hwinfo --block --short
inxi -P
inxi -p | more

Displaying Linux disks and pairtions
See the following pages:


You just learned how to list disk partitions using various Linux commands. For for info see “ls* Commands Are Even More Useful Than You May Have Thought” blog post and man pages by typing the following man command:
man fdisk
man lsblk
man sfdisk
man parted

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 15 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
15 comments… add one
  • John Scanlon Apr 6, 2012 @ 18:46

    fdisk -l

    Disk /dev/sda: 145.4 GB, 145492017152 bytes
    255 heads, 63 sectors/track, 17688 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 1 5 40131 de Dell Utility
    /dev/sda2 6 1458 11671222+ 83 Linux
    /dev/sda3 * 1459 1471 104422+ 83 Linux
    /dev/sda4 1472 17688 130263052+ 5 Extended
    /dev/sda5 1472 17688 130263021 8e Linux LVM

  • Sanjith Apr 11, 2012 @ 12:19

    # parted -l

    Model: ST380215A (ide)
    Disk /dev/hda: 80.0GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number Start End Size Type File system Flags
    1 32.3kB 16.8GB 16.8GB primary ext3 boot
    2 16.8GB 32.5GB 15.7GB primary ext3
    3 32.5GB 48.2GB 15.7GB primary ext3
    4 48.2GB 80.0GB 31.8GB extended
    5 48.2GB 60.8GB 12.6GB logical ext3
    6 60.8GB 66.1GB 5239MB logical ext3
    7 66.1GB 71.3GB 5239MB logical linux-swap

  • motorcycles Nov 2, 2012 @ 6:52


    My result is

    ns1-059:~# fdisk -l
    cannot open /proc/partitions

    what wrong?

    • Erathiel May 12, 2014 @ 8:31

      You’re probably missing sudo at the beginning of line ;)

  • daksh21ubuntu Feb 6, 2013 @ 20:01

    it helps me a lot, thank you . . .

  • Jithendra Mar 30, 2013 @ 13:49

    Very informative and nicely written, thanks.

  • mario Aug 5, 2014 @ 9:21

    Hi ,

    I tried parted -l in debian operating system and it is not working as it is not available in the help command option. Please advise. is there any other command that shows all the partitions and the type of the partition on the operating system.

  • Farhan Islam Nov 25, 2014 @ 8:40

    I am unsure but when I did the sfdisk I got this

    sfdisk -lu /dev/sda
    unrecognized format – using sectors

    Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track
    Units = sectors of 512 bytes, counting from 0

    Device Boot Start End #sectors Id System
    /dev/sda1 * 4096 81922047 81917952 83 Linux
    /dev/sda2 81922247 1715951615 1634029369 83 Linux
    start: (c,h,s) expected (1023,254,63) found (1003,108,9)
    end: (c,h,s) expected (1023,254,63) found (317,12,15)
    /dev/sda3 1715951616 1748717551 32765936 82 Linux swap / Solaris
    /dev/sda4 1748717568 1953515519 204797952 83 Linux

    Can anyone tell me how to fix the /dev/sda2 ?

  • zeroday1 Dec 30, 2014 @ 6:49

    How many years have linux installations been plagued by the infamous “No Root File System is Defined” message, whenever a pc user attempts to install Linux or Ubuntu on a hard-drive alongside their Windows installation?!

    This has been going on way too long, for the makers of Linux and Ubuntu to not find a simpler way to facilitate this issue. We all know what the problem is yet, for those of us whom wish to use Linux on the same drive as their Windows OS, literally seem to have no choice but to format the entire drive in order to install Linux, because of some stupid glitch that prevents it recognizing the appropriate partition parameters.

    Of all my experiences with Linux, none of them have ever been with a hard-drive installation but instead only using the LiveCD versions—because I will not remove Windows, just so that I can install Linux on the one Hard drive I have—which is why I want to install Linux alongside Windows.

    The nagging but persistent problem is always the same, “No Root File System is Defined.”

    Even after I extended the system partition and changed the partition id of said system partition (which had over 100GB of unused space), to [ “Linux Native” ] from the drop-down menu of the partition program I was using, it still displayed the same error message above. I tried it with the [ Primary ] option in the Linux installation module, as well as an attempt with the [ Logical ] option——-both of these made no difference and yes, before any nit-picking techies get on my case about it——-I tried the above scenarios with following options:

    First Attempt-

    [ Use As: (Ext 4) and Mount Point: ( / ) ]

    Second Attempt-

    [ Use As: (EFI Boot Partition) ]


    This is what I got after I listed the partition info from the terminal:

    mint@mint ~ $ sudo fdisk -l

    WARNING: GPT (GUID Partition Table) detected on ‘/dev/sda’! The util fdisk doesn’t support GPT. Use GNU Parted.

    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x02ebc2e4

    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
    /dev/sda2 206848 505081855 252437504 7 HPFS/NTFS/exFAT
    /dev/sda3 505083904 625139711 60027904 83 Linux


    When I visited the Ubuntu and Linux support pages which depict a working installation, what displays is a screen-shot of the Linux installation module, at the screen that actually gives the user a choice if they would like to install it with Windows. I was never given that option when I attempted to install Linux Mint 17 or Ubuntu 14.04.1. Both ISO’s provided me with the exact same setup scenario upon installation——-Either I could erase my only hard-drive (which includes my Win7 I want to keep) or (I could attempt to install manually using the partition options). That’s it!

    No option to install with Windows like it showed on the website.

    This is so disconcerting to me that after hours of attempting to install a Linux or Ubuntu platform, neither installation module will recognize the appropriate partition configurations to make a dual-boot (without removing Windows) work.

    Microsoft may definitely be number one at the top of my list of the most frustrating companies in the world, but after enduring this rigmarole to simply install the OS, Linux is definitely not far behind Microsoft when it comes to such improprieties.

    Heck, even Microsoft’s installation of Windows is far simpler than this.

    Linux may have intrigued me time and again, but the more I’ve delved into it’s world, all the more frustrated I became. Really——-how different from Microsoft is Linux, when it’s developers couldn’t even fully automate something as simple as a detect and auto-configuration feature to as to facilitate any type of installation a user might want?!

    After all these years——-and Linux still can’t fix this problem with partition allocation and configuration, except to again dump all this nonsense on the user to try to sort out?!

    It doesn’t matter if it’s free. It’s still marketed as and geared toward users whom want an alternative and even better experience than Windows (even if they still want to keep their Windows installation). Yet the current options available easily put average users in an enormous debacle just to get started with this so-called great Software.

    If its that great——–then why make it extremely difficult to setup?! Us average users in the Windows community already have enough Microsoft headaches to deal with all on their own. You promote a cleaner experience on a faster OS that’s easy to use but fall short of making it a complete package by putting together a very sloppy, at best, installation module, which undoubtedly leaves much to be desired——-to say the least.

    Please fix this problem with the boot-loader/partition/allocation/Root File System Definitions issue. This is an unnecessary road-block which is probably turning away a lot of users whom might otherwise benefit from using this software and whom might actually like it and want to contribute——-but heck!——-if it’s this much trouble just to try to get it installed onto the same drive as my primary OS——-then maybe that’s just one of the reasons why Windows will likely always be my “Primary” choice!

    • JohnM Jan 6, 2015 @ 6:51

      Why not just run your Linux distribution of choice in a VM so that you can tinker around in Linux and still be able to use your windows machine at the same time? I found this to be much easier for me as I get more familiar with linux

    • israel Jan 8, 2015 @ 0:22

      Hi, zeroday1

      I have never had this issue you describe. I have successfuly installed Ubuntu easily for years alongside Windows, and also Mac OSX.
      But I have also installed operating systems before. I have installed DOS, Windows, and (of course) various Linux distros so it may be easier for me to do.

      Installing Ubuntu is much easier and quicker than installing Windows (if you have ever done it) and can detect other OS, unlike Windows, though Mac OSX can detect Windows (usually).

      Installing an OS in a virtual machine would probably suit you better. It is easy to do and will not screw anything up if you make a mistake. If you have a decent processor with vt handling it will run very well. You can also install Ubuntu onto a USB disk, and boot it from your BIOS (if your computer is able to do this).
      If you have you Windows install disks, you can also try installing both in a VM, so you can learn how to do it confidently.

  • Michael Zhou Aug 6, 2015 @ 14:46
    lshw -class disk
  • Ashik Sep 14, 2015 @ 16:33

    Is there any issues to install Redhat Linux 6 in IDE based hard drive machine… When I try to install it on my laptop, its not booting.. Pls help to solve this issue

  • Prema Apr 13, 2016 @ 9:02

    I have doubt in partition. First, I install the os that time itself i partition the hard disk then why we using fdisk command

  • saurabh May 3, 2017 @ 4:13

    sir, there is four partition in my linux os
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags:

    Number Start End Size File system Name Flags
    2 1049kB 109GB 109GB ext4 partition 2
    5 109GB 539GB 430GB ntfs Basic data partition msftdata
    6 539GB 749GB 210GB ext4 Basic data partition msftdata
    1 749GB 1000GB 252GB ext4 partition 1
    but in in the file system i am able to see the
    1 749GB 1000GB 252GB ext4 partition 1
    5 109GB 539GB 430GB ntfs Basic data partition msftdata
    and sda 6 and sda2 is unable to see
    how to mount it in file system

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum