Site icon New Generation Enterprise Linux

Stop lsblk from showing you those annoying loop devices

Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)

Stop lsblk from showing you those annoying loop devices

🧩 The Challenge

Dealing with a server full of snap packages is a nightmare because lsblk lists every single loopback mount, making it impossible to see the actual block devices I care about. I’ve wasted so much time scrolling past a dozen /dev/loop entries just to find my real disks.

💡 The Fix

You can use the built-in exclude flag to filter out those loop devices entirely and keep your output clean. It makes identifying the physical drives take half a second instead of hunting through junk.

lsblk -e 7

⚙️ Why It Works

Passing -e 7 tells the command to ignore major device number 7, which is where all those pesky loop devices live. It’s a quick way to clean up the noise and get back to your actual hardware.

🚀 Pro-Tip: Alias this to lsblk in your .bashrc and stop looking at snap garbage forever.

Linux Tips & Tricks | © ngelinux.com | 8/12/2026

0 0 votes
Article Rating
Exit mobile version