#!/bin/bash set -euo pipefail # major device number 7 is loop # grep loop /proc/devices #disks=$(lsblk --raw --noheadings -o type,name | grep ^disk | awk '{ print "/dev/"$2 }') # weird though: "--exclude 252" (device-mapper) does not work... lsblk -o MAJ:MIN,UUID,SIZE,LABEL,NAME,MOUNTPOINT,FSTYPE --exclude 7 | grep -v ^252