This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 701176

Summary: partitions mounted twice
Product: [Fedora] Fedora Reporter: Jason Haar <jhaar>
Component: pamAssignee: Tomas Mraz <tmraz>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: agk, aquini, dwalsh, dwysocha, erik_squires, gabriel, horsley1953, h.reindl, johannbg, jonathan, kdudka, kzak, lpoetter, lvm-team, maxamillion, mbroz, metherid, mishu, mschmidt, mwc-250sav, notting, opensource, ovasik, p, pjones, plautrba, prockai, tmraz, twaugh, whulbert, zingale
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-07 15:49:20 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Jason Haar 2011-05-01 16:30:58 EDT
Description of problem:

Many of the partitioned created during the install process of FC15 are mounted twice

This seems pretty weird - which makes me wonder if its a bug triggered by me choosing the "encrypt disk" option during the install. Just a total guess - so the component choice above could be waaaaaay off

Version-Release number of selected component (if applicable):


How reproducible:

Don't know - only installed FC15 once

Steps to Reproduce:
1.
2.
3.
  
Actual results:

Here's "df" - notice how rootfs == /dev/mapper/vg_tnzjhaardell-lv_root, and /tmp, /var/tmp and /home are all mounted as the same partition, and /home is mounted twice

[root@jhaar-fc-nzcl ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                51606140  30172496  20909544  60% /
udev                   4026572         0   4026572   0% /dev
tmpfs                  4068936       500   4068436   1% /dev/shm
tmpfs                  4068936       836   4068100   1% /run
/dev/mapper/vg_tnzjhaardell-lv_root
                      51606140  30172496  20909544  60% /
tmpfs                  4068936       184   4068752   1% /sys/fs/cgroup
tmpfs                  4068936         0   4068936   0% /media
/dev/sda1               495844     73141    397103  16% /boot
/dev/mapper/vg_tnzjhaardell-lv_home
                     183943268  30948304 143651172  18% /home
/dev/mapper/vg_tnzjhaardell-lv_root
                      51606140  30172496  20909544  60% /tmp
/dev/mapper/vg_tnzjhaardell-lv_root
                      51606140  30172496  20909544  60% /var/tmp
/dev/mapper/vg_tnzjhaardell-lv_home
                     183943268  30948304 143651172  18% /home
[root@jhaar-fc-nzcl ~]# 


Expected results:


Additional info:
Comment 1 Kamil Dudka 2011-05-01 17:05:39 EDT
Please attach the contents of your /etc/mtab and /proc/mounts.  This seems as duplicate of bug #655571 .
Comment 2 Jason Haar 2011-05-01 17:16:22 EDT
OK, I've read #655571 and /etc/mtab is indeed a symlink to /proc/mounts, so that isn't it.

Here's the output of "cat /proc/mounts". Hmm "rootfs" - isn't that only supposed to exist during the initrd process? It certainly doesn't match /etc/fstab: in there "/" is meant to be /dev/mapper/vg_tnzjhaardell-lv_root (which is the 8th line). Could it be that the initrd mounted partitioned are merged into the boot-time partitions - instead of being replaced by them?


rootfs / rootfs rw 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=4026572k,nr_inodes=1006643,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 0 0
/dev/mapper/vg_tnzjhaardell-lv_root / ext4 rw,relatime,barrier=1,data=ordered 0 0
tmpfs /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/ns cgroup rw,nosuid,nodev,noexec,relatime,ns 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
systemd-1 /sys/kernel/security autofs rw,relatime,fd=31,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
systemd-1 /sys/kernel/debug autofs rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
systemd-1 /dev/mqueue autofs rw,relatime,fd=33,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
systemd-1 /dev/hugepages autofs rw,relatime,fd=34,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=36,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
tmpfs /media tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 0 0
/dev/sda1 /boot ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/mapper/vg_tnzjhaardell-lv_home /home ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/mapper/vg_tnzjhaardell-lv_root /tmp ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/mapper/vg_tnzjhaardell-lv_root /var/tmp ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/mapper/vg_tnzjhaardell-lv_home /home ext4 rw,relatime,barrier=1,data=ordered 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
gvfs-fuse-daemon /home/AP/jhaar/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=16777216,group_id=16777216 0 0
/etc/auto.misc /misc autofs rw,relatime,fd=6,pgrp=20628,timeout=300,minproto=5,maxproto=5,indirect 0 0
-hosts /net autofs rw,relatime,fd=12,pgrp=20628,timeout=300,minproto=5,maxproto=5,indirect 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
cgroup /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
Comment 3 Kamil Dudka 2011-05-01 18:28:20 EDT
df just prints what /proc/mounts produces.  This does not look as a bug of coreutils.
Comment 4 Ondrej Vasik 2011-05-03 09:50:38 EDT
I'm going to reassign this bugzilla to util-linux (where the mount come from) - as he could have better insight into the problem and probably reassign that further properly (I'm not sure if that's issue of device-mapper* or kernel) ...
Comment 5 Karel Zak 2011-05-04 03:07:52 EDT
Well, the devices are probably mounted by systemd. 

It would be nice to have:

 - cat /etc/fstab
 - cat /proc/self/mountinfo
 - (and/or) output from the findmnt command

The tmp stuff seems like bind mounts, not sure why the /home is mounted twice...
Comment 6 Jason Haar 2011-05-04 07:30:35 EDT
Here you go. By the way, I have installed autofs since submitting this ticket - so it's not to blame

-----------------------------------------------------------------------

cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Apr 27 09:58:17 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_tnzjhaardell-lv_root /                       ext4    defaults        1 1
UUID=6d8814cd-e1a4-4dec-bd8b-ade67ab9637d /boot                   ext4    defaults        1 2
/dev/mapper/vg_tnzjhaardell-lv_home /home                   ext4    defaults        1 2
/dev/mapper/vg_tnzjhaardell-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

---------------------------------------------------------------------------------
cat /proc/self/mountinfo
16 22 0:3 / /proc rw,relatime - proc /proc rw
17 22 0:16 / /sys rw,relatime - sysfs /sys rw
18 22 0:5 / /dev rw,nosuid,relatime - devtmpfs udev rw,size=4026572k,nr_inodes=1006643,mode=755
19 18 0:10 / /dev/pts rw,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000
20 18 0:17 / /dev/shm rw,relatime - tmpfs tmpfs rw
21 22 0:18 / /run rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,mode=755
22 1 253:2 / / rw,relatime shared:1 - ext4 /dev/mapper/vg_tnzjhaardell-lv_root rw,barrier=1,data=ordered
23 17 0:19 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,mode=755
24 23 0:20 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
26 23 0:22 / /sys/fs/cgroup/ns rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,ns
27 23 0:23 / /sys/fs/cgroup/cpu rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpu
33 23 0:29 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,blkio
34 17 0:30 / /sys/kernel/security rw,relatime - autofs systemd-1 rw,fd=31,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
35 17 0:31 / /sys/kernel/debug rw,relatime - autofs systemd-1 rw,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
36 18 0:32 / /dev/mqueue rw,relatime - autofs systemd-1 rw,fd=33,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
37 18 0:33 / /dev/hugepages rw,relatime - autofs systemd-1 rw,fd=34,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
38 16 0:34 / /proc/sys/fs/binfmt_misc rw,relatime - autofs systemd-1 rw,fd=36,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
39 22 0:35 / /media rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,mode=755
40 22 8:1 / /boot rw,relatime - ext4 /dev/sda1 rw,barrier=1,data=ordered
41 22 253:3 / /home rw,relatime - ext4 /dev/mapper/vg_tnzjhaardell-lv_home rw,barrier=1,data=ordered
42 22 253:2 /tmp /tmp rw,relatime - ext4 /dev/mapper/vg_tnzjhaardell-lv_root rw,barrier=1,data=ordered
43 22 253:2 /var/tmp /var/tmp rw,relatime - ext4 /dev/mapper/vg_tnzjhaardell-lv_root rw,barrier=1,data=ordered
45 41 253:3 / /home rw,relatime - ext4 /dev/mapper/vg_tnzjhaardell-lv_home rw,barrier=1,data=ordered
25 22 0:21 / /var/lib/nfs/rpc_pipefs rw,relatime shared:2 - rpc_pipefs sunrpc rw
28 22 0:24 / /misc rw,relatime shared:3 - autofs /etc/auto.misc rw,fd=6,pgrp=1373,timeout=300,minproto=5,maxproto=5,indirect
29 22 0:25 / /net rw,relatime shared:4 - autofs -hosts rw,fd=12,pgrp=1373,timeout=300,minproto=5,maxproto=5,indirect
30 17 0:26 / /sys/fs/fuse/connections rw,relatime - fusectl fusectl rw
31 45 0:27 / /home/jhaar/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=504
32 29 0:28 / /net/whanau.org/home rw,relatime shared:5 - autofs -hosts rw,fd=12,pgrp=1373,timeout=300,minproto=5,maxproto=5,offset
46 29 0:36 / /net/whanau.org/mnt/cdrom rw,relatime shared:6 - autofs -hosts rw,fd=12,pgrp=1373,timeout=300,minproto=5,maxproto=5,offset
47 29 0:37 / /net/whanau.org/mythtv rw,relatime shared:7 - autofs -hosts rw,fd=12,pgrp=1373,timeout=300,minproto=5,maxproto=5,offset
48 29 0:38 / /net/whanau.org/var/nfs rw,relatime shared:8 - autofs -hosts rw,fd=12,pgrp=1373,timeout=300,minproto=5,maxproto=5,offset
-----------------------------------------------------------------------------
findmnt
TARGET                        SOURCE                                        FSTYPE         OPTIONS
/                             /dev/mapper/vg_tnzjhaardell-lv_root           ext4           rw,relatime,barrier=1,data=ordered
├─/proc                       /proc                                         proc           rw,relatime
│ └─/proc/sys/fs/binfmt_misc  systemd-1                                     autofs         rw,relatime,fd=36,pgrp=1,timeout=300,minproto=5,maxproto=5
├─/sys                        /sys                                          sysfs          rw,relatime
│ ├─/sys/fs/cgroup            tmpfs                                         tmpfs          rw,nosuid,nodev,noexec,relatime,mode=755
│ │ ├─/sys/fs/cgroup/systemd  cgroup                                        cgroup         rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd
│ │ ├─/sys/fs/cgroup/ns       cgroup                                        cgroup         rw,nosuid,nodev,noexec,relatime,ns
│ │ ├─/sys/fs/cgroup/cpu      cgroup                                        cgroup         rw,nosuid,nodev,noexec,relatime,cpu
│ │ └─/sys/fs/cgroup/blkio    cgroup                                        cgroup         rw,nosuid,nodev,noexec,relatime,blkio
│ ├─/sys/fs/fuse/connections  fusectl                                       fusectl        rw,relatime
│ ├─/sys/kernel/security      systemd-1                                     autofs         rw,relatime,fd=31,pgrp=1,timeout=300,minproto=5,maxproto=5
│ └─/sys/kernel/debug         systemd-1                                     autofs         rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5
├─/dev                        udev                                          devtmpfs       rw,nosuid,relatime,size=4026572k,nr_inodes=1006643,mode=75
│ ├─/dev/pts                  devpts                                        devpts         rw,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/shm                  tmpfs                                         tmpfs          rw,relatime
│ ├─/dev/mqueue               systemd-1                                     autofs         rw,relatime,fd=33,pgrp=1,timeout=300,minproto=5,maxproto=5
│ └─/dev/hugepages            systemd-1                                     autofs         rw,relatime,fd=34,pgrp=1,timeout=300,minproto=5,maxproto=5
├─/run                        tmpfs                                         tmpfs          rw,nosuid,nodev,noexec,relatime,mode=755
├─/var/lib/nfs/rpc_pipefs     sunrpc                                        rpc_pipefs     rw,relatime
├─/misc                       /etc/auto.misc                                autofs         rw,relatime,fd=6,pgrp=1373,timeout=300,minproto=5,maxproto
├─/net                        -hosts                                        autofs         rw,relatime,fd=12,pgrp=1373,timeout=300,minproto=5,maxprot
│ ├─/net/whanau.org/home      -hosts                                        autofs         rw,relatime,fd=12,pgrp=1373,timeout=300,minproto=5,maxprot
│ ├─/net/whanau.org/mnt/cdrom -hosts                                        autofs         rw,relatime,fd=12,pgrp=1373,timeout=300,minproto=5,maxprot
│ ├─/net/whanau.org/mythtv    -hosts                                        autofs         rw,relatime,fd=12,pgrp=1373,timeout=300,minproto=5,maxprot
│ └─/net/whanau.org/var/nfs   -hosts                                        autofs         rw,relatime,fd=12,pgrp=1373,timeout=300,minproto=5,maxprot
├─/media                      tmpfs                                         tmpfs          rw,nosuid,nodev,noexec,relatime,mode=755
├─/boot                       /dev/sda1                                     ext4           rw,relatime,barrier=1,data=ordered
├─/home                       /dev/mapper/vg_tnzjhaardell-lv_home           ext4           rw,relatime,barrier=1,data=ordered
│ └─/home                     /dev/mapper/vg_tnzjhaardell-lv_home           ext4           rw,relatime,barrier=1,data=ordered
│   └─/home/jhaar/.gvfs       gvfs-fuse-daemon                              fuse.gvfs-fuse rw,nosuid,nodev,relatime,user_id=500,group_id=504
├─/tmp                        /dev/mapper/vg_tnzjhaardell-lv_root[/tmp]     ext4           rw,relatime,barrier=1,data=ordered
└─/var/tmp                    /dev/mapper/vg_tnzjhaardell-lv_root[/var/tmp] ext4           rw,relatime,barrier=1,data=ordered
Comment 7 Karel Zak 2011-05-04 10:36:07 EDT
So... the /tmp and /var/tmp are bind mounts (the source is /dev/mapper/vg_tnzjhaardell-lv_root), it seems correct.

I have no clue why the /home is mounted twice (or is it also bind?) ... reassigning to systemd ;-)
Comment 8 Karel Zak 2011-05-04 10:45:24 EDT
... or the bind mounts are created by policycoreutils-sandbox (command seunshare). Dan?
Comment 9 Daniel Walsh 2011-05-06 14:28:03 EDT
No this is an issue with pam_namespace.  We ship the necessary init script to setup proper mounting in policycoreutils-sandbox, which no longer needs the init script.

There is an existing bug with a patch for pam_namespace to fix this issue and remove the need for the double mounts.
Comment 10 Jason Haar 2011-05-08 20:14:06 EDT
I also have a problem in that shutdown/reboot don't work. It shuts down to the Fedora logo - but never powers off/reboots.

I was about to add that as another bug - but could it be related to these twice-mounted partitions?

Is there any way I can safely fix this mount problem myself - without waiting for some patch?

Thanks
Comment 11 Daniel Walsh 2011-05-09 11:32:57 EDT
Well it is questionable whether this is a mount problem.

But you can turn off the sandbox init script.

chconfig sandbox off

On next reboot you should not see the double mounts.
Comment 12 Gabriel VLASIU 2011-05-25 15:04:53 EDT
This is the output for mount in Fedora 15 installed yesterday:

# mount | grep -vE '^(/sys|/proc|udev|devpts|tmpfs|selinuxfs|tmpfs|cgroup|systemd-1)'
/dev/sda2 on / type ext3 (rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/sda5 on /tmp type ext4 (rw,nosuid,nodev,noexec,relatime,seclabel,barrier=1,data=ordered)
/dev/sda1 on /boot type ext3 (rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/sda6 on /home type ext4 (rw,relatime,seclabel,barrier=1,data=ordered)

No problem until here.

I added the following line in /etc/fstab (like I always did):
/var/tmp  /tmp none bind,nosuid,nodev,noexec 0 0

Reboot an everything go weird:

# mount | grep -vE '^(/sys|/proc|udev|devpts|tmpfs|selinuxfs|tmpfs|cgroup|systemd-1)'
/dev/sda2 on / type ext3 (rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/sda2 on /var/tmp type ext3 (rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/sda1 on /boot type ext3 (rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/sda6 on /home type ext4 (rw,relatime,seclabel,barrier=1,data=ordered)
/dev/sda5 on /tmp type ext4 (rw,nosuid,nodev,noexec,relatime,seclabel,barrier=1,data=ordered)
/dev/sda5 on /var/tmp type ext4 (rw,nosuid,nodev,noexec,relatime,seclabel,barrier=1,data=ordered)


/dev/sda3 is mounted 3 times (sometimes 3 times - 2 times in /var/tmp).
/dev/sda5 is mounted 2 times.

This is the fault of systemd!

chconfig sandbox off does not help in any way.

# cat /proc/self/mountinfo | grep -vE '/sys|/proc|udev|devpts|tmpfs|selinuxfs|tmpfs|cgroup|systemd-1'
22 1 8:2 / / rw,relatime - ext3 /dev/sda2 rw,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered
41 22 8:2 /tmp /var/tmp rw,relatime - ext3 /dev/sda2 rw,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered
42 22 8:1 / /boot rw,relatime - ext3 /dev/sda1 rw,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered
43 22 8:6 / /home rw,relatime - ext4 /dev/sda6 rw,seclabel,barrier=1,data=ordered
44 22 8:5 / /tmp rw,nosuid,nodev,noexec,relatime - ext4 /dev/sda5 rw,seclabel,barrier=1,data=ordered
45 41 8:5 / /var/tmp rw,nosuid,nodev,noexec,relatime - ext4 /dev/sda5 rw,seclabel,barrier=1,data=ordered

# cat fstab
#/dev/sda2
UUID=994a79d2-1fc4-4f98-824e-82758fd0f99d /                       ext3    defaults        1 1
#/dev/sda1
UUID=de66ba2c-16bd-4544-9abb-1ac47c23b6d3 /boot                   ext3    defaults        1 2
#/dev/sda6
UUID=e5d9d77b-3b63-47ae-aa6f-b213cf4a53c4 /home                   ext4    defaults        1 2
#/dev/sda5
#UUID=1fe0de23-b656-459b-a8d9-2867a4f37ea6 /tmp                    ext4    defaults        1 2
UUID=5c073a5c-d31b-4e56-ae5b-a99c920dda1a swap                    swap    defaults        0 0
/dev/sda5               /tmp                    ext4    defaults,nosuid,nodev,noexec 0 0
tmpfs                   /dev/shm                tmpfs   defaults,nosuid,nodev,noexec        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/tmp                    /var/tmp                none    bind,nosuid,nodev,noexec

# findmnt
TARGET                       SOURCE          FSTYPE    OPTIONS
/                            /dev/sda2       ext3      rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered
|-/proc                      /proc           proc      rw,relatime
| `-/proc/sys/fs/binfmt_misc systemd-1       autofs    rw,relatime,fd=31,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
|-/sys                       /sys            sysfs     rw,relatime,seclabel
| |-/sys/fs/cgroup           tmpfs           tmpfs     rw,nosuid,nodev,noexec,relatime,seclabel,mode=755
| | |-/sys/fs/cgroup/systemd cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
| | |-/sys/fs/cgroup/cpuset  cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,cpuset
| | |-/sys/fs/cgroup/ns      cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,ns
| | |-/sys/fs/cgroup/cpu     cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,cpu
| | |-/sys/fs/cgroup/cpuacct cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,cpuacct
| | |-/sys/fs/cgroup/memory  cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,memory
| | |-/sys/fs/cgroup/devices cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,devices
| | |-/sys/fs/cgroup/freezer cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,freezer
| | |-/sys/fs/cgroup/net_cls cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,net_cls
| | `-/sys/fs/cgroup/blkio   cgroup          cgroup    rw,nosuid,nodev,noexec,relatime,blkio
| |-/sys/kernel/security     systemd-1       autofs    rw,relatime,fd=30,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
| `-/sys/kernel/debug        systemd-1       autofs    rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
|-/dev                       udev            devtmpfs  rw,nosuid,relatime,seclabel,size=507864k,nr_inodes=126966,mode=755
| |-/dev/pts                 devpts          devpts    rw,relatime,seclabel,gid=5,mode=620,ptmxmode=000
| |-/dev/shm                 tmpfs           tmpfs     rw,nosuid,nodev,noexec,relatime,seclabel
| |-/dev/hugepages           systemd-1       autofs    rw,relatime,fd=29,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
| `-/dev/mqueue              systemd-1       autofs    rw,relatime,fd=34,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
|-/run                       tmpfs           tmpfs     rw,nosuid,nodev,noexec,relatime,seclabel,mode=755
|-/selinux                   selinuxfs       selinuxfs rw,relatime
|-/media                     tmpfs           tmpfs     rw,nosuid,nodev,noexec,relatime,rootcontext=system_u:object_r:mnt_t:s0,seclabel,mode=755
|-/var/tmp                   /dev/sda2[/tmp] ext3      rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered
| `-/var/tmp                 /dev/sda5       ext4      rw,nosuid,nodev,noexec,relatime,seclabel,barrier=1,data=ordered
|-/boot                      /dev/sda1       ext3      rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered
|-/home                      /dev/sda6       ext4      rw,relatime,seclabel,barrier=1,data=ordered
`-/tmp                       /dev/sda5       ext4      rw,nosuid,nodev,noexec,relatime,seclabel,barrier=1,data=ordered
Comment 13 Daniel Walsh 2011-05-26 09:55:07 EDT
Tomas can we finally get pam_namespace changed to do the mounting internally and then I can remove the mount of /tmp and $HOME from sandbox init script.  Then we can just get systemd to do the mount	

mount --make-rshared / || return $? 

And we will be done.
Comment 14 Tom Horsley 2011-05-30 13:14:51 EDT
I suspect fixing pam_namespace will only eliminate this problem for the specific instance of the sandbox service, but I have my own bind mounts in my own fstab and the same thing happens:

I have this line in /etc/fstab:

/zooty/web-content/html /var/www/html       none    rw,bind         0 0

That bind mounts my html content to a directory that doesn't get hosed
when I regen my system (a useful gimmick).

On Fedora 14 when I run the "mount" command, I see:

/zooty/web-content/html on /var/www/html type none (rw,bind)

Also if I run a "df" command, nothing shows up for the
/zooty/web-content/html mountpoint (which makes sense).

On fedora 15, with the exact same line in the fstab, I see
this in the output of the "mount" command:

/dev/sdb2 on /zooty type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
/dev/sdb2 on /var/www/html type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
/dev/sdb2 on /var/www/html type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)

If I run df I see these lines in the output:

/dev/sdb2            472456780 196703700 251753580  44% /zooty
/dev/sdb2            472456780 196703700 251753580  44% /var/www/html
/dev/sdb2            472456780 196703700 251753580  44% /var/www/html

This is very confusing to the brains of system administrators
even if it doesn't cause any real problems with the system.

The actual mountpoint for /dev/sdb2 is only /zooty, but it looks as if
it is also mounted on /var/www/html even though that is merely a bind
mount to a subdirectory. Worse yet, it looks as if it is mounted there
twice (I have no idea why, I only have the one bind mount line in
the fstab).

Aside from confusing administrators, I wonder how many things like backup
scripts will now be making three copies of /zooty/web-content/html thinking
it is mounted 3 times.

Somehow the bind options have disappeared from the mount info in f15 and everyone is treating this bind mount as a "real" mount.
Comment 15 Karel Zak 2011-05-30 13:51:22 EDT
(In reply to comment #14)
> I have this line in /etc/fstab:
> 
> /zooty/web-content/html /var/www/html       none    rw,bind         0 0
[...]
> The actual mountpoint for /dev/sdb2 is only /zooty, but it looks as if

Not true. The /dev/sda2 _is_ mounted on two places if there is a bind mount. 

If you want to see more detail (for example subdirectory used for the mounts) then use findmnt(8). It provides less confusing output.

> it is also mounted on /var/www/html even though that is merely a bind
> mount to a subdirectory.

For your kernel the device is mounted on two places.

> Somehow the bind options have disappeared from the mount info in f15 and
> everyone is treating this bind mount as a "real" mount.

Sure, all are real mounts ;-) 

The bind mounts are "special" for mtab only. On all systems without mtab (e.g. F-15) is the fact that bind mounts are nothing special visible to all userspace utils.

For more details see:
http://karelzak.blogspot.com/2011/04/bind-mounts-mtab-and-read-only.html 

IMHO df(1) should be fixed to output the same filesystem only once.
Comment 16 Gabriel VLASIU 2011-05-30 14:00:49 EDT
/etc/fstab:
/var/tmp  /tmp none bind,nosuid,nodev,noexec 0 0
Reboot.

/dev/sda2 on / type ext3
(rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/sda2 on /var/tmp type ext3
(rw,relatime,seclabel,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/sda5 on /tmp type ext4
(rw,nosuid,nodev,noexec,relatime,seclabel,barrier=1,data=ordered)
/dev/sda5 on /var/tmp type ext4
(rw,nosuid,nodev,noexec,relatime,seclabel,barrier=1,data=ordered)

Unmount /var/tmp (2 times) and /tmp until nothing is mounted under these
directories.

Did a ls -la /tmp and .ICE-unix, .Test-unix, .X11-unix, .XIM-unix, .font-unix
apears to be inside.
rm -rf those directories.

Reboot.

Login and unmount again /var/tmp (2 times) and /tmp.
.ICE-unix, .Test-unix, .X11-unix, .XIM-unix, .font-unix directories are there
again.

systemd-tmpfiles-setup.service create those directories but that's suppose to
happen after /tmp is mounted (local-fs.target). Definitely a bug.

Another problem:
If the entry in fstab is not something like UUID=... but /dev/sdaX... systemd-fsck is not called for that partition (I had to reformat /dev/sda5 partition and I was lazy to put the new UUID back). When I put back the UUID, systemd-fsck is called for /dev/sda5 and now I can see two new lines:
Started /var/tmp
Started /tmp

So I think /var/tmp is mounted before /tmp (bind - /dev/sda2), and then /tmp is
mounted and then again /var/tmp is mounted (bind - /dev/sda5).
Comment 17 Tom Horsley 2011-05-30 16:16:23 EDT
OK, I read the blog and it makes no sense. Somewhere, someone knows something. The root of the filesystem on /dev/sdb2 is only mounted at /, The mount at /var/www/html is to a subdirectory inside /dev/sdb2. They ARE NOT the same :-). Somewhere in the universe there is something that knows /var/www/html starts down at the subdirectory. They cannot be identical mounts, but all the information that is user visible calls them identical. (And /var/www/html still shouldn't show up twice :-).

If df should only print the same filesystem once, it should also know how to find the mountpoint that is actually at the root and print that one.
Comment 18 Karel Zak 2011-05-30 16:43:45 EDT
(In reply to comment #17)
> OK, I read the blog and it makes no sense. Somewhere, someone knows something.
> The root of the filesystem on /dev/sdb2 is only mounted at /, The mount at
> /var/www/html is to a subdirectory inside /dev/sdb2. They ARE NOT the same :-)

It's the same filesystem (superblock), the second mount uses a subdirectory as a root for the mount. That's all.

 # mount /var/tmp /mnt/test -o bind

 # findmnt /dev/sda4 -o TARGET,SOURCE

 TARGET    SOURCE
 /         /dev/sda4
 /mnt/test /dev/sda4[/var/tmp]

You can found all necessary information in the /proc/self/mountinfo file.
Comment 19 Pádraig Brady 2011-05-30 16:53:35 EDT
Me too. Just installed F15 without encryption or anything.

$ df -l | grep /home
/dev/sdb1      100791728 43701384  51970344  46% /home
/dev/sdb1      100791728 43701384  51970344  46% /home

$ findmnt /home
TARGET SOURCE    FSTYPE OPTIONS
/home  /dev/sdb1 ext4   rw,relatime,seclabel,barrier=1,data=ordered
/home  /dev/sdb1 ext4   rw,relatime,seclabel,barrier=1,data=ordered
Comment 20 Karel Zak 2011-05-31 08:31:12 EDT
Note that duplicate bind mounts are probably "mount -a" problem. See bug #709319.
Comment 21 Tom Horsley 2011-05-31 09:05:26 EDT
Only if systemd is the one doing multiple mount -a commands. I booted from scratch with that bind mount line in fstab, and got the two copies of the /var/www/html mount right off the bat. I didn't manually mount anything.
Comment 22 Tom Horsley 2011-05-31 09:21:37 EDT
By the way, I searched for, but couldn't find, a bugzilla on the df command saying it ought to suppress the duplicate entries for bind mounts, so I went ahead and added one as bug 709351.
Comment 23 Lennart Poettering 2011-06-02 04:39:30 EDT
(In reply to comment #20)
> Note that duplicate bind mounts are probably "mount -a" problem. See bug
> #709319.

Note that systemd never invokes mount -a. We mount devices when they show up.
Comment 24 Erik Squires 2011-06-06 22:15:22 EDT
As a small side note, if you use the Gnome disk utility to attempt to unmount /home you will get an error message saying that it is mounted twice.  I was trying to do this to shrink the /home partition and create a new space.
Comment 25 Daniel Walsh 2011-06-07 15:35:46 EDT
Tomas just announced in another bug that pam_namespace has been fixes to mount private if the / is mounted shared.  So I am updating sandbox init script to no longer bind mount /home on /home. or /tmp on /tmp.
Comment 26 Daniel Walsh 2011-06-07 15:36:14 EDT
In F16 that is.
Comment 27 Tomas Mraz 2011-06-07 15:49:20 EDT

*** This bug has been marked as a duplicate of bug 623522 ***
Comment 28 Tom Horsley 2011-06-07 16:46:54 EDT
Was this really a duplicate of bug 623522? Some of the comments in this bug have nothing to do with sandbox, they are just about bind mounts in /etc/fstab always showing up twice (even when sandbox is disabled). Should I make a separate bug for that if this one is gonna stay closed?
Comment 29 Tomas Mraz 2011-06-07 17:07:17 EDT
(In reply to comment #28)
> Was this really a duplicate of bug 623522? Some of the comments in this bug
> have nothing to do with sandbox, they are just about bind mounts in /etc/fstab
> always showing up twice (even when sandbox is disabled). Should I make a
> separate bug for that if this one is gonna stay closed?

Bind mounts showing as duplicates in df and other coreutils commands is bug 709351 that you opened.
Comment 30 Tom Horsley 2011-06-07 18:18:49 EDT
I'm not talking about the duplicates in df, I'm talking about the bind mount itself showing up twice even though there is only one mention of it in /etc/fstab. See comment #14 above.
Comment 31 Michael Carney 2011-06-13 13:50:50 EDT
How is *this* bug a duplicate of 623522? Sure, my systems were tripped up by sandbox's current use of bind mounts, but in general not having a coherent view of the mount table when bind mounts are present is the true problem IMHO. There's no way to distinguish among entries a bind mount from the original mount. This is a real problem for programs that perform backups -- file systems are processed more than once, with the associated loss of tape, time, and sanity (sysadmin's that is).
Comment 32 Tomas Mraz 2011-06-13 14:26:14 EDT
The problem is actually with the programs that perform the backups - they should know better how to parse the mount information. There is no difference between the bind mounts and the original mounts visible to the kernel.

There should be probably a library or something that could process the mountinfo and filter out the duplicates that could be used for backup tool purposes.
Comment 33 Harald Reindl 2011-08-11 16:56:13 EDT
> The problem is actually with the programs that perform the backups

NO - mount-informations are borked since F15

generally, everywhere and the output of "mount" makes no 
difference between a bind-mount or the physical device

the named-warning below is a bad joke and /dev/sdd1 should 
only appear ONCE for /mnt/data

[harry@srv-rhsoft:~]$ /bin/df
Dateisystem          1K‐Blöcke   Benutzt Verfügbar Ben% Eingehängt auf
rootfs                25806300  10528996  15277304  41% /
udev                   4088156         0   4088156   0% /dev
tmpfs                  1048576       212   1048364   1% /dev/shm
tmpfs                  4096756      3032   4093724   1% /run
/dev/sda2             25806300  10528996  15277304  41% /
tmpfs                  4096756         0   4096756   0% /sys/fs/cgroup
tmpfs                  4096756         0   4096756   0% /media
tmpfs                  4096756      3032   4093724   1% /var/run
tmpfs                  4096756      3032   4093724   1% /var/lock
tmpfs                   153600       228    153372   1% /var/www/sessiondata
/dev/sda1               248895     43099    205796  18% /boot
/dev/sdc1            976636192 810481560 166154632  83% /mnt/fileserver
/dev/sdd1            480719056 298495912 182223144  63% /mnt/data
/dev/sdd1            480719056 298495912 182223144  63% /Volumes/dune/www-servers
/dev/sdd1            480719056 298495912 182223144  63% /Volumes/dune/www-servers/phpincludes
/dev/sda6              5162796    263724   4899072   6% /var/log
/dev/sda7             20641788   1046460  19595328   6% /home
/dev/sda5             25806268    179388  25626880   1% /var/spool
/dev/sda8             20641788    176052  20465736   1% /mnt/downloads
/dev/sda3              6198436    261244   5937192   5% /var/cache
/dev/sda9             20641788    340068  20301720   2% /tmp
/bin/df: „/var/named/chroot/etc/named“: Keine Berechtigung
/bin/df: „/var/named/chroot/usr/lib64/bind“: Keine Berechtigung
/bin/df: „/var/named/chroot/etc/named.iscdlv.key“: Keine Berechtigung
/bin/df: „/var/named/chroot/etc/named.root.key“: Keine Berechtigung