+linux_find_root_device() {
+ ROOT_DEVICE=$(mountpoint -d /)
+
+ for devnode in $(find /dev);
+ do
+ # Get major and minor in decimal
+ CURRENT_DEVICE=$(printf "%d:%d" $(stat --printf="0x%t 0x%T" "$devnode"))
+ if [ $CURRENT_DEVICE = $ROOT_DEVICE ];
+ then
+ ROOT_NODE="$devnode"
+ break
+ fi
+ done
+
+ echo "$ROOT_NODE"
+}
+