Mount point not found in mtab
Alan Bateman
Alan.Bateman at Sun.COM
Wed May 27 08:00:21 PDT 2009
Mark Wielaard wrote:
> :
> Aha, this seems to come from the fact that under the chroot /etc/mtab
> has not all file systems. In fact there is no guarantee that it has,
> since one could have mounted with -n so /etc/mtab isn't updated. A
> workaround might be to use /proc/mounts if /etc/mtab misses the
> information.
>
>
A mysterious failure indeed - thanks for the bug report and sleuthing.
LinuxFileStore's findMountEntry does assume that all file systems are
listed in /etc/mtab so we can fix this as you suggest by looking in
/proc/mounts if needed. I'll try to get time in the next day or two to
put a fix into nio/nio/jdk for this. If you need a quick workaround
then changing getMountEntries to open /proc/mounts instead of
/etc/mnttab should do it with the only side effect that getFileStores()
will return an iterator over all mounted file systems so it won't match
df exactly.
As an aside, I have changes in the pipe to the temp file support that
eliminates probing of the tmp directory (that code in
File$TemporyDirectory is a bit ugly and needed to be re factored). It's
possible we wouldn't have seen this issue if these changes had come
earlier.
-Alan
More information about the nio-dev
mailing list