Posted: . At: 10:49 AM. This was 4 years ago. Post ID: 14179
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.



Sponsored



List all SCSI hard disks in your Linux system.


This command will list all installed hard disks in your system. This is using the -S parameter to only list SCSI devices.

𒅑     4.4 Mon Mar 23 jason@Yog-Sothoth 0: $ lsblk -n -S
sda  0:0:0:0    disk Seagate  Expansion Desk   0911 usb
sdb  1:0:0:0    disk ATA      ST3500418AS      CC38 sata
sdc  3:0:0:0    disk ATA      ST3360320AS      N    sata
sdd  4:0:0:0    disk ATA      WDC WDS240G2G0A- 0000 sata
sde  5:0:0:0    disk ATA      WDC WD10EZEX-22M 1A01 sata
sdf  6:0:0:0    disk ATA      WDC WD10EZEX-00W 1A01 sata

A very useful way to list all installed physical hard disk drives on your computer.

List hard drive partitions that have a certain filesystem, in this case, ext4.

     4.4 Wed Mar 25 jason@Yog-Sothoth 0: $ df -Hla --type=ext4
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/fedora-root  246G  187G   47G  81% /
/dev/sdb6                 23G   47M   21G   1% /media/jason/2253b90a-2608-4939-917d-85e1dbcbeebb
/dev/sdb3                 34G  2.1G   31G   7% /media/jason/7ebd3547-7d2b-4d58-a52b-4f7968d14050

This is how to list all NTFS filesystems like mounted Windows drives and external backup drives.

𒅑     4.4 Wed Mar 25 jason@Yog-Sothoth 0: $ df -Hla --type=fuseblk
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       3.1T  458G  2.6T  16% /media/jason/Seagate Expansion Drive
/dev/sdb4       235G  173G   63G  74% /media/jason/My Stuff
/dev/sdf1       1.1T  602G  399G  61% /media/jason/4C1E66AD1E66902E2

List all filesystems like this. This shows you what the filesystem type is for each drive.

𒅑     4.4 Wed Mar 25 jason@Yog-Sothoth 0: $ df -Hla -T | grep "/dev/sd*"
tmpfs                   tmpfs            6.3G  113M  6.2G   2% /dev/shm
/dev/sda2               fuseblk          3.1T  458G  2.6T  16% /media/jason/Seagate Expansion Drive
/dev/sdb6               ext4              23G   47M   21G   1% /media/jason/2253b90a-2608-4939-917d-85e1dbcbeebb
/dev/sdb4               fuseblk          235G  173G   63G  74% /media/jason/My Stuff
/dev/sdf1               fuseblk          1.1T  602G  399G  61% /media/jason/4C1E66AD1E66902E2
/dev/sdb3               ext4              34G  2.1G   31G   7% /media/jason/7ebd3547-7d2b-4d58-a52b-4f7968d14050

These tips should be very helpful when a user wants to know what drives and filesystems are in a Linux machine. Linux is very flexible. There are so many different ways to find out this information.


Leave a Comment

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