# df: `/proc/fs/nfs': No such file or directory

## toralf

I'm wondering about the error msg from the df command of the following command line sequence :

```
n22 ~ # mount -o loop           /opt/uml/root_fs        /mnt/loop

n22 ~ # chroot /mnt/loop /bin/bash

n22 / # df

Filesystem           1K-blocks      Used Available Use% Mounted on

rootfs                 1269373    678571    525266  57% /

/dev/root              1269373    678571    525266  57% /

sysfs                  1269373    678571    525266  57% /sys

udev                   1269373    678571    525266  57% /dev

devpts                 1269373    678571    525266  57% /dev/pts

df: `/proc/fs/nfs': No such file or directory

n22 / # mount

rootfs on / type rootfs (rw)

/dev/root on / type ext3 (rw,noatime,errors=continue,data=ordered)

/proc on /proc type proc (rw,nosuid,nodev,noexec)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)

udev on /dev type tmpfs (rw,nosuid,size=10240k,mode=755)

devpts on /dev/pts type devpts (rw,nosuid,noexec,gid=5,mode=620)

nfsd on /proc/fs/nfs type nfsd (rw,nosuid,nodev,noexec)

n22 / # exit

exit

n22 ~ # umount /mnt/loop/

```

where I chroot into my user mode linux image.

----------

## poly_poly-man

no such error outside the chroot, right?

and, although it's weird that you have some similar functionality, try mounting /proc within the chroot ( or outside...)

mount -t proc none /mount/point

----------

## toralf

 *poly_poly-man wrote:*   

> no such error outside the chroot, right?
> 
> and, although it's weird that you have some similar functionality, try mounting /proc within the chroot ( or outside...)
> 
> mount -t proc none /mount/point

 yes - however the example above was only used to show the problem.

It occurs even if I mount all necessary dirs - here's the whole script :

```
tfoerste@n22 ~/workspace/bin $ cat chr_uml.sh

#!/bin/sh

#

#       Toralf Förster

#       Hamburg

#       Germany

if [[ "$(whoami)" != "root" ]]; then

        echo " You must be root !"

        exit 1

fi

#       load module if neccessary and sleep a sec

#       to give it time for initialization

#

if [[ -z "$(lsmod | grep "^loop ")" ]]; then

        echo -n " modprobe ..."

        modprobe loop && sleep 1 || exit 1

        echo " ok"

fi

echo -n " mounting ..."

#       the UML root file system

#

mount -o loop           /opt/uml/root_fs        /mnt/loop       &&\

mount -t proc           none                    /mnt/loop/proc          &&\

mount --bind            /dev                    /mnt/loop/dev           &&\

mount --bind            /dev/pts                /mnt/loop/dev/pts       &&\

#       use disk space from the host to keep the UML image small

#       the portage ccache is build by the host system too

#       BTW ",ro" is ignored currently by linux

#

mount -o bind,ro        /usr/portage                    /mnt/loop/usr/portage           &&\

mount -o bind,ro        /usr/local/portage              /mnt/loop/usr/local/portage     &&\

mount -o bind           /var/tmp/ccache                 /mnt/loop/var/tmp/ccache        &&\

mount -o bind           /mnt/uml/var/tmp/portage        /mnt/loop/var/tmp/portage       &&\

echo " ok"

#       ok, lets jump into the image

#

chroot /mnt/loop /bin/bash

#       finishing

#

echo " umounting ..."

umount /mnt/loop/var/tmp/portage

umount /mnt/loop/var/tmp/ccache

umount /mnt/loop/usr/local/portage

umount /mnt/loop/usr/portage

umount /mnt/loop/dev/pts

umount /mnt/loop/dev

umount /mnt/loop/proc

umount /mnt/loop

exit 0

```

----------

## poly_poly-man

mount -t nfsd none /proc/fs/nfs?

----------

## NeddySeagoon

toralf,

df uses /etc/mtab which is missing inside the chroot.

It either fails totally if its missing or sows something odd if /etc/mtab is there but bears no resemblance to reality.

mtab is updated by mount

----------

## toralf

 *NeddySeagoon wrote:*   

> toralf,
> 
> df uses /etc/mtab which is missing inside the chroot.
> 
> mtab is updated by mount

 Yep, that's the reason (and mtab isn't always up-to-date as "man mount" says ...)

 thx

----------

