LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   pxe nfsroot without initrd (https://www.linuxquestions.org/questions/slackware-14/pxe-nfsroot-without-initrd-636597/)

penguinbrain 04-20-2008 09:47 AM

pxe nfsroot without initrd
 
Trying to install a pxe server using the slackware 12 PXE howto I found that the default initrd have to be modified.

I had the same problem as described in this thread :
http://www.linuxquestions.org/questi...-image-567364/

Then I wondered if it was possible to have slackware booting without an initrd. I didn't found any informations about this except for particular kernel (ram check if I remember well).
As it is not urgent I told myself : Give it a try.

I found the parameters of pxelinux.cfg/defaults (in tftpboot/slackware) that allow to mount nfs as root.

Here is my defaults

Code:

default test
prompt 1
timeout 1200
display message.txt
F1 message.txt
F2 f2.txt
label test
  kernel kernels/pxe2.s/bzImage
  append init=/sbin/init root=/dev/nfs nfsroot=10.0.0.1:/exports/client ip=dhcp SLACK_KERNEL=pxe2.s devfs=nomount

Here is my pxe server /etc/export where I have an export for the system which is read-only and an export for the /home that I mount in the client fstab.

Code:

/exports/client          10.0.0.0/24(ro,sync,no_root_squash)
/exports/home            10.0.0.0/24(rw,sync,no_root_squash)

After a few problems with the /dev (was missing the necessary console and null devices) The workaround was to recompile a kernel (using 2.6.25) to have of fixed udev, the slackware 12 one failing to mount tmpfs on /dev.

For the /tmp and other compulsory temp directories I used the following fstab for clients.

Code:

10.0.0.1:/exports/client / nfs nfsvers=3,rsize=8192,wsize=8192,tcp
tmpfs  /dev        tmpfs    rw
proc  /proc      proc    defaults
tmpfs  /tmp        tmpfs    rw
tmpfs  /var/tmp    tmpfs                      0 0
ramfs  /var/run    ramfs                      0 0
ramfs  /var/log    ramfs                      0 0
ramfs  /var/lock  ramfs                      0 0
ramfs  /var/state  ramfs                      0 0
ramfs  /var/tmp    ramfs                      0 0
ramfs  /media      ramfs                      0 0
10.0.0.1:/exports/home /home nfs nfsvers=3,rsize=8192,wsize=8192,tcp

And finaly it works after fixing the non-writable file in /etc like ld.so.cache mtab etc...

Then trying to launch X with KDE on client, it dropped me some more errors about non-writable directories.


Here I am and my questions are :

Is what I am doing stupid? :rolleyes:
Does using pxe without initrd is not recommended (security, fiability ...)?
Last but not least what are the ways to avoid all the problems due to the read-only nfsroot? Does I need to exports some nfs mountpoint writable ?

Thanks

duryodhan 04-21-2008 03:01 AM

Running without initrd is always fine , if you know what you are doing in normal desktop setups... I can't see any reason for it to be otherwise in pxe setups.

Alien Bob 04-21-2008 03:36 AM

The README_PXE.TXT is to be used for installing Slackware.
The README does not describe how to run a Slackware diskless (aka 'thin') client using PXE boot and with the filesystem on a NFS mount. If you want that, you will have to write a custom init script for your initrd.

Doing PXE boot without initrd is impossible. If you want to run Slackware as a diskless client, the init script in the initrd needs to load a network driver, start the network, mount the NFS root, that kind of stuff. The script in the standard Slackware initrd does not do this.

Eric

penguinbrain 04-21-2008 05:11 AM

Thanks for your quick replies.

Quote:

Originally Posted by Alien Bob (Post 3127684)
Doing PXE boot without initrd is impossible.

Are you sure it is impossible ? It works for me.
I compiled a kernel with nfs and network card driver (in fact it is the vmware VM card) and passing the nfsroot to be mount with the pxelinux.cfg/default file as described previously.

The kernel boot then mount the nfsroot, and after udev create the /dev mount as tmpfs and create the necessarily device files in it.
It is only possible with 2.6.25 kernel because udev have some issues fixed since the last version.
After the fstab configuration is loaded to create all temporary folder needed for the system to work as well as the /home with nfs.

I wasn't asking if that could work but if that was reliable.

I will still have to see if the nfsroot have to be read-only or read-write because a lot of folders have to be writable for all the software to run.
As it is my first experience in creating a pxe boot (and nearly the first in managing a linux client/server environment), I am wondering what folders have to be ro or rw. If it is possible not to create an nfs export by client, I would rather.
Does UnionFS, AuFS or another unionfs-likes is a good solution to manage with rw files on shared ro folders ?

Hope my english is clear enough.;)

thanks

MS3FGX 04-21-2008 05:30 AM

I assume Alien Bob meant with the default kernel.

duryodhan 04-21-2008 06:01 AM

With the default kernel, running pretty much anything without initrd is impossible ...

I don't think he meant the default kernel .. we will have to wait for him though :)


All times are GMT -5. The time now is 01:36 AM.