Created
March 22, 2018 22:21
-
-
Save felixhummel/b0ba885febc4010dd0614011806569bd to your computer and use it in GitHub Desktop.
list physical disks and their partitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment