Posted: . At: 7:16 AM. This was 4 months ago. Post ID: 18971
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


List all hard disk storage in your PC using inxi.


Listing all HDD storage in your PC with inxi is very easy, this one-liner will perform this task very well. This example shows the information.

  • ID
  • Size
  • Speed
  • Serial
(jcartwright@localhost) 192.168.1.5 ~  $ inxi -Dxx | grep -E "(serial:|ID-[0-9]|size:)"
  ID-1: /dev/nvme0n1 vendor: Crucial model: CT500P2SSD8 size: 465.76 GiB
    speed: 31.6 Gb/s lanes: 4 serial: 2053E4E39EDA
  ID-2: /dev/sda vendor: Western Digital model: WD10EZEX-00WN4A0
    size: 931.51 GiB speed: 6.0 Gb/s serial: WD-WMC6Y0H2UER3
  ID-3: /dev/sdb vendor: Crucial model: CT1000BX500SSD1 size: 931.51 GiB
    speed: 6.0 Gb/s serial: 2144E5E15CE3
  ID-4: /dev/sdc vendor: Fanxiang model: S101 512GB MX size: 476.94 GiB
    speed: 6.0 Gb/s serial: 00000000000020321
  ID-5: /dev/sdd vendor: Seagate model: Expansion Desk size: 2.73 TiB
    type: USB rev: 2.1 spd: 480 Mb/s lanes: 1 serial: N/A
  ID-6: /dev/sde vendor: Western Digital model: WD10JMVW-11AJGS4
    size: 931.48 GiB type: USB rev: 2.1 spd: 480 Mb/s lanes: 1
    serial: WD-WXS1A37KNS73

This may also be done using lsblk. This is how to print the serial and partitions for all drives on your PC.

(jcartwright@localhost) 192.168.1.5 ~  $ lsblk -lno SERIAL,NAME,VENDOR,UUID,LABEL
WD-WMC6Y0H2UER3      sda            ATA                                             
                     sda1                    7E1A-343A                              
                     sda2                    8468f575-02e2-4e7f-b186-bcb9cc75926a   
                     sda3                    KIuLtx-XELv-7fIj-z6Kp-TGiZ-Aump-Von0oS 
2144E5E15CE3         sdb            ATA                                             
                     sdb1                                                           
                     sdb2                    E0A2420BA241E71E                       1 TB
MX_00000000000020321 sdc            ATA                                             
                     sdc1                    86c585d1-ab5f-4973-8012-210e0cf086f3   
                     sdc2                    1384-30B4                              
NA8X6JZL             sdd            Seagate                                         
                     sdd1                                                           
                     sdd2                    B66057376056FE15                       Seagate Expansion Drive
WD-WXS1A37KNS73      sde            WD                                              
                     sde1                    FA147ACD147A8BFF                       Media
                     almalinux-root          43d80849-2a61-4e27-8172-47dd6f0ccd3d   
                     almalinux-swap          37d2350b-bf03-400d-a096-93c819c7ab1c   
                     almalinux-home          a7eb77c1-a723-4dab-9b4d-f7ea93e4432c   
2053E4E39EDA         nvme0n1                                                        
                     nvme0n1p1               488A-2F6A                              
                     nvme0n1p2                                                      
                     nvme0n1p3               8E408BBD408BAA93                       
                     nvme0n1p4               EE6451F76451C2CF

And finally, another way to do this. This is very simple.

(jcartwright@localhost) 192.168.1.5 ~  $ lsblk --nodeps -o name,serial,size
NAME    SERIAL                 SIZE
sda     WD-WMC6Y0H2UER3      931.5G
sdb     2144E5E15CE3         931.5G
sdc     MX_00000000000020321 476.9G
sdd     NA8X6JZL               2.7T
sde     WD-WXS1A37KNS73      931.5G
nvme0n1 2053E4E39EDA         465.8G

Finally, the lshw utility will return this information but requires root access.

[root@localhost jcartwright]# lshw -C disk | grep "serial\|description\|product\|size:"
       description: ATA Disk
       product: CT1000BX500SSD1
       serial: 2144E5E15CE3
       size: 931GiB (1TB)
       description: ATA Disk
       product: WDC WD10EZEX-00W
       serial: WD-WMC6Y0H2UER3
       size: 931GiB (1TB)
       description: ATA Disk
       product: Fanxiang S101 51
       serial: MX_00000000000020321
       size: 476GiB (512GB)
       description: NVMe disk
       description: NVMe disk
       size: 465GiB (500GB)
       description: SCSI Disk
       product: Expansion Desk
       serial: NA8X6JZL
       size: 2794GiB (3TB)
       description: SCSI Disk
       product: My Passport 25E1
       serial: WXS1A37KNS73
       size: 931GiB (1TB)

I hope this is very helpful to a Linux user who requires access to disk information. This is not difficult to do.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.