Bug 374 - Duplicated entries in /etc/mtab
: Duplicated entries in /etc/mtab
Status: RESOLVED FIXED
Product: Desktop Bugs
Classification: ROSA Desktop
Component: Main Packages
: Marathon
: All Linux
: Normal normal
: ---
Assigned To: ROSA Linux Bugs
: ROSA Linux Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-13 13:42 MSD by Denis Silakov
Modified: 2013-01-14 11:09 MSK (History)
7 users (show)

See Also:
RPM Package: setup-2.7.18-6-rosa.lts2012.0.x86_64
ISO-related:
Bad POT generating:
Upstream:
vladimir.potapov: qa_verified+
alex.burmashev: published+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Silakov 2012-06-13 13:42:17 MSD
It seems that /etc/mtab is not cleaned up with reboot and the new entries are appended to the ones left from the previous session. For example:

$cat /etc/mtab.old | grep sdb
/dev/sdb1 /mnt/storage ext4 rw,commit=0 0 0
/dev/sdb1 /mnt/storage ext4 rw,commit=0 0 0
/dev/sdb1 /mnt/storage ext4 rw,commit=0 0 0
/dev/sdb1 /mnt/storage ext4 rw,commit=0 0 0
/dev/sdb1 /mnt/storage ext4 rw,commit=0 0 0
/dev/sdb1 /mnt/storage ext4 rw,commit=0 0 0
/dev/sdb1 /mnt/storage ext4 rw,commit=0 0 0

As a side effect, tools like df list every partition several times:
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       914G  414G  454G  48% /mnt/storage
/dev/sdb1       914G  414G  454G  48% /mnt/storage
/dev/sdb1       914G  414G  454G  48% /mnt/storage
...

This seems to be a known issue with systemd:
https://bugzilla.redhat.com/show_bug.cgi?id=655571

In that upstream bug, Lennart Poettering suggested to make /etc/mtab a symlink to /proc/mounts. Will this solution work in ROSA or it can break something?

Note also that /etc/mtab -> /proc/mounts symlink will make df output to look slightly unusual. There are some discussion about this in redhat bugzilla, as well:
https://bugzilla.redhat.com/show_bug.cgi?id=709351
Comment 1 Aleksandr Kazantcev 2012-06-13 13:47:26 MSD
For my system 

mtab -> /proc/self/mounts

and duplicate not available
Comment 2 Denis Silakov 2012-06-13 14:54:01 MSD
(In reply to comment #1)
> For my system 
> 
> mtab -> /proc/self/mounts
> 
> and duplicate not available

In ROSA /proc/mounts is a symlink to /proc/self/mounts :)
Comment 3 Sylvainsjc 2012-07-23 14:02:12 MSD
Hi,

I'm also affected by this bug

1) I delete the /etc/mtab file using a live DVD
2) Below's the result of "mount -l" after 2 reboot 

[root@rosa2012lts ~]# mount -l
/dev/sda1 on / type ext4 (rw,noatime,nodiratime,discard,commit=0) [ssdsys]
mqueue on /dev/mqueue type mqueue (rw)
securityfs on /sys/kernel/security type securityfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
hugetlbfs on /dev/hugepages type hugetlbfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc type proc (rw)
mqueue on /dev/mqueue type mqueue (rw)
securityfs on /sys/kernel/security type securityfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
hugetlbfs on /dev/hugepages type hugetlbfs (rw)
tmpfs on /tmp type tmpfs (rw,noexec,nosuid,nodev,noatime,mode=0777)                                                                 
/dev/sda5 on /home type ext4 (rw,noatime,acl,commit=0) [ssdhome]                                                                    
/dev/sdb3 on /mnt/datas type ext4 (rw,errors=remount-ro,commit=0) [datas]                                                           
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)                                                                       
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)                                                                              
[root@rosa2012lts ~]#
Comment 4 Denis Silakov 2012-08-20 16:16:35 MSD
*** Bug 631 has been marked as a duplicate of this bug. ***
Comment 5 Denis Silakov 2012-08-20 16:17:34 MSD
Also note that messages like this one:

df: `/sys/fs/fuse/connections': No such file or directory

can be also fixed by turning /etc/mtab into a symlink to /proc/mounts.
Comment 6 Aleksandr Kazantcev 2012-10-30 14:52:59 MSK
*** Bug 1033 has been marked as a duplicate of this bug. ***
Comment 7 alexander barakin 2012-12-18 15:21:29 MSK
does it make sense to include symlink /etc/mtab -> /proc/mounts in any base package?
f.e. "filesystem".
Comment 8 alexander barakin 2012-12-18 20:20:40 MSK
*** Bug 1033 has been marked as a duplicate of this bug. ***
Comment 9 Denis Silakov 2012-12-20 12:25:59 MSK
In Marathon, /etc/mtab is owned by 'setup' package (the file is created in its preinstall script).

In Desktop.Fresh 2012, this file is owned by utils-linux (and it is created as a symlink to /proc/self/mounts).
Comment 10 Denis Silakov 2012-12-20 14:06:18 MSK
(In reply to comment #9)
> In Marathon, /etc/mtab is owned by 'setup' package (the file is created in
> its preinstall script).

Sorry, not in preinstall, it is provided by the package itself.

> 
> In Desktop.Fresh 2012, this file is owned by utils-linux (and it is created
> as a symlink to /proc/self/mounts).
Comment 11 alexander barakin 2012-12-20 18:48:03 MSK
so, i fixed the package "setup".

advisory: /etc/mtab now is symlink to /proc/self/mounts; closes bug #374
https://abf.rosalinux.ru/build_lists/857666
https://abf.rosalinux.ru/build_lists/857667
Comment 12 Denis Silakov 2012-12-20 19:35:55 MSK
advisory: /etc/mtab is now a symlink to /proc/self/mounts; closes bug #374

Buildlists:
https://abf.rosalinux.ru/build_lists/857666
https://abf.rosalinux.ru/build_lists/857667
Comment 13 Vladimir Potapov 2012-12-22 11:36:39 MSK
setup-2.7.18-7-rosa.lts2012.0
**************** Advisory ********************
closes bug #374 (duplicates in /etc/mtab)
/etc/mtab is now a symlink to /proc/self/mounts; 
**********************************************
QA Verified
Comment 14 FirstLevel 2013-01-14 10:56:12 MSK
User has asnwered that ptroblem exist with setup-2.7.18-7.
This is output of his df command
# df
Файловая система Размер Использовано  Дост Использовано% Cмонтировано в
rootfs              12G         5,7G  5,6G           51% /
devtmpfs           3,9G            0  3,9G            0% /dev
tmpfs              3,9G            0  3,9G            0% /dev/shm
tmpfs              3,9G         4,9M  3,9G            1% /run
/dev/sda1           12G         5,7G  5,6G           51% /
tmpfs              3,9G         4,9M  3,9G            1% /run
tmpfs              3,9G            0  3,9G            0% /sys/fs/cgroup
tmpfs              3,9G            0  3,9G            0% /media
/dev/sda6          132G          24G  109G           18% /home

As You can see he has duplicate of etries.
Comment 15 Denis Silakov 2013-01-14 11:07:46 MSK
Formally, there is only duplicate here ('/run') folder. There is also a logical duplicate - 'rootfs' is actually the same as '/dev/sda1'.

This is a specific of our /proc/mounts and this is a completely different issue; feel free to create a new bug for it (it seems that the same issue was fixed in Fedora not long ago - https://bugzilla.redhat.com/show_bug.cgi?id=749356).

The original issue reported here was that new entries were attached to /etc/mtab after each reboot; that issue is fixed.
Comment 16 Denis Silakov 2013-01-14 11:09:40 MSK
... moreover, the issue is not present in Desktop Fresh 2012, where we use the freshest coreutils.