Use lsblk Command for Storage Analysis

As I’m working through my very first ebook under the Unix Tutorial brand, I’m learning lots of very interesting things about managing software RAID devices.

Part of effective RAID management is knowing where you stand. I’ve shown you how to use /proc/mdstat already, but today’s command is a higher level one (works with all storage devices, not just RAID).

I use lsblk to report sizes of all the storage devices in my Linux system along with mount points (if known) and RAID membership info.

For each RAID device, you’ll see the following:

type of RAID array – raid0, raid5, etc RAID array that any device is a member of Check this out:

[email protected]:~# lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
NAME SIZE FSTYPE TYPE MOUNTPOINT
loop0 86.6M squashfs loop /snap/core/4486
loop1 86.9M squashfs loop /snap/core/4917
sda 10G disk
├─sda1 1M part
└─sda2 10G ext4 part /
sdb 1G linux_raid_member disk
└─md0 2G ext4 raid0 /raid0
sdc 1G linux_raid_member disk
└─md0 2G ext4 raid0 /raid0
sdd 1G linux_raid_member disk
└─md1 1023M ext4 raid1
sde 1G linux_raid_member disk
└─md1 1023M ext4 raid1
sdf 1G linux_raid_member disk
└─md2 2G ext4 raid5
sdg 1G linux_raid_member disk
└─md2 2G ext4 raid5
sdh 1G linux_raid_member disk
└─md2 2G ext4 raid5
sdi 1G disk
sdj 1G disk
sr0 1024M rom

In this output you can see that sdb and sdc are members of RAID0 array md0. sdd and sde are forming RAID1 called md1. Finally, sdf/sdg/sdh are members of RAID5 array.




Keep Learning with Me

Follow me on Facebook and Twitter or jump into Telegram chat!:
Recommended Software
I use Brave browser, it's awesome: Brave Browser I'm also a fan of SetApp for macOS: SetApp for macOS
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!
Recent Articles
14 Oct 2021

Ubuntu 21.10 Impish Indri

15 Aug 2021

Python 3.10 Released

15 Aug 2021

Debian 11 Bullseye Released

Recent Tweets