What is lsblk?
The lsblk command is one of the most important Linux commands used during embedded Linux bring-up.
It helps engineers verify storage detection, partition layout, and root filesystem mounting on devices such as eMMC, SD card, and NAND-based systems.
lsblk stands for list block devices.
It is used to display information about storage devices such as:
- eMMC
- SD card
- USB storage
- NAND/NOR block devices
- Partitions
In embedded Linux systems, lsblk is one of the most important commands for verifying storage detection during bring-up.
Why lsblk is important in embedded systems
During embedded Linux development, storage-related problems are very common:
- SD card not detected
- eMMC partitions missing
- Root filesystem not mounted
- Wrong partition layout
- Device nodes not created
The lsblk command helps you quickly confirm:
- Whether the kernel detected the storage
- Partition structure
- Mount points
- Device hierarchy
Basic Syntax
lsblkThis shows all the available block devices in a tree
Example Output
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 7.0G 0 part /Understanding the output
| Column | Meaning |
|---|---|
| NAME | Device name |
| MAJ:MIN | Major and minor device numbers |
| RM | Removable device |
| SIZE | Device or partition size |
| RO | Read-only flag |
| TYPE | disk / part |
| MOUNTPOINT | Where it is mounted |
Common block device names in embedded Linux
| Device | Meaning |
|---|---|
| mmcblk0 | Primary eMMC or SD card |
| mmcblk0p1 | Partition 1 |
| mmcblk0p2 | Partition 2 |
| sda | USB storage |
| mtdblock0 | NAND block device |
Useful lsblk options
Show filesystem type
lsblk -fExample
NAME FSTYPE LABEL UUID MOUNTPOINT
mmcblk0p1 vfat 12AB-34CD /boot
mmcblk0p2 ext4 a1b2c3d4-e5f6 /This is extremely useful for verifying root filesystem format.
Show size in human-readable format
lsblk -hShows sizes like MB, GB.
Show only block devices (no RAM disks)
lsblk -o NAME,SIZE,TYPE,MOUNTPOINTUseful when debugging minimal rootfs
lsblk vs df vs mount
| Command | Purpose |
|---|---|
| lsblk | Shows device and partition structure |
| df | Shows filesystem usage |
| mount | Shows mounted filesystems |
During bring-up, lsblk is used first, then mount, then df.
Practical embedded Linux use cases
1. Verify SD card detection
After boot:
lsblkIf mmcblk0 does not appear → kernel or device tree issue.
2. Verify partition layout
Check whether expected partitions exist:
- boot
- rootfs
- data
lsblkWrong partition table → Yocto image issue
3. Check root filesystem mount
Look at MOUNTPOINT.
If / is missing → boot argument issue.
Common issues and debugging
Issue: lsblk command not found
On minimal systems (BusyBox):
- lsblk may not be enabled
Solution:
- Enable util-linux in Yocto
- Or enable lsblk in BusyBox config
Issue: Device visible in dmesg but not in lsblk
Possible reasons:
- No partition table
- Block driver not enabled
- Missing udev
Check:
dmesg | grep mmcSummary
- lsblk lists block devices and partitions
- Essential for embedded Linux bring-up
- Helps debug storage, rootfs, and boot issues
- Used heavily during Yocto development
- One of the first commands engineers run after boot
What to learn next
After understanding lsblk, continue with:
- mount command
- df command
- Linux filesystem layout
- Root filesystem concepts
These topics are crucial before moving to Yocto and BSP development.