# Diskless Gentoo Read-Only / Issue [SOLVED]

## Maquis196

SOLUTION EDIT: On the server; add RW to the append line in pxelinux.cfg/default to whatever kernel you are loading.

All, I have just got myself a new htpc with the Asus AT5IONT-I mobo which has a Realtek 8168B NIC. Now the following issues have cropped up that I haven't been able to solve;

1. It boots off the server fine, then pauses for about a minute and then moans it cant find the firmware  patch rtl_nic/trl8168d-2.fw. Now I have included this in my kernel as this thread https://forums.gentoo.org/viewtopic-t-899002-start-0.html suggests. However my kernel still doesn't load it BUT it continues to boot which I'm assuming results in my next issue;

2. root doesn't become RW. As you can imagine this causes all sorts of issues. To head off config issues I can confirm that running /etc/init.d/root restart after I login mounts root RW. 

So how do I proceed? I'm actually lost for ideas, I'm going to try and do a genkernel to see if fixes this for me, I have no idea why using the same instructions from the thread above doesnt work for me and I have double checked the spelling. I can live with the firmware issue and the delay in booting if I was able to boot into a rw environment.

FYI. The root is just one directory on my server. So if I have to have a seperate /usr or /var or something to help going rw I will gladly but not sure what I would need!

Cheers all!

Chris

EDIT: The nic I say I have is what lspci reports. The firmware patch I'm missing is what the kernel reports it can't find.Last edited by Maquis196 on Sat Nov 12, 2011 9:30 pm; edited 2 times in total

----------

## DaggyStyle

emerge sys-kernel/linux-firmware

----------

## Maquis196

I have done  :Smile: 

The kernel includes in firmware in the compile (as I test I made a typo to see what happened and it refused to compile) I do have the firmware in /lib/firmware.

It doesn't make sense does it? It simply should work :S

----------

## NeddySeagoon

Maquis196,

That thread worked for me. You need to create the path rtl_nic/trl8168d-2.fw inside your kernel, since after root is mounted (using the NIC) its too late to load the firmware from /lib/firmware

You need  

```
  │ │                -*- Userspace firmware loading support                                                │ │  

  │ │                [ ]   Include in-kernel firmware blobs in kernel binary                               │ │  

  │ │                (rtl_nic/rtl8168e-2.fw) External firmware blobs to build into the kernel binary       │ │  

  │ │                (/lib/firmware/) Firmware blobs root directory
```

in your kernel and the firmware must exist at /lib/firmware/rtl_nic/rtl8168e-2.fw so the kernel can include it.

Rebuilds and reboot into your new kernel. That will fix your 60 sec timeout.

Root being read only is a different problem.  You have a piece of rpc missing. I forget what it was called but attempting to run 

```
mount -o remount,rw /
```

will tell you what it is.

Either in the error message or in dmesg.

----------

## Maquis196

```
CONFIG_EXTRA_FIRMWARE="rtl_nic/rtl8168d-2.fw"

CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

```

Is what I have in the .config which on double checking matches yours. Can confirm the kernel includes them as well. 

As for the RO bit, you might be right. What you asked didn't throw up any errors (other then mtab being RO) but although mount was saying that / was RW I couldn't actually write anything; I ran revdep-rebuild in the /diskless/defiant (my /) in a chroot on the server and I have some issues including /usr/sbin/rpc.mountd so that should fix it hopefully...

Nope. mount reports the fs is rw but can't create anything. I tried to mount another nfs share on the box and it complains that rpc.statd doesnt work because rpcbind isnt running. That fails to start yet wont tell me why  :Smile: . 

Could this be an issue with using the latest kernel? Should I downgrade to a 2.6 and see what happens?

----------

## Maquis196

Okay, strangeness... I restarted in.tftpd and rebooted the box. The firmware issue disappears \o/.

However, still RO filesystem. Can't trust mount obviously because mtab is read-only so not updated. 

On the server I get;

```
Nov 12 21:16:27 shadow rpc.mountd[2611]: authenticated mount request from 192.168.1.99:949 for /diskless/defiant (/diskless/defiant)
```

exports;

```
/diskless/defiant   192.168.1.0/24(sync,rw,no_root_squash,no_all_squash)
```

The above is mountable from my desktop and is RW. So it must be something in the boot process?

----------

## NeddySeagoon

Maquis196,

My diskless box is using gentoo-sources-3.1.0.  I can share the config if you like.

Check that your rtl8168d-2.fw is where the kernel expects to find it and check 

```
uname -a
```

you are running the right kernel. Look at the build time.

If the firmware isn't loading, its not in the kernel you are running. 

rpcbind is provided by net-nds/rpcbind-0.2.0 on my ~arch box. I'm not 100% sure if its needed at both ends or not.

That package installs  /sbin/rpcbind, a startup script /etc/init.d/rpcbind and a config file /etc/conf.d/rpcbind

It should be run by nfs or netmount, which should be in the default runlevel at both ends of your nfs link

----------

## Maquis196

It's definitely the right version. It's the only box I have running 3.x  :Smile:  and I double checked with the bzImage from /usr/src.

Well I used /dev/shm to mount on /var and created log, lib/nfs and run to start rsyslog, rpc.statd and rpcbind. I can now mount things like /usr/portage and have rsyslog let me know why things failed.

The remount command you gave me runs but doesn't produce anything. If I restart /etc/init.d/root I get a "you are stopping a boot service" message but again nothing happens. I just double checked my kernel and I do have root file system on nfs set.

Well I'm stumped again.

P.S - I'll gladly take your config, I imagine our configs would be identical almost.

----------

## Maquis196

I had an idea and mounted /diskless/defiant/etc on /etc and it worked... so I ran /etc/init.d/root and looked at mtab I get;

(I can't copy n paste but these lines concern me)

rootfs / rootfs rw 0 0

192.168.1.251:/diskless/defiant/ / nfs ro [blah blah]

So I could probably cheat and mount everything directly and leave / alone but it feels messy and I probably would have to mount the ram disk manually first. Not good.

----------

## NeddySeagoon

Maquis196,

I don't think its a kernel issue.  Do you have the rpcbind package at all ?

My gentoo-sources-3.1.0

wgetpaste is your friend, if you can emerge it.

----------

## Maquis196

Ill have a look at that program thanks! 

rpcbind is installed, as is nfs-utils. Could it be a user-land program is doing some mounting instead of the kernel? (I'm clutching at straws now I think).

```
default Gentoo

prompt 0

timeout 5

MENU TITLE PXE Menu

LABEL Gentoo

   MENU LABEL Gentoo

   kernel bzImage 

   append root=/dev/nfs ip=192.168.1.99/24 nfsroot=192.168.1.251:/diskless/defiant

   ipappend 1
```

is my pxelinux.cfg/default. Could it be something there?

----------

## NeddySeagoon

Maquis196,

That looks OK to me.  Just like a conventional boot, the root filesystem should start out read only and be changed to read write after root-fsck has run and root been confirmed clean.

The kernel has to mount root, as there is no userspace tools around until after root is mounted and init has begun spawing processes.

----------

## Maquis196

Oh for crying out loud!

Fixed it and guess what all it took...

a RW in pxelinux.cfg/default after append. Grrrrr Ive wasted about 7hrs of my life for those 2 digits. I realised that since fstab was being ignored for root Gentoo style (I recall this issue a while back with mdadm stuff once) I decided the last roll of the dice was doing this. Still can't believe it worked though.

What a way to spend a Saturday  :Razz: .

Well cheers for your help dude, it certainly shaped my triage process and to think by trade I'm a Linux Sysadmin lol. I'll mark this thread as solved and begin the long march to getting mythtv working :S. Thanks again!

/Chris

----------

## NeddySeagoon

Maquis196,

Glad its sorted

fstab is *always* ignored for mountting root.  Its stored on the root filesystem, so can't be read until root is mounted, whichis a bit late for mouting root.

That overly balck and white.  fstab is consulted to determine the filesytsem type for root-fsck before root is made read/write. So the fileseyem type must be correct there.

----------

## Maquis196

I see, I've never really considered that before, but I would expect default behaviour to be RW? I can see why on a diskless system it might not be but a warning in the nfs (no subtree_check option set) style would have been nice!

This whole rw root thing was just only a bit worse then getting audio through HDMI. Ugh. whole project finished just 2hrs ago lol.

----------

## NeddySeagoon

Maquis196,

I don't explicity set RW but it get a RW root

----------

