#!/bin/sh rootdev=unknown while read fsdev fspath rest; do case "$fsdev" in /dev/root|rootfs) continue ;; esac if [ "$fspath" = "/" ]; then rootdev="$fsdev" fi done < /proc/self/mounts if [ "$rootdev" != "unknown" ]; then echo "The root file system is on $rootdev" else echo "/proc/mounts doesn't have an entry for the root file system!" fi