Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 48540 - mtab not in sync with /proc/~self/mount
Summary: mtab not in sync with /proc/~self/mount
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-21 01:04 UTC by Derk W te Bokkel
Modified: 2004-09-27 12:09 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Derk W te Bokkel 2004-04-21 01:04:33 UTC
df , kdiskfree etc.. only show root mounted

mtab only contains:

/dev/hda10 / ext3 rw,noatime 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev ramfs rw 0 0
none /dev/pts devpts rw 0 0
none /proc/bus/usb usbfs rw 0 0

/proc/~self/mount contains:

rootfs / rootfs rw 0 0
/dev/root / ext3 rw,noatime 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev ramfs rw 0 0
none /dev/pts devpts rw 0 0
/dev/hda12 /usr ext3 rw,noatime 0 0
/dev/hda7 /tmp ext3 rw,noatime,noexec 0 0
/dev/hda8 /home ext3 rw,noatime 0 0
/dev/hda5 /home/extrabig ext3 rw,noatime 0 0
none /dev/shm tmpfs rw 0 0
/dev/hda1 /mnt/win-hda1 vfat rw,nodiratime,uid=1001,fmask=0002,dmask=0002,codepage=cp437 0 0
none /proc/bus/usb usbfs rw 0 0

I've copied /proc/~self/mount into /etc/mtab and all works fine again ..

what gives ? my other machines are not showing this (dev-srcs-2.6.6_rc1 or mm-sources-2.6.5-mm6) .. a reboot does not fix it as it comes back the same way .. any thoughts?

what should I check?


kernel is win4lin-sources-2.6.5-r1

 emerge info
Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.5)
=================================================================
System uname: 2.6.5 i686 AMD Athlon(tm) XP 2700+
Gentoo Base System version 1.4.9
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon-xp -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=athlon-xp -O3 -pipe"
DISTDIR="/home/extrabig/portage/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j5"
PKGDIR="/home/extrabig/portage/packages"
PORTAGE_TMPDIR="/home/extrabig/tmp"
PORTDIR="/home/extrabig/portage"
PORTDIR_OVERLAY="/home/derk/portage"
SYNC="rsync://192.168.4.11/gentoo-portage"
USE="X aalib alsa apm arts avi berkdb bonobo cdr crypt cups dvd encode esd foomaticdb gb gdbm gif gnome gphoto2 gpm gtk gtk2 gtkhtml guile imlib jack java jpeg kde libg++ libwww mad mikmod motif mozilla mpeg ncurses nls ofx oggvorbis opengl oss pam pdflib perl png ppds python qt quicktime readline scanner sdl slang spell ssl svga tcltk tcpd tetex truetype usb x86 xml xml2 xmms xv zlib"


Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:
Comment 1 Derk W te Bokkel 2004-04-21 10:44:03 UTC
problem does not exist with 2.6.3 or 2.6.4 win4lin kernels .. so it seems to be kernel 2.6.5-win4lin related .. 2.6.5-mm6 kernel does not seem to be effected.(on other boxes )  kernel 2.6.5-win5lin was fine until recently though so a rencent update to either baselayout (rc-scripts) or coreutils has effected the interaction with a 2.6.5-win4lin kernel only (presence or absence of CD-ISO patch does not effect the results) .. the configs on all these win4lin kernels are generally similar only a make oldconfig seperates them.

I'll try a couple of things to see what else I can discover
Comment 2 Aron Griffis (RETIRED) gentoo-dev 2004-05-05 14:30:44 UTC
what version of baselayout are you running on the machines that do NOT exhibit the problem?
Comment 3 Derk W te Bokkel 2004-05-05 15:36:48 UTC
the bizarre thing is that they are all kept up to date to the latest ~x86 level,
the only thing really different is the kernel being run.. all machines are now running Gentoo base system 1.4.10 i.e. baselayout-1.8.12 although the win4lin machine has been up about 7 days without a reboot so recent changes may not be reflected .. but this was after the latest baselayout change on April 26 reboot was April 27

it also seems to have more users logged in than there really are .. not all records of logged in processes are killed when some users log-out .. there are no processes for them running but they still appear as a user. Every time they log in they leave an extra user instance behind .. I have not figured out why as yet.


coreutils is now 5.2.0-r1 (april 19 installed) on all machines .. 

Comment 4 Derk W te Bokkel 2004-05-05 16:46:25 UTC
okay I rebooted now several times with the following odd things happening

on the first reboot some of the local drives apparently could not be mounted (an error comment showed up reqarding mtab and some flags .. went by too fast to remember) 
but according to mtab now more than just the root drive showed .. the missing ones  were mounted according to /proc/mounts as rw.

so I took one drive unmounted it after doing a cat /proc/mounts > /etc/mtab to trick the umount command to realize that it was there .. as root did fsck -f /dev/hda5  
some directory optimaizations were made as the only fixes and remounted the drive 
then I logged out and rebooted again this time as the system booted this drive was flagged as having not been mounted for arround 49500 days and a fsck was forced by the boot process.. but once this had occurred

everything showed up in the 'df' I executed once I'd logged in ..

very odd .. all seems okay now .. but why would this sequence of events appear to fix the matter?

Comment 5 Derk W te Bokkel 2004-05-05 17:27:18 UTC
really odd did it again .. no drives except rootfs showed up then next reboot we got most except one .. same one(s) missing as before ..

ERROR mtab message said some thing about readonly file system being mounted and use the -n flag 

/proc/mounts still shows all the drives .. weird .. it's almost as if we have a timing problem .. this is a relatively fast machine  athlon xp 2700 MSI KT4V (via KT400) chip set.. 
is something in the boot sequence finishing at different times .. parallelled fsck's etc.??
Comment 6 Derk W te Bokkel 2004-05-05 19:11:56 UTC
okay tried a different kernel  mm-sources-2.6.6_rc3-r1
after doing the bug # 48030 fixes (using nvidia-kernel-5336-r3 last one) 

works df gives normal expected results now for the reboot tests as there was an fsck run this boot so that changes the timings
Comment 7 Derk W te Bokkel 2004-05-05 19:35:16 UTC
okay all hell broke loose .. with mm-sources-2.6.6-rc3-r1 on repeated boots

mtab complains that it can't create a lockfile as filesystem is read only .. then an error message appears that 'some local file systems could not be mounted'
and they aren't my home directories and any mounts off of them do not appear

cat /proc/mounts -- gives
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,noatime 0 0
none /proc proc rw,nodiratime 0 0
none /sys sysfs rw 0 0
none /dev ramfs rw 0 0
none /dev/pts devpts rw 0 0
/dev/hda12 /usr ext3 rw,noatime 0 0
/dev/hda7 /tmp ext3 rw,noatime,noexec 0 0
none /proc/bus/usb usbfs rw 0 0

df  .. gives

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda10            10080488    944200   8624220  10% /
/dev/hda12             9273984   4566304   4236576  52% /usr

rebooting with 2.6.5-win4lin gives

bash-2.05b$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda10            10080488    944264   8624156  10% /
/dev/hda12             9273984   4566304   4236576  52% /usr
/dev/hda7              2087180     35308   1945848   2% /tmp
/dev/hda8             10080488   5396944   4171476  57% /home
bash-2.05b$ cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,noatime 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev ramfs rw 0 0
none /dev/pts devpts rw 0 0
/dev/hda12 /usr ext3 rw,noatime 0 0
/dev/hda7 /tmp ext3 rw,noatime,noexec 0 0
/dev/hda8 /home ext3 rw,noatime 0 0
/dev/hda5 /home/extrabig ext3 rw,noatime 0 0
none /proc/bus/usb usbfs rw 0 0


any thoughts on how to remedy this?  something is not staying sequenced in the boot process .. slight variations in timing appear to influence the out-come of the mounting commands

I'll be glad to test any solutions as this appears to be a problem brewing for faster machines .. i'm surprised no has seen this before ..or am I wrong there.



Comment 8 Derk W te Bokkel 2004-05-05 19:39:32 UTC
by the way I have 3 other slower machines athlon 2500 xp, 2200 xp and a p3 750 all running mm-sources-2.6.6_rc3-r1 at the moment and this does not happen with those machines

Comment 9 Derk W te Bokkel 2004-05-06 09:20:30 UTC
by the way here is my /etc/fstab: It has worked without problems for at least two years .. there have been minor changes along the way as drive /dev/hdb no longer exists in this machine.



# /etc/fstab: static file system information.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.13 2003/07/17 19:55:18 azarah Exp $
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda9               /boot           ext2            noauto,noatime          1 1
/dev/hda10              /               ext3            defaults,noatime        0 1
/dev/hda12              /usr            ext3            defaults,noatime        0 2
/dev/hda7               /tmp            ext3            noexec,noatime          0 2
/dev/hda8               /home           ext3            defaults,noatime        0 2
/dev/hda5               /home/extrabig  ext3            defaults,noatime        0 2
/dev/hda6               none            swap            sw                      0 0
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         users,noauto,rw         0 0
/dev/cdroms/cdrom1      /mnt/cdrom1     auto            users,noauto,ro         0 0

# NOTE: The next line is critical for boot!
none                    /proc           proc            defaults                0 0
none                    /sys            sysfs           defaults                0 0
none                    /dev/pts        devpts          defaults                0 0



# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
# Adding the following line to /etc/fstab should take care of this:

none                    /dev/shm        tmpfs           defaults                0 0



/dev/fd0        /mnt/floppy     auto    users,noauto,rw 0 0

/dev/sda1       /mnt/hold       vfat    users,noauto,rw 0 0

/dev/hda11      /mnt/backups    ext3    user,noauto,noatime     1 2
# /dev/hdb6, /dev/hdb7 /dev/hdb5  /dev/hdb1 still free

/dev/hda1 /mnt/win-hda1 vfat noauto,uid=1001,umask=002,exec,dev,suid,rw 0 0
#/dev/hdb1 /mnt/win-hdb1 vfat uid=1001,umask=002,exec,dev,suid,rw 0 1

note: to fudge the bootscript I duplicated the 'mount -at ..etc'  line in /etc/init.d/localmount i.e. two passes at it .. so at least the drives are mounted. The problem appears to be in the actual mount command.


Comment 10 Derk W te Bokkel 2004-05-06 09:24:38 UTC
note:  In spite of adding an extra mount line mtab is still not in sync with /proc/mounts all the late mounts are not visable with "df" .. if the command "mount -a" is done as root after booting then the late mounts are added to /etc/mtab but this is not happening inside "localmount"
Comment 11 Derk W te Bokkel 2004-05-06 09:48:37 UTC
okay this is interesting .. just commenting out the duplicated 'mount -at' line allows everything to mount normally ..??.. so I added another (second) comment line for good measure just after the original 'mount -at ...' line  in /etc/init.d/localmount .. some other errors appeared how ever relating to read only filesystem and deletion of some lock files in /var/..   but root is mounted rw after all is done so ?? I'll see if it repeats it self consistently..
Comment 12 Derk W te Bokkel 2004-05-06 09:57:29 UTC
okay with mm-sources-2.6.6_rc3-r1 we got all kinds of ERROR s on the next boot due to lock files and rc scripts etc. not executing so alot of the scripts did not run .. but a reboot with 2.6.5-win4lin proceeded as usual with the 'some local files were not mounted error' but having them all present in /proc/mounts but at least one missing from the df listing ..

Time to try something else ? any suggestions ?
Comment 13 Michal Januszewski (RETIRED) gentoo-dev 2004-06-20 04:50:56 UTC
Could you try whether this happens with development-sources-2.6.7? And does `mount -a` fix this (ie. do the filesystems that didn't get mounted at boot due to the mtab issues get mounted now)?
Comment 14 Daniel Drake (RETIRED) gentoo-dev 2004-09-27 12:09:59 UTC
Please reopen with requested information if this issue still exists