# DDI - Dump Disk Information
#
# Dumps the UUID and label of a filesystem to its / (root) directory.
# Parses df output to find current mounts and then uses lsblk to get info.

for dev in `df -h | grep ^/dev | cut -d\  -f1 | cut -d/ -f3`; do
  loc=`cat /proc/mounts | grep $dev | cut -d\  -f2`
  lsblk -fn -o UUID /dev/$dev > $loc/.uuid
  lsblk -fn -o LABEL /dev/$dev > $loc/.label
done