I recently switched to systemd. I'm not sure whether it is officially supported - if not, please let me know who I can contact about this problem. Since switching, the commands mount and df don't quite work as advertised, namely outputting devices multiple times. For example, mount displays this: benjamin@metis ~ $ mount rootfs on / type rootfs (rw) /dev/root on / type ext4 (rw,noatime,commit=0) devtmpfs on /dev type devtmpfs (rw,relatime,size=8216324k,nr_inodes=2054081,mode=755) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755) openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc) cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu) cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct) freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) perf_event on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85) none on /tmp type tmpfs (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) /dev/sdb5 on /boot type ext3 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) none on /tmp type tmpfs (rw) /dev/sda1 on /home type ext4 (rw,commit=0) none on /tmp type tmpfs (rw) /dev/sda1 on /home type ext4 (rw,noatime,commit=0) /dev/sdc2 on /mnt/ssd type ext4 (rw,noatime,commit=0) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) With df, the story is similar, which is why I think we are talking about the same issue: benjamin@metis ~ $ df df: ‘/sys/fs/cgroup/openrc’: No such file or directory Filesystem 1K-blocks Used Available Use% Mounted on rootfs 58505824 18352084 37223084 34% / /dev/root 58505824 18352084 37223084 34% / devtmpfs 8216324 4 8216320 1% /dev tmpfs 8217528 26016 8191512 1% /run cgroup_root 8217528 0 8217528 0% /sys/fs/cgroup none 8217528 92 8217436 1% /tmp none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp none 8217528 92 8217436 1% /tmp /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd /dev/sdb5 58505824 18352092 37223076 34% /boot none 8217528 92 8217436 1% /tmp /dev/sda1 390198864 266453372 104214072 72% /home none 8217528 92 8217436 1% /tmp /dev/sda1 390198864 266453372 104214072 72% /home /dev/sdc2 58497936 4485540 51082140 9% /mnt/ssd
benjamin@metis ~ $ emerge --info Portage 2.1.11.13 (default/linux/amd64/10.0/desktop, gcc-4.6.3, glibc-2.15-r2, 3.2.0-gentoo x86_64) ================================================================= System uname: Linux-3.2.0-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.1 Timestamp of tree: Wed, 05 Sep 2012 06:15:01 +0000 ccache version 2.4 [disabled] app-shells/bash: 4.2_p37 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.3-r2, 3.2.3 dev-util/ccache: 2.4-r9 dev-util/cmake: 2.8.8-r3 dev-util/pkgconfig: 0.27 sys-apps/baselayout: 2.1-r1 sys-apps/openrc: 0.10.5 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.5, 1.7.9-r1::<unknown repository>, 1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.6 sys-devel/binutils: 2.22-r1 sys-devel/gcc: 4.4.5, 4.5.4, 4.6.3 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r3 sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers) sys-libs/glibc: 2.15-r2 Repositories: gentoo x-portage ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA ut2003 dlj-1.1 skype-eula googleearth AdobeFlash-10.3 Oracle-BCLA-JavaSE skype-4.0.0.7-copyright" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=native" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /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="-O2 -pipe -march=native" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles multilib-strict news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://sunsite.cnlab-switch.ch/ftp/mirror/gentoo" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en" MAKEOPTS="-j8" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" 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" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X X509 a52 aac accessibility acl acpi aim alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cdparanoia cdr chm cli cmake consolekit cracklib crypt cscope cups curl cxx dbus dri dts dvd dvdr dvdread emboss emerald enblend encode exif fam ffmpeg fftw firefox flac fontconfig fortran ftp gdbm geolocation gif gimp git glitz glsa gnome gnome-keyring gold gphoto2 gpm graphviz gstreamer gtk gtk2 hal hddtemp history hybrid-auth iconv icq icu imagemagick imap inquisitio ipod ipv6 jabber java jpeg kde kdeenablefinal kerberos kpathsea latex lcms ldap libnotify lm_sensors mad mercurial mikmod mmx mng modules mozdevelop moznocompose moznoirc moznomail mozsvg mp3 mp4 mpeg mplayer msn mtp mudflap multilib ncurses nls nogcj nptl nptlonly nsplugin ogg oggvorbis openal opencl openexr opengl openmp oscar oss pam pango pch pcre pdf perl plasma png policykit ppds pppd python qa qt3 qt3support qt4 readline resolvconf samba scanner sdl semantic-desktop session sift spell sql sse sse2 sse3 sse4_1 ssl startup-notification subversion svg systemd tcpd theora threads tif tiff transcode truetype udev udisks unicode upnp upower usb vim-syntax visualization vorbis webkit wlm wmf wxwidgets x264 xcb xcomposite xinerama xml xmp xpm xv xvid zeroconf 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" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nv nvidia" 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" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Just so its not overlooked, the df output has an interesting snippet: df: ‘/sys/fs/cgroup/openrc’: No such file or directory
(In reply to comment #2) > Just so its not overlooked, the df output has an interesting snippet: > > df: ‘/sys/fs/cgroup/openrc’: No such file or directory Honestly, I have no idea how you reached that. Maybe it has something to do with OpenRC cgroup support (leftovers?). I have switched to systemd before openrc had cgroups, and I don't have anything like that...
(In reply to comment #3) none of the openrc behavior should matter once you reboot with systemd. we do it all at runtime. maybe /etc/mtab isn't getting cleared properly by systemd ? i can't imagine all that cruft being listed in /proc/mounts too.
> (In reply to comment #3) > > none of the openrc behavior should matter once you reboot with systemd. we > do it all at runtime. > df: ‘/sys/fs/cgroup/openrc’: No such file or directory This output clearly shows that df - or some code executed by df - relies on openrc. It can very well be leftover bits. I'll try to strace this - may be I'll find something. > maybe /etc/mtab isn't getting cleared properly by systemd ? i can't imagine > all that cruft being listed in /proc/mounts too. I'll check mtab contents once I get back to the machine.
(In reply to comment #5) > > (In reply to comment #3) > > > > none of the openrc behavior should matter once you reboot with systemd. we > > do it all at runtime. > > > > df: ‘/sys/fs/cgroup/openrc’: No such file or directory > > This output clearly shows that df - or some code executed by df - relies on > openrc. It can very well be leftover bits. I'll try to strace this - may be > I'll find something. > > > maybe /etc/mtab isn't getting cleared properly by systemd ? i can't imagine > > all that cruft being listed in /proc/mounts too. > > I'll check mtab contents once I get back to the machine. Well, that could be some case. I'm not sure what rc is supposed to do regarding mtab but systemd folks prefer it being a symlink to /proc/mounts.
I also suspect that /etc/mtab is the culprit here.
(In reply to comment #5) no, it doesn't. it merely shows that df is using /etc/mtab and that file is stale. nothing openrc can do here once systemd has booted. if that init wants to enforce /etc/mtab -> /proc/mounts symlink, it should add some warnings and/or update documentation.
Sorry for taking so long - I just tested: yes, /etc/mtab is the culprit. With a symlink, both tools work as expected
I have added a note to: http://wiki.gentoo.org/wiki/Systemd#.2Fetc.2Fmtab_symlink
For the record, not having the symlink from /proc/mounts to /etc/mtab will also break NTFS filesystem mounts when systemd eventually corrupts /etc/mtab .... "Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted, or another software may use it which could be identified for example by the help of the 'fuser' command."
I think we cannot do much more in systemd side -> we show warnings from ebuild, also the guide explains the issues...