#725342 coreutils: df reports nonexistent device as mounted

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
Eric Cooper
Date:
2013-10-04 12:39:06 UTC
Severity:
normal
#725342#5
Date:
2013-10-04 12:36:00 UTC
From:
To:
Output of df -h (note the /dev/sdb2):
    $ df -h
    Filesystem                         Size  Used Avail Use% Mounted on
    /dev/sda1                          1.8T  734G  1.1T  41% /
    udev                                10M     0   10M   0% /dev
    tmpfs                              800M  428K  800M   1% /run
    tmpfs                              5.0M  4.0K  5.0M   1% /run/lock
    tmpfs                              1.6G  2.2M  1.6G   1% /run/shm
    /dev/sdb2                           50G  1.9G   48G   4% /mnt/hd

But /dev/sdb doesn't exist:
    $ ls -l /dev/sdb
    ls: cannot access /dev/sdb: No such file or directory

The current disk is /dev/sdd:
    $ ls -l /dev/sdd2
    brw-rw---- 1 root floppy 8, 50 Oct  4 07:53 /dev/sdd2

There are entries for both in /proc/mounts:
    $ cat /proc/mounts
    rootfs / rootfs rw 0 0
    sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
    udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=1021771,mode=755 0 0
    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
    tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=818772k,mode=755 0 0
    /dev/disk/by-uuid/a89ff769-8289-453c-9ae3-665caa5ec8a7 / ext4 rw,relatime,data=ordered 0 0
    tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
    tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=1637540k 0 0
    fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
    rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
    /dev/sdb2 /mnt/hd vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro 0 0
    /dev/sdd2 /mnt/hd vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro 0 0

I suggest that in the event of duplicate mountpoints, df should check
for the existence of the device in the entry it reports.