# NFS root, baselayout2, shutdown umount /

## bastibasti

Hi,

Iam trying to set up a netboot pc, so far I got everything running. 

kernel command line

```

APPEND ip=dhcp root=/dev/nfs hostname=pc02 gw-ip=192.168.222.151 nfsroot=192.168.222.150:/diskless/pc02,rsize=8192,wsize=8192,hard,intr,nfsvers=3,nolock vga=normal 

```

fstab

```

/dev/nfsroot            /               none            rw,noatime      0 0

```

if I do not have the /dev/nfsroot entry in fstab, the nfsroot will be read only. adding the rw flag to the kernel command line makes the kernel not mount the nfs share

now when I shutdown the system, the system will unmount the root which results in the system not to shut down.

Is this a mistake in the netmount scripts, or did I miss anything?

----------

## nativemad

Hi, 

i'm not sure if it's the only thing i did, but in /etc/init.d/netmount under "stop(){" i changed "local rcfilesystems=${NET_FS_LIST}" to "local rcfilesystems="/usr/portage", as it's the only nfs-mount besides the root in my setup.

HTH, Cheers

----------

## bastibasti

I did something else, as I have many network mounts:

Original

```

stop()

{

        local x= fs=

        ebegin "Unmounting network filesystems"

        . "$RC_LIBEXECDIR"/sh/rc-mount.sh

        for x in $net_fs_list; do

                fs="$fs${fs:+,}$x"

        done

        if [ -n "$fs" ]; then

        umount -at $fs || eerror "Failed to simply unmount filesystems"

        fi

        eindent

        fs=

        for x in $net_fs_list; do

                                fs="$fs${fs:+|}$x"

        done

        [ -n "$fs" ] && fs="^($fs)$"

        do_unmount umount ${fs:+--fstype-regex} $fs --netdev

        retval=$?

        eoutdent

        if [ "$RC_UNAME" = Linux ]; then

                umount -a -O _netdev

                retval=$?

        fi

        eend $retval "Failed to unmount network filesystems"

}

```

Changed

```

stop()

{

        local x= fs=

        ebegin "Unmounting network filesystems"

        . "$RC_LIBEXECDIR"/sh/rc-mount.sh

        for x in $net_fs_list; do

                fs="$fs${fs:+,}$x"

        done

        if [ -n "$fs" ]; then

        if [ "$fs" != "/" ];then

        umount -at $fs || eerror "Failed to simply unmount filesystems"

        fi

        fi

        eindent

        fs=

        for x in $net_fs_list; do

                                fs="$fs${fs:+|}$x"

        done

        [ -n "$fs" ] && fs="^($fs)$"

        do_unmount umount ${fs:+--fstype-regex} $fs --netdev

        retval=$?

        eoutdent

        if [ "$RC_UNAME" = Linux ]; then

                umount -a -O _netdev

                retval=$?

        fi

        eend $retval "Failed to unmount network filesystems"

}

```

if [ -n "$fs" ]; then

if [ "$fs" != "/" ];then

umount -at $fs || eerror "Failed to simply unmount filesystems"

fi

fi

There are some more changes that need to be done, I think I will post them all as a bug when the system runs 100% fine

----------

## john90901

Just want to add that bastibasti's fstab entry ( /dev/nfsroot ) worked.

So why are the docs not updated to include this hint or a reference to this thread???????????????????????????????

----------

