KnoppMyth downloads | documentation | HowTo | reporting bugs | links | Recent Changes  
search for in the  

What is a Wiki?

See WikiWikiWeb

If you don't know how to use a wiki see the WikiHowto

ErfurtWiki is maintained by a loosely knit group of developers.

Quick Links

Related sites

Contact

Please submit website bugs in the BugReports

Contribute!

Please file any wishes on UserSuggestions.

Hosted By

The best way to implement a diskless frontend is to use an NFS Root filesystem. This is a directory on your backend that is served out over the network as the root disk for your diskless frontend. Because the root filesystem is in a separate directory on the backend, it can be fully customised without building a new image every time you decide to fiddle with it.

Setting up the NFS Root.

KnoppMyth now ships with a script to set everything up on your backend for you so that it will allow a diskless frontend to boot from it. All you have to do is run the script:

knoppmyth_diskless_frontend.bash

You will be prompted for any required information (like the host name for the frontend and where to put the frontend's root filesystem on your backend).

After running the script, you should be able to boot your frontend over the network.

If you wish to run more than one diskless frontend, run the script a second time after booting your first diskless frontend, and it will permanently bind the machine's mac address to the IP address and the first NFS root directory. You can then run the script a third time to create a new independent diskless frontend.

If you already have another device on your network setup to do DHCP edit the knoppmyth_diskless_frontend.bash script and find the spot that has the defaults for the DHCP server settings. Insert a # in front of the allow booting line. So it will now look like this.

# allow booting;

Now the DHCP server on the Knoppmyth box will only respond to bootp or PXE boot requests not normally booting DHCP request.

Note for R5E50 users (fixed in R5F27), there is an issue with the script that ships with R5E50 which prevents /usr from mounting properly on the FE.

This is what the script does:

  • Sets up tftpd to transfer the kernel image to the diskless frontend.
  • Creates a tftpboot directory with the nfs root kernel in it.
  • Setup dhcpd to serve out an IP address to the diskless frontend.
  • Enables mysql networking so that the frontend can access the database
  • Adds an NFS export for the usr directory so that the frontend can mount it read only (it is shared between the backend and the frontend to prevent the need to duplicate it because it can be fairly large).
  • Adds an NFS export for nfsroot directory that will be created.
  • Enables nfs so that it can serve the nfsroot, usr and myth directories over the network.
  • Restarts NFS so the changes take effect.
  • Creates the nfsroot directory for the frontend by copying most of the filesystem from your backend. This includes various tweaks so that when the nfsroot is booted, it boots as a frontend only system and connects to your backend.
  • Restarts NFS so the changes take effect.

After you have booted your frontend the first time, you may need to do some adjustments (to account for hardware differences between your backend and frontend), but anything that you change should be saved in the NFS root directory on the backend so that next time you boot the frontend, you will not need to make the changes again.

On R5F27, after re-booting, I had to go to Videos Settings -> General Settings And change "Directory that Holds Videos" from "/share/Movies/dvd" to "/myth/video" & "Directory that Holds Movie Posters" "/home/mythtv/.mythtv/MythVideo" to "/myth/video/.covers"

If you have any problems setting up a diskless frontend, please raise them in this thread on the knoppmyth forums http://mysettopbox.tv/phpBB2/viewtopic.php?t=10098

The following information is provided for historical purposes only. It describes how the first person to get the NFS root thing working did it. Most of the changes that are discussed are now implemented one way or another in the kernel that ships with KnoppMyth, or by the knoppmyth_diskless_frontend.bash script.

One approach to creating the NFS root filesystem is to setup your frontend with a hard drive doing a normal Knoppmyth install and then "simply" move the frontend's root filesystem from the frontend, to an NFS network share on your backend. This then gives you the full flexibility of a normal Knoppmyth install, but had the disadvantage of actually needing a disk to be temporarily installed in the "diskless" frontend.

Another (and probably the easiest) option is to make a copy of your backend's root filesystem and boot the frontend from that. Once it has booted, you can continue to configure the frontend as required. There are obvious issues of security, possible lag across the network, but I will not discuss those here. Also as any swap file would need to be accessed across the network, I would suggest you put sufficient memory in the frontend to avoid an NFS swapfile, but it is possible.

This is how I set up my frontend to network boot. It is currently working for both PXE enabled boot NIC's, and Etherboot.

Scenario:

I have a frontend, which I want to be 192.168.254.1

I have a backend which is 192.168.254.4

I have installed the nfsroot in /myth/terminal_server/nfsroot

You can change all of these, but this guide assumes you are using these values.

Basic Terminal services install.

1) Install and test Terminal Services on the backend. All the hard work is done for you by the most excellent Knoppmyth, and Knoppix_terminal_services. With the Knoppmyth CD in the drive of the backend type:

ts-prep

This will install Knoppix terminal services, configure pxe, start DHCP and TFTP demons, and basically do all the heavy lifting for you.

Configure Terminal services as normal, but there is a very important option you must get right.

When asked "Would you like to have the terminal server start on boot?", answer NO, as this will overwrite any of the changes you make later if you ever reboot your machine.

When it is installed, the frontend machine should be able to network boot from the backend.

I wont explain how it all works here, but the default Terminal services lets you boot as if you are booting from CD on the frontend. The filesystem is read only, and any changes you make are lost on reboot.

If this stage doesnt work, dont bother going any further till it does.

Once you have the frontend network booting the Knoppmyth CD image, check if /tftpboot exists and if it is a symbolic link to /tmp/tftpboot. If it is a symbolic link, you will lose everything in that directory when you reboot, so use the following commands to remove the tftpboot directory from /tmp.

rm /tftpboot
mv /tmp/tftpboot /

2) Install and configure the frontend as a normal KnoppMyth install.

You need a normal HD in your "diskless" frontend to start with. Do a normal install on the frontend, and get it just the way you like it. You may want to follow the "How-To" on frontend only installs, to clear out some of the stuff you dont need on the frontend.

What I did then was to tar up the whole of hda1 (the root partition) of the frontend, and copy it over to the backend.

su
Password:
cd /
tar cvfz /myth/frontend.tar.gz --exclude=sys/* --exclude=proc/* --exclude=myth/* *

As you have already installed terminal services, there will be a directory on the backend ( /myth/terminal_services) which contains KNOPPIX. Untar the tarball of / (hda1) from the frontend, into the directory nfsroot.

cd /myth/terminal_services
mkdir nfsroot
cd nfsroot
tar xvfz frontend.tar.gz

3) Now you need to recompile your kernel to support NFS, NFSroot

cd /usr/src/linux
make menuconfig

Then choose these options. Make sure they are not compiled as modules, but included in the kernel [*] not [M]

Device Drivers --> Network Device support --> Ethernet (10 or 100Mbit) -->[your NIC cards]

Networking --> Networking Options-->IP: Kernel level autoconfiguration

--> IP: DHCP support

--> IP: BOOTP support

--> IP: RARP support

File Systems --> Network File Systems -->NFS Filesystem support

--> root filesystem on NFS

4) IF YOU RUN Knoppix_terminalserver AGAIN EVER YOU WILL NEED TO REPEAT THESE STAGES. Knoppix_terminalserver rewrites a lot of these files every time it is run. Took me a while to catch on to that <Wink!>

Replace vmlinuz in /tftpboot with the new kernel.

cp /usr/src/linux/arch/i386/boot/bzImage /tftpboot/vmlinuz

This may vary based on the machine you recompiled on. (?)

Now you need to edit a couple of files on the backend.

edit /etc/exports

change:

/myth/terminal_server 192.168.254.0/255.255.255.0(ro,no_root_squash,async)

to

/myth/terminal_server 192.168.254.0/255.255.255.0(rw,no_root_squash,async)

and save.

then:

edit /tftpboot/pxelinux.cfg/default

remove the DEFAULT entry and replace with:

DEFAULT vmlinuz
APPEND root=/dev/nfs ip=192.168.254.1:192.168.254.4:192.168.254.254:255.255.255.0::: \
nfsroot=192.168.254.4:/myth/terminal_server/nfsroot
TIMEOUT 300

and save:

In the NFSroot, edit the fstab

/myth/terminal_server/nfsroot/etc/fstab

remove any refrences to local disks, as on the frontend there are not going to be any ! remove

/dev/hda1 / ext3 defaults,errors=remount-ro 0 1

replace with:

192.168.254.4:/myth/terminal_server/nfsroot / nfs defaults,auto,noatime 0 2

so that you are sure that your loading the right root filesystem.

edit /etc/inetd.conf

Find the tftp line, uncomment it and change it to this:

tftp dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.tftpd -s /tftpboot

5) Now you are NEVER going to run knoppmyth_terminalserver again, remember we talked about that ? <Grin> to be sure you dont still have terminal services set to startup at boot time :

update-rc.d -f knoppix-terminalserver remove

You need to make sure that dhcp tftp and nfs all start at boot time so you need to:

update-rc.d nfs-common defaults
update-rc.d nfs-kernel-server defaults
update-rc.d dhcp3-server defaults

tftp should be covered by inet.d

Either restart all these services manually, or reboot to check they start automatically, before the next stage.

6) Moment of truth.

Start the frontend, and try and boot from the network.

The sequence of PXE, TFTP , Knoppix boot screen should be familiar (from stage 1). At the Knoppix screen hit return to select the default boot that you edited in stage 4.

The frontend should now boot as if it is booting from its own hard disk, but the root is now sitting on the backend. As it is mounted read/write, you can do anything you want to the config.

7) But my frontend uses !! etherboot....

Etherboot requires two changes.

First you need to rebuild the etherboot.nbi.

(edit this was completely wrong, now corrected)

cd /tftpboot

mkelf-linux vmlinuz -o etherboot.nbi --append=" root=/dev/nfs \
nfsroot=192.168.254.4:/myth/terminal_server/nfsroot \
ip=192.168.254.1:192.168.254.4:255.255.255.0:::"

Then edit /etc/dhcp3/dhcp.conf and change

# if substring (option vendor-class-identifier, 0, 9) = "Etherboot" { filename
"etherboot.nbi"; }
# else { filename "pxelinux.0"; }
filename "pxelinux.0";

to

if substring (option vendor-class-identifier, 0, 9) = "Etherboot" { filename
"etherboot.nbi"; }
else { filename "pxelinux.0"; }
# filename "pxelinux.0";

This should allow both PXE and etherboot clients to work

John Reid



UpdatedPages

· WakeOnLANRouter last changed on Sun Feb 7 05:04:09 2010
· KnoppMythWiki last changed on Sat Feb 6 14:22:21 2010
· KnoppMythInstall last changed on Tue Feb 2 04:58:54 2010
· StaticIPConfig last changed on Sun Jan 24 11:02:40 2010
· LinuxTips last changed on Tue Jan 12 05:11:08 2010
· TroubleShooting last changed on Tue Jan 12 05:09:39 2010
· HowTo last changed on Tue Jan 12 05:05:53 2010
· RarFiles last changed on Sun Jan 10 06:13:35 2010
· TinnyAudioPVR150 last changed on Thu Jan 7 19:21:53 2010
· MediaMVP_LinuxHOWTO last changed on Mon Jan 4 07:23:41 2010
· StorageGroups last changed on Mon Dec 14 18:38:15 2009
· SandBox last changed on Mon Nov 30 10:04:30 2009
· NZMythConfig last changed on Fri Nov 27 01:32:05 2009
· webminhowto last changed on Wed Nov 25 16:02:59 2009
· UpgradeHowTo last changed on Tue Nov 24 00:09:52 2009
· MythVodkaHuluFixR6 last changed on Mon Nov 23 18:09:38 2009
· Change Channels with Serial Cable last changed on Sat Nov 21 06:22:23 2009
· x11vncHowTo last changed on Wed Nov 18 09:15:23 2009
· GeForce4 last changed on Sun Nov 15 06:13:50 2009
· WhatCardYouUse last changed on Thu Nov 12 22:54:17 2009
· tv_grab_au last changed on Wed Nov 11 16:58:37 2009
· kworld115HowTo last changed on Sat Nov 7 18:18:53 2009
· AutomatedBackup last changed on Mon Oct 12 11:01:34 2009
· MythBackupAndRestoreHowTo last changed on Mon Oct 12 09:59:40 2009
· HardwareAcceleratedVideo last changed on Mon Oct 5 23:03:26 2009
· RepairingMythConvergDB last changed on Thu Oct 1 18:51:12 2009
sitemap |