View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 6 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Aug 15, 2006 1:20 pm 
Offline
Joined: Mon Jan 09, 2006 3:59 pm
Posts: 18
This is my approach on a diskless frontend with KnoppMyth!

I know this was written about many other times... But I simply thought the other ones was unnessessary complex, with terminal services and DHCP/BOOTP and such things.....

This is based on, what I think, is the most common setup.... Static IP (not necessarily static, but atleast always the same IP on each reboot) frontends/backends. Rhis was written almost completely from my head, so please post comments and corrections where I missed out... ;)

Now to the HOWTO:

It basically works like this:
Use a USB-stick to boot a well prepared linux kernel, mounting the original drive via NFS from the backend.
(Specifically based on VIA EPIA 10000N Nano-ITX, but should be useable on other boards if hardware specific steps (Network card only) are changed)

Prereq: Harddrive connected to frontend, with knoppmyth installed
(not necessarily fully configured, you can do that later if you wish).
One empty, clean, USB stick with atleast 8Mb of memory.
Atleast 512Mb RAM memory
(can be done with less, but we skip swap. If swap is needed, please search the net for swap over NFS)

---------------------------------------
Part 1. Preparing the USB:
1. Creating a new kernel, to use on the USB stick.

Code:
cd /usr/src/linux/
make menuconfig


In the configuration menu, go into
"Device Drivers ---> Network device support ---> Ethernet (10 or 100 MBit) ---> VIA Rhine support"
And make sure that VIA Rhine support is marked <*> (use space to toggle until starred)
(Ofcourse, change this step if you have another ethernet chipset)

Build in support for the BOOTP protocol (Networking options ---> IP: kernel level autoconfiguration ---> IP: BOOTP support).

Now go back to main menu again and go into
"File systems ---> Network File Systems ---> NFS file system support" make sure it has <*>
Also make sure that "Provide NFSv3 client support", "Provide NFSv4 client support"
and "Allow direct I/O on NFS files" are all marked [*]
Scroll down a bit and also make sure that "Root file system on NFS" is marked [*]

Go back again and go into
"Device Drivers ---> Block devices ---> Loopback device support" and make sure it is <*>

Now, time to build and prepare kernel.
Code:
make
mknod /dev/boot255 c 0 255
rdev /usr/src/linux/arch/i386/boot/bzImage /dev/boot255


2. Prepare USB stick to use the new kernel.
Insert the USB stick and note the drive assigned (in my case "sda", and probably yours too)

Do:
Code:
syslinux /dev/sda1
mkdir /mnt/sda
mount /dev/sda1 /mnt/sda
cd /mnt/sda
nano syslinux.cfg

Add these lines: (change the data marked with <> with your settings)
Code:
DEFAULT linux
PROMPT 1
TIMEOUT 20
APPEND init=/sbin/init root=/dev/nfs ip=<frontend_ip>:<backend_ip>:<gateway_ip>:255.255.255.0:::'off' nfsroot=<backend_ip:/frontend/root,rsize=2048,wsize=2048


Do:
Code:
cp /usr/src/linux/arch/i386/boot/bzImage /mnt/sda/linux
cd /
umount /dev/sda1


---------------------------------------
Part two: Preparing the frontend.

3. Modifying startup scripts.

Code:
cd /etc/init.d
mv checkfs.sh checkfs.sh.disabled
mv checkroot.sh checkroot.sh.disabled
nano rcS

Add these lines in rcS just after the header comments:
Code:
mount -o remount,rw /
mount -t proc proc /proc

Remove calls to checkfs.sh and checkroot.sh:
Code:
nano knoppix-autoconfig

Search for checkfs.sh by pressing ctrl-w and type checkfs.sh. Place # first on both rows (checkfs.sh and checkroot.sh)

After this, you haveto remove the configuration entries for the network interface in /etc/network/interfaces... the cleaned interfaces should look something like:

Code:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback


4. edit fstab.

Code:
nano /etc/fstab

Comment the lines that begin with "/dev/hda1", "/dev/hda2" and "/dev/hda3"
Add this somewhere after the headercomments:
Code:
proc  /proc  proc  defaults  0  0
sysfs /sys   sysfs defaults  0  0
192.168.0.123:/frontend/myth    /myth   nfs     nfsvers=3,wsize=2048,tcp  0 0


---------------------------------------

Part three. Preparing the backend. (Performed on the backend, with the frontend's drive attached)

5. prepare NFS.

Add the mountpoints in exports.
Run:
Code:
nano /etc/exports

And make sure it looks somewhat like: (change 192.168.0.124 to your frontends ip)
Code:
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
/frontend/root   192.168.0.124(rw,no_root_squash)
/frontend/myth   192.168.0.124(rw,no_root_squash)


6. Prepare the backends fstab.

Create the exported dirs and edit fstab:
Code:
cd /
mkdir /frontend
mkdir /frontend/root
mkdir /frontend/myth
nano /etc/fstab

Add the frontend's partitions to the table.
Change "hde" to the device the frontend drive got on bootup
(IDE0 master == hda, IDE0 slave == hdb, IDE1 master == hdc, IDE1 slave hdd.. and so on..)
Make sure fstab look something like (add last in file):
Code:
# diskless frontend...
/dev/hde1 /frontend/root ext3 defaults 0 0
/dev/hde3 /frontend/myth ext3 defaults 0 0


Run:
Code:
mount -a
ls /frontend/root

The listing should contain alot.. (the frontend's root folders)

7. Make sure that nfs is started on the backend on boot.

Add the following somewhere in the startup (or run it on each reboot of the backend):
Code:
/etc/init.d/nfs-kernel-server start


8. (The fun part) Try it!
Make sure that the USB stick is in the frontend. Make sure NFS is running on backenbd. Reboot frontend!

DONE!

This was written out of my head, so no gaurantees. Please post
suggestions/changes/problems/questions here if you like.
It will probably not work on your first try, but hopefully it does!

Regards // OwL


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 8:26 am 
Offline
Joined: Mon Apr 17, 2006 2:52 pm
Posts: 31
Location: Michigan
Tried this with a few modifications and it worked!

Hardware is an AthlonXP 1800+, 512mb RAM, NV5200, Soltek mobo with VIA :shock: chipset.

Instead of a USB thumb drive, I used a 16mb CF card and an IDE adapter. I would imagine this would be more compatable with older hardware that isn't able to boot from USB. Plus, it only cost about $15 (US) for me.

I also just copied the contents of the frontend hard drive onto the server rather than install the whole drive.

Third change was minor, using DHCP assigned from my router rather than hard IP addresses. The router does assign the same IP every time based on MAC addresses.

My only gotcha was I got to carried away with copy-paste in the syslinux.cfg
Everything after APPEND needs to be on one line, not broken up like it shows on the forum.

System boots just as fast as it did with a hard drive, and is near silent now without the hard drive in it. Speed control on the CPU fan will make this inaudable.

Thanks for the great howto!! :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 2:50 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
A script is provided with R5D1 that you run on your backend as follows:
Code:
knoppmyth_diskless_frontend.bash frontend_hostname

Thats all you need to do. It will set everything up so that a diskless FE can boot over the network using an NFS root on the backend. It even does all of the tweaks that are required to operate a remote mythtv frontend.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 4:01 pm 
Offline
Joined: Mon Apr 17, 2006 2:52 pm
Posts: 31
Location: Michigan
Greg Frost wrote:
A script is provided with R5D1 that you run on your backend as follows:
Code:
knoppmyth_diskless_frontend.bash frontend_hostname

Thats all you need to do. It will set everything up so that a diskless FE can boot over the network using an NFS root on the backend. It even does all of the tweaks that are required to operate a remote mythtv frontend.


Here are a few reasons one would not be able to use the script...

1. Being able to boot from the network card. I wasn't able to. CF card solves that for me.

2. I had a tweaked frontend installed and running on .20. Didn't want to start over from scratch, and hadn't read if it's easy to upgrade to .20 after the fact.

3. My FE has considerably different hardware than the BE. Reading thru http://mysettopbox.tv/phpBB2/viewtopic.php?t=10098 turns up some issues with the NVidia installer. FE needs it BE doesn't.

4. I didn't want two DHCP servers running, and I didn't want to depend on the BE to do DHCP for my windows boxes. Letting my router take care of it all simplifies things for me.

5. It just nice for people to have more options if the out of box stuff doesn' work. Just wanted to let people know this works well.

_________________
Increasing my couch potatoness by a factor of pie.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 6:36 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
goofnrox wrote:
1. Being able to boot from the network card. I wasn't able to. CF card solves that for me.

Excellent point. You obviously need to be able to net boot for the script to work.

goofnrox wrote:
2. I had a tweaked frontend installed and running on .20. Didn't want to start over from scratch, and hadn't read if it's easy to upgrade to .20 after the fact.

Since the script shares the /usr dir from the BE, it will automatically have the same myth version as your BE.

goofnrox wrote:
3. My FE has considerably different hardware than the BE. Reading thru http://mysettopbox.tv/phpBB2/viewtopic.php?t=10098 turns up some issues with the NVidia installer. FE needs it BE doesn't.
Yes, but as you would have seen from that thread, there are ways around getting it to install the nvidia driver.

goofnrox wrote:
4. I didn't want two DHCP servers running, and I didn't want to depend on the BE to do DHCP for my windows boxes. Letting my router take care of it all simplifies things for me.
This is also a good point. I am not sure if it is possible to get the net boot thing wokring if th FE doesnt DHCP from the BE. I guess the BE could be configured to only DHCP to the FE's mas address, but the user would then have to specify the mac address when running the script.

goofnrox wrote:
5. It just nice for people to have more options if the out of box stuff doesn' work. Just wanted to let people know this works well.
I agree. Cudos to you for posting your method.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 6:46 pm 
Offline
Joined: Thu Dec 22, 2005 5:32 pm
Posts: 198
you can go into the dhcp and configure it to had out specific ip's to specific MAC address. Then give it the range of only how many FE you have. This is how I do it because I also have another DHCP server for my other computers and didn't want them to mess each other up.

_________________
Marty

Long live Myth and Knoppmyth!!!!!


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu