3

I have a server (SLES 11 running on a VMware hypervisor if that matters) with a tmpfs partition meant for mysql temporary tables, and I run mysql chrooted.

df -h gives me strange outpupt:

root@db12.lab:~# df -h /usr/chroot/tmp/
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            77G   66G  7.9G  90% /usr/chroot/tmp

While mount goes like this:

root@db12.lab:~# mount | grep tmpfs
tmpfs on /usr/chroot/tmp type tmpfs (rw,size=512m)

The database runs allright and I don't see any fs-related errors in the log. I did try to stop the daemons and mount/unmount the FS, but it didn't help.

I wonder what it might mean and how such kind of problems is solved?

It doesn't affect anything, but it's somewhat mystical and I'd like it to go.

Roman Grazhdan
  • 334
  • 3
  • 15
  • 2
    I am terribly sorry, remounting did actually help, I've just retried it just in case and all the magic is gone. Could the mods please close the question? – Roman Grazhdan May 19 '14 at 12:46
  • It is possible to answer your question as well, and this is maybe a better solution. – peterh May 19 '14 at 13:09
  • Well what actually happened is the tmpfs partition was not mounted, but it was listed in mount, so df -h was reporting the usage of / instead, since it's the 'parent' partition of a directory which was supposed to be the mountpoint for tmpfs. Mount, on the other hand, lied to me: 'It is possible that files /etc/mtab and /proc/mounts don't match. The first file is based only on the mount command options, but the content of the second file also depends on the kernel and others settings'. I should have checked /proc/mounts, too. – Roman Grazhdan May 19 '14 at 16:07
  • 1
    I'd say answer your own question and mark it, since you solved it yourself. – Joshua Nurczyk May 19 '14 at 21:29
  • It would be allright if I had a real problem with this weird behavior. I should have double check things before asking, so let there be a comment for anyone who does something like this, but I think it's not actually an answer. – Roman Grazhdan May 22 '14 at 10:33

1 Answers1

1

When using the mount command you'll see whatever options are in /etc/mtab. But /etc/mtab is just a file, there is nothing magical about it. It can get out of sync with reality in various ways. For example /etc/mtab cannot be updated if the file system it is located on is read-only. And if /etc/mtab is located on a file system, which is persistent across reboots, then it may contain entries from a previous boot.

The contents of /proc/mounts is however a view into the actual kernel data structures. As long as /proc is mounted, you will always get up to date information from /proc/mounts. But though the format of /etc/mtab and /proc/mounts are identical, there may be some information which is only available in /etc/mtab.

kasperd
  • 30,455
  • 17
  • 76
  • 124