Linux lsblk Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux lsblk Guide
Complete beginner-friendly guide to lsblk on Linux, covering Arch Linux, CachyOS, and other distributions including listing block devices, device information, and disk management.
Table of Contents
Understanding lsblk
What is lsblk?
lsblk lists block devices.
Uses:
- List disks: See all storage devices
- Device info: Get device details
- Partition info: View partitions
- Mount info: See mount points
Why it matters:
- Disk management: Identify devices
- Partitioning: Plan disk layout
- Troubleshooting: Diagnose disk issues
lsblk Basics
List Devices
Basic usage:
# List all block devices
lsblk
# Tree format (default)
lsblk
Output Format
Columns:
- NAME: Device name
- MAJ:MIN: Major/minor numbers
- RM: Removable
- SIZE: Device size
- RO: Read-only
- TYPE: Device type
- MOUNTPOINT: Mount point
lsblk Options
Output Formats
Different formats:
# List format
lsblk -l
# JSON format
lsblk -J
# Raw format
lsblk -r
Filter Devices
Filter output:
# Show only disks
lsblk -d
# Show specific device
lsblk /dev/sda
# Exclude devices
lsblk -e 7
Device Information
Detailed Information
More details:
# Show filesystem info
lsblk -f
# Show model and serial
lsblk -o NAME,SIZE,MODEL,SERIAL
# Show all columns
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE,UUID
Tree View
Hierarchical view:
# Tree format
lsblk
# ASCII tree
lsblk -a
Troubleshooting
Device Not Showing
Check system:
# List all devices
lsblk -a
# Check /dev
ls -la /dev/sd*
# Check dmesg
dmesg | grep -i disk
Summary
This guide covered lsblk usage, device listing, and disk information for Arch Linux, CachyOS, and other distributions.
Next Steps
- Disk Utilities - Disk tools
- Filesystem Management - Filesystem setup
- mount Guide - Mounting devices
- lsblk Documentation:
man lsblk
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.