#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Thanks ;-)