Created
December 16, 2016 12:37
-
-
Save maccyber/f1ec2edd8449b14a4333ae7f5c70af26 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# Finds disk and partition where boot is mounted | |
lsblk -i --output KNAME,TYPE,MOUNTPOINT | while read KNAME TYPE MOUNTPOINT | |
do | |
if [ "$TYPE" = "disk" ]; then | |
SELECTED_DISK="$KNAME" | |
elif [ "$MOUNTPOINT" = "/boot" ]; then | |
printf "Disk: $SELECTED_DISK\nPartition: $KNAME\n" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment