Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 419773 - early bind mounts are listed twice in the mount table
Summary: early bind mounts are listed twice in the mount table
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
Depends on:
Reported: 2012-06-05 14:14 UTC by Andreas Plesch
Modified: 2012-06-05 14:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Plesch 2012-06-05 14:14:06 UTC
A recent patch added proper bind mounts support to the initramfs:

On my system fstab I have bind mounts into other filesystems for efficient use of a ssd, for example:

/dev/sda1               /disk/fels/d3   ext4            noatime         0 0
/disk/fels/d3/usr/lib64 /usr/lib64      none bind

where /dev/sda is the ssd.

I have lines in /etc/initramfs.mounts such as:


The initrd successfully mounts the first mountpoint under /newroot/disk/fels/d3.
After the patch, linuxrc works as expected on my system, eg. the bind mounts are also mounted early and udev can use them.

This bug is about the fact that I did notice that the mount table as produced with the mount command now lists the mount points with the bind mounts twice:

# mount

/dev/sda1 on /disk/fels/d3 type ext4 (rw,noatime,commit=0)
/dev/sda1 on /usr/x86_64-pc-linux-gnu type ext4 (ro,noatime,user_xattr,barrier=1)
/dev/sda1 on /usr/lib64 type ext4 (ro,noatime,user_xattr,barrier=1)
/dev/sda1 on /usr/lib32 type ext4 (ro,noatime,user_xattr,barrier=1)
/dev/sda1 on /usr/libexec type ext4 (ro,noatime,user_xattr,barrier=1)
/dev/sda1 on /usr/include type ext4 (ro,noatime,user_xattr,barrier=1)
/disk/fels/d3/usr/x86_64-pc-linux-gnu on /usr/x86_64-pc-linux-gnu type none (rw,bind,commit=0)
/disk/fels/d3/usr/lib64 on /usr/lib64 type none (rw,bind,commit=0)
/disk/fels/d3/usr/lib32 on /usr/lib32 type none (rw,bind,commit=0)
/disk/fels/d3/usr/libexec on /usr/libexec type none (rw,bind,commit=0)
/disk/fels/d3/usr/include on /usr/include type none (rw,bind,commit=0)

Without the initrd only the second set of mount points is listed.

But this does not seem to have a negative effect sofar. It just produces df output which lists the ssd as mounted multiple times. As this doubled listing is not occurring without the initrd, it probably is related to the remounting at the end of the initrd, and may or may not be genkernel related. Perhaps it is normal ?

Reproducible: Always

Steps to Reproduce:
1. Use patched genkernel on a system with bind mounts into /usr/foo to generate initrd; edit /etc/initramfs.mounts
2. reboot with initrd
3. observe output of mount command
Actual Results:  
mount points used for bind mounts are listed twice; one time as being used by the actual disk partition; the other time as being used by the bind-mounted directory

Expected Results:  
It would be expected that mount only lists the mount points as being used by the bind-mounted directory because that is the behavior without the initrd.

Portage (default/linux/amd64/10.0/desktop, gcc-4.5.3, glibc-2.14.1-r3, 3.2.12-gentoo x86_64)
System uname: Linux-3.2.12-gentoo-x86_64-AMD_Opteron-tm-_Processor_256-with-gentoo-2.1
Timestamp of tree: Wed, 30 May 2012 14:05:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r1, 3.2.3
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo enlightenment science sage-on-gentoo x-portage
ACCEPT_LICENSE="* -@EULA dlj-1.1 skype-eula PUEL @EULA"
CFLAGS="-march=opteron -O2 -pipe -msse3"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=opteron -O2 -pipe -msse3"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fail-clean fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/var/lib/layman/enlightenment /var/lib/layman/science /var/lib/layman/sage-on-gentoo /usr/local/portage"
USE="X a52 aac acl acpi alsa amd64 arts berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cpudetection cracklib crypt cups cxx dbus dri dts dv dvd dvdr dvdread emacs emboss encode exif fam firefox flac flash font-server fortran gd gdbm gif gpm gtk iconv ieee1394 imap ipv6 jpeg kde lcms ldap libnotify live mad mjpeg mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly odbc ogg opengl openmp pam pango pcre pdf plotutils png policykit postgres ppds pppd python qt qt3support qt4 readline samba sdl semantic-desktop session smp spell sse sse2 ssl startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb v4l v4l2 vorbis wmf wxwidgets x264 xcb xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"