/proc/mounts exposes /dev/root instread of real device and it is not always available
I think that if you do not use initrd, it is not created. mount command gives the real device
tri-yann4:/tmp# cat /proc/mounts /dev/root / ext4 rw,noatime,nodiratime,discard,errors=remount-ro,data=ordered 0 0 ... mount /dev/sdb10 on / type ext4 (rw,noatime,nodiratime,discard,errors=remount-ro,data=ordered)
findmnt -n -o SOURCE / /dev/sdb10
I've seen mount show multiple roots when /dev/root is present. Could you provide some details of distro and version you are using?
I'm using debian, unstable. Just I have no initrd because I build my own kernels for the nas
Note that the script barks and fails because it does not find /dev/root (which indeed does not exist). So I have to manually create the link. I was more thinking of a fallback if /dev/root does not exist...