Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
echo "| Name | Partition | Size (kB) | Path | Type |"
echo "|------|-----------|-----------|------|------|"
for d in /dev/block/bootdevice/by-name/*; do
name=$(basename -- "$d")
device=$(basename "$(readlink -- "$d")")
read -r _ fsmount fstype _ <<EOF
$(grep --fixed-strings "$d" /proc/mounts)
EOF
blocks=$(grep -E " $device$" /proc/partitions | awk '{ print $3 }')
size=$(( blocks / 2 ))
echo "| $name | $device | $size | $fsmount | $fstype |"
done
@AzagraMac

This comment has been minimized.

Copy link

AzagraMac commented Nov 4, 2019

Thanks ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.