df reports root fs as by-uuid symlink instead of actual device

I recently noticed my updated debian install (7.4 Wheezy) was displaying the root file system as /dev/disk/by-uuid/aa89d2a0-12cc-4378-b3be-7788999529a2 instead of by device and partition ID (/dev/sda3 in my case)

I found this solution at
http://blog.mbentley.net/2013/09/df-reports-root-fs-as-by-uuid-symlink-instead-of-actual-device/
Which references a solution at
http://crunchbang.org/forums/viewtopic.php?id=25901

Here’s the solution:

Create a file
/etc/initramfs-tools/scripts/local-premount/rootdevice

Paste the following into this file
#!/bin/sh
# Mimic a “normal” mount of root device by translating the device link
# (UUID or LABEL) to the actual device.

set -e

[ “$1” = prereqs ] && exit 0

REALROOT=`readlink -f ${ROOT}`
[ “${REALROOT}” ] && echo “ROOT=${REALROOT}” >> /conf/param.conf

exit 0

Make the file executable
chmod +x /etc/initramfs-tools/scripts/local-premount/rootdevice
Update initramfs
update-initramfs -u

Reboot and it should reference the partition instead of the UUID

Scroll to Top