Due to so many tmpfs file system entries nowadays under Linux (and expecially under Gentoo the special behaviour, that the root fs / is double counted, b/c listed twice in the mount command output) that summarizing does not make sense, isn't it ?
This is true but there is no universal solution to this problem
Well, a quick&dirty approach could be to sum up tmpfs / devtmpfs separetely
But what about filesystems mounted eg twice ?
yes, IMO such a case :
tfoerste@n22 ~ $ mount | grep ' / '
rootfs on / type rootfs (rw)
/dev/sdb3 on / type ext4 (rw,noatime,commit=0)
should be counted only once, the unique identifier is column 3 of the mount command
What if for example:
mount -t cifs '//192.168.1.22/SHARE1' /mnt/share1 -o user=guest,guest,file_mode=0666,ro
mount -t cifs '//192.168.1.22/SHARE2' /mnt/share2 -o user=guest,guest,file_mode=0666,ro
Both SHARE1 and SHARE2 are on the C drive computer 192.168.1.22.
The total volume is doubled and so in fact it should not be.
For this I think that it is better not solve the problem because there are too many possible exceptions.