[H]ard|Forum

Go Back   [H]ard|Forum > Bits & Bytes > Distributed Computing

Reply
 
Thread Tools Search this Thread
  #1  
Old 12-22-2004, 03:32 PM
unhappy_mage [H]ard|DCer of the Month - October 2005, 5.4 Years
 
unhappy_mage is offline
Folding@Home Network Booting with Linux

Well, it's been mentioned lots of times before, but it's finally ready (sort of). Unhappy_mage is proud to present the Folding@Home Network Booting Server. Total download size as of now is around 65MB, and total headache factor per end user is still ridiculous. It will get about 5MB bigger, and about 37 zillion times easier to use, i promise.

For now, these are the instructions. These are not for the faint of heart or Linux n00bs, but it'll get easier and you can really only break one machine. If you are one of the aforementioned n00bs, it might be worth trying anyway if you don't mind losing one machine until it gets worked out.

https://netfiles.uiuc.edu/jkersey/linux/ is the URL. Get the 2 files from there, and get tomsrtbt from toms.net. You want the "dos" or "linux" version. If you have another disk, it'll probably work, just it needs fdisk, mkswap, mke2fs, and tar. Create a disk, and boot it on your "server" machine. You'll also need the server.tar.bz2 and install.tar.gz files available, burn 'em to a CD or something.

Okay, now we start the process of creating a place to put the installation. Run "fdisk" and make a / partition and a swap. You'll only need 512 or so of swap at most, don't go crazy on it. Make the rest /. You probably won't need a /boot partition, but it won't hurt. Run mkswap on the swap partition (remember to change the type!) and mke2fs -m 0 (the -m 0 says reserve 0% for the superuser) on the root. Remember to change the types of the partitions to 82 for the root (and boot, if you make one) and 83 for the swap.

Now mount the root somewhere and the cdrom somewhere else. For the sake of argument, the system is on /mnt/system and /mnt/cdrom. So do this now:
Code:
cd /mnt/system
tar jtvf /mnt/cdrom/server.tar.bz2
This will uncompress the server files to that partition.

Now we need to do some other miscellaneous stuff to finish up the install. First, we'll fix some config files. A few things are different in my setup than they are in yours, so they need to change. We'll make a script to simplify these changes.

First, what IP do you want for the server? Do "export IP=<your ip here>".
Where is your gateway to the internet? Do "export GW=<your gateway here>".
DNS server? "export DNS=<your DNS server>".
Name of the disk installed to? (e.g. hda, EXcluding the /dev/ part) "export MBR=/dev/<your disk>"
Name of root partition? (e.g. hda1) "export DISK=<your root>"
Name of swap partition? (e.g. hda2) "export SWAP=<your swap>"

Okay, now you've got the bits you need defined. Now we'll create the script itself. This is a "sed" script. We use "echo" to make the script.
Code:
echo 's/@@IP@@/$IP/;'      > /tmp/sub.sed
echo 's/@@GW@@/$GW/;'     >> /tmp/sub.sed
echo 's/@@DNS@@/$DNS/;'   >> /tmp/sub.sed
echo 's/@@DISK@@/$DISK/;' >> /tmp/sub.sed
echo 's/@@SWAP@@/$SWAP/;' >> /tmp/sub.sed
echo 's/@@MBR@@/$MBR/;'   >> /tmp/sub.sed
Okay, now the sed script is made. Make sure you get the right number of >'s (one the first time and two thereafter) one each line.

Now we'll unpack the install.tar.gz file to somewhere. Anywhere, it doesn't really matter. Just remember where it is. Change to that directory and do "cd files". Then run these commands:
Code:
sed -f /tmp/sub.sed < bootlocal.sh > /mnt/system/opt/bootlocal.sh
sed -f /tmp/sub.sed < dnsmasq.conf > /mnt/system/etc/dnsmasq.conf
sed -f /tmp/sub.sed < fstab        > /mnt/system/etc/fstab
sed -f /tmp/sub.sed < hostname     > /mnt/system/etc/hostname
sed -f /tmp/sub.sed < hosts        > /mnt/system/etc/hosts
sed -f /tmp/sub.sed < ifcfg-eth0   > /mnt/system/etc/sysconfig/network-scripts/ifcfg-eth0
sed -f /tmp/sub.sed < interfaces   > /mnt/system/etc/network/interfaces
sed -f /tmp/sub.sed < lilo.conf    > /mnt/system/etc/lilo.conf
mkdir /mnt/system/foldsave
mkdir /mnt/system/fold
Now we're ready to run Lilo and reboot. Do "lilo -C /mnt/system/etc/lilo.conf".

Clients should be able to boot now. The server will handle either "PXE" or "Etherboot" clients with equal ease.

If you run into trouble with these instructions, please email me. I appreciate any help you can give me in simplifying these instructions, the whole process, fixing stuff that's broken, money , or whatever. Fold on, everyone.


edits:
add disclaimer about change partition types
no /dev/'s in DISK, SWAP, and ROOT.

Last edited by unhappy_mage; 12-24-2004 at 02:44 PM.. Reason: revision
  #2  
Old 12-22-2004, 03:39 PM
OSUguy98 [H]ard|DCer of the Month - April 2006, 6.1 Years
 
OSUguy98 is offline
Sweet!! I'll have to give this a try, even if I do fall into the "Linux noob" category (there's only one way to learn/relearn, right?)

I hope alot of people try this out and give you feedback on how things go


Keep on Folding!!

__________________
~12GHz Folding for the [H]orde

"Damn the statistics...full fold ahead!" --Relic

For help building that Folding Farm ----> http://www.freewebs.com/hardfolding/Horde.htm
  #3  
Old 12-23-2004, 12:14 AM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Bah.. trying to have some fun and do this in VM ware just to practice before I destroy some real hardware.. Almost there.. Just having some mount and extract confusion on my part. I mounted the harddrive to /mnt/system, but when I extract the files they dont show up there. Well Im off to bed for now, but Ill start crackin at it tomorrow again.

In all actuality I will probably run net boot server in a vmware session anyways..
__________________
Yo it's Moe
  #4  
Old 12-23-2004, 12:34 AM
rogue_jedi [H]ardness Supreme, 7.2 Years
 
rogue_jedi is offline
Quote:
Originally Posted by moetop
Bah.. trying to have some fun and do this in VM ware just to practice before I destroy some real hardware.. Almost there.. Just having some mount and extract confusion on my part. I mounted the harddrive to /mnt/system, but when I extract the files they dont show up there. Well Im off to bed for now, but Ill start crackin at it tomorrow again.
are you sure that vmware has a writeable disk image? that's all i can think of (off the top of my head, anyways) i'll edit this if i think of anything else though...

Quote:
In all actuality I will probably run net boot server in a vmware session anyways..
eww... get a dedicated machine. cheaper (hardware-wise) and less prone to breakage. better performing for folding on the server, too. (a dedicated machine, that is)

good luck!
__________________
˙ɹǝʌo ǝɯ uɹnʇ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
  #5  
Old 12-23-2004, 12:50 AM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Yes I think Vmware has a writable disk image if I know what your talking about.

I am already running folding on the machine that will host the VMware linux net boot server, so it's not a waste it's actualy saving me money.. Dont have to build a PC to serve for the net boot. It's basicaly free exept for the 256 Mb ram I set aside. (Out of the 4 gig on my server). All machines running folding will be real PC's. I may test with a few virtual ones, but only as a test..

That would be pretty funny though. I could fire up another dozen boxes Virtualy. Vboxen
__________________
Yo it's Moe
  #6  
Old 12-23-2004, 10:33 AM
unhappy_mage [H]ard|DCer of the Month - October 2005, 5.4 Years
 
unhappy_mage is offline
Quote:
Originally Posted by moetop
Everything is looking really good. I have a disk created, and I have the files actually on the disk it self, but when I do the following commands the files do not show up on the drive I mounted at /mnt/system. It looks like they are extracting, but when it is finished I see nothing anywhere.

cd /mnt/system
tar jtvf /mnt/cdrom/server.tar.bz2

I also tried to put the extract path at the end, but that resulted in an error. I can put things on the /mnt/system , without issue. as a matter of fact I put the server.tar file in there. I also tried from a tmp directory on the boot system (Knoppix)

Is there another tar command I can use to extract explicitly to the /mnt/system mount point?
Let's break it into two parts. We'll decompress the file first, and then untar it.

So, first we run it thru bzip2.
Code:
bzip2 -d < /mnt/cdrom/server.tar.bz2 > /mnt/system/server.tar
And then we untar.
Code:
tar xvf /mnt/system/server.tar -C /mnt/system
This seems like it'll work; it does on my system. I'm not sure that tomsrtbt handles tar options the same way, but I think the knoppix tar should.

With regard to vmware, you may need to set up a bridge (WinXP-style) between your real ethernet adapter and the vmware one. The vmware one is going to be one the 10.0.0.0/8 subnet, and your real one is probably on 192.168.1.0/24, but it's not too hard to set up routing.

Let me know if (when!) you run into more problems. The CD of Ease is coming...
  #7  
Old 12-23-2004, 11:08 AM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Actualy a little more fiddeling and I got it.

I did a "tar xjvf" instead, and all was well.. For some reason it dosent think the partition is bootable. I reboot and it says there is no system disk.. never get's past the POST bootable drive detect. operating system not found error. Looks like the MBR never get's writen.

I've got 4 gig nic's in my server and a routing (layer 3 / Rip V2) 8 port gig switch. In the end I am going to bind a seperate NIC to the VMware session, and vlan it off on my router/switch and set up RIPv2 between the vlans. Let the hardware do the work.

The last couple of steps I get errors.. The 2 Mkdirs dont really matter right, but the lilo error is concerning..
----------------------------------
root@ttyp1[files]# mkdir /mnt/system/foldsave
mkdir: cannot create directory `/mnt/system/foldsave': File exists
root@ttyp1[files]# mkdir /mnt/system/fold
mkdir: cannot create directory `/mnt/system/fold': File exists
root@ttyp1[files]# lilo -C /mnt/system/etc/lilo.conf
control character in variable name at or above line 1 in file '/mnt/system/etc/lilo.conf'
----------------------------------

Heres my export commands. Ignore the Ip address for now ..
----------------------------------
export IP=192.168.1.11
export GW=192.168.1.1
export DNS=24.247.24.53
export MBR=/dev/sda1
export DISK=/dev/sda1
export SWAP=/dev/sda5
----------------------------------
Sda1 in my primary partition, and Sda5 in the swap.
__________________
Yo it's Moe
  #8  
Old 12-23-2004, 11:16 AM
rogue_jedi [H]ardness Supreme, 7.2 Years
 
rogue_jedi is offline
post your lilo.conf so we can debug it please...

and with the mkdirs failing, that's not really a big problem as long as there are directories under that name there. doesn't matter how they get there.
__________________
˙ɹǝʌo ǝɯ uɹnʇ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
  #9  
Old 12-23-2004, 11:27 AM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Ya I was pretty sure the mkdirs were totaly irrelevent.

Here's the lilo.conf

-------------------------------
boot=/dev/$MBR
vga=normal
prompt
timeout=50
append = "hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=sc
si apm=power-off nomce noapic"

image=/boot/linux24
label=dsl
root=/dev/$DISK
read-only
append = " toram"
------------------------------

Should I just edit the lilo.conf and put sda1 instead of the varriable??

Actualy Im going to go give tha a try..
__________________
Yo it's Moe
  #10  
Old 12-23-2004, 11:36 AM
rogue_jedi [H]ardness Supreme, 7.2 Years
 
rogue_jedi is offline
yeah, it appears that lilo doesn't like variables. just put sda1 in instead of them ($MBR and $DISK) and it should be alright.

just checking here: is there a linebreak between lines 5/6 there, or is that just from copy-pasting? if there is - remove it. that'll break stuff most likely.
__________________
˙ɹǝʌo ǝɯ uɹnʇ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
  #11  
Old 12-23-2004, 11:45 AM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Yes the space was in there. I did not do it myself.
I added sda1 in place of tha varriable, and am now getting the following error. Looks like Knoppix is missing something, as well as trying to write something to a directory on the CD..

-----------------------------
root@ttyp1[files]# lilo -C /mnt/system/etc/lilo.conf
/dev/mapper/control: open failed: No such device
Is device-mapper driver missing from kernel?
/dev/mapper/control: open failed: No such device
Is device-mapper driver missing from kernel?
Incompatible libdevmapper 1.00.19-ioctl (2004-07-03)(compat) and kernel driver
Fatal: creat /boot/boot.0800: Read-only file system
root@ttyp1[files]#
------------------------------

Here is the new lilo.conf

------------------------------
root@ttyp1[files]# more /mnt/system/etc/lilo.conf
------------------------------
boot=/dev/sda1
vga=normal
prompt
timeout=50
append = "hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi apm=power-off nomce noapic"
image=/boot/linux24
label=dsl
root=/dev/$DISK
read-only
append = " toram"

----------------------------
root@ttyp1[files]#
----------------------------
__________________
Yo it's Moe
  #12  
Old 12-23-2004, 11:46 AM
rogue_jedi [H]ardness Supreme, 7.2 Years
 
rogue_jedi is offline
change $DISK too.
__________________
˙ɹǝʌo ǝɯ uɹnʇ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
  #13  
Old 12-23-2004, 11:50 AM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Same new error even with disk changed.. Srry did an Edit on you in previous post after you responded..

-----------------------------------------
root@ttyp1[files]# lilo -C /mnt/system/etc/lilo.conf
/dev/mapper/control: open failed: No such device
Is device-mapper driver missing from kernel?
/dev/mapper/control: open failed: No such device
Is device-mapper driver missing from kernel?
Incompatible libdevmapper 1.00.19-ioctl (2004-07-03)(compat) and kernel driver
Fatal: creat /boot/boot.0800: Read-only file system
root@ttyp1[files]# more /mnt/system/etc/lilo.conf
boot=/dev/sda1
vga=normal
prompt
timeout=50
append = "hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi apm=power-off nomce noapic"
image=/boot/linux24
label=dsl
root=/dev/sda1
read-only
append = " toram"
---------------------------------------

Last edited by moetop; 12-23-2004 at 11:57 AM..
__________________
Yo it's Moe
  #14  
Old 12-23-2004, 12:49 PM
unhappy_mage [H]ard|DCer of the Month - October 2005, 5.4 Years
 
unhappy_mage is offline
Okay, a couple possible solutions to the lilo problem.

1) mkdir /dev/mapper (may exist already...)
mknod /dev/mapper/control c 10 63
try lilo again.

2) Try removing the device-mapper module. Do an lsmod and see if it shows up, then try removing it.

3) make sure that /mnt/system/boot isn't mounted read-only. It looks like it is... can you `touch` a new file on that partition? If it's read-only, do mount -o remount,rw /mnt/system/boot.

Lastly, can you include the contents of /tmp/sub.sed? It should not have any $s in it, just the values of the variables (so it should start s/@@IP@@/10.3.5.7/; or something similar).
  #15  
Old 12-23-2004, 01:26 PM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Ok

The /dev/mapper was already there, but I nuked it and readded it using mknod /dev/mapper/control c 10 63

There was no device mapper.

--------------------------
root@ttyp2[mapper]# lsmod
Module Size Used by Not tainted
autofs4 8756 1
af_packet 13544 0 (autoclean)
agpgart 42724 0 (unused)
es1371 30120 1
gameport 1388 0 [es1371]
ac97_codec 11916 0 [es1371]
soundcore 3428 4 [es1371]
pcnet32 17188 1
mii 2240 0 [pcnet32]
crc32 2816 0 [pcnet32]
serial 52100 0 (autoclean)
pcmcia_core 39840 0
thermal 6724 0 (unused)
processor 9008 0 [thermal]
fan 1600 0 (unused)
button 2700 0 (unused)
battery 5952 0
ac 1824 0
rtc 7036 0 (autoclean)
cloop 8740 2
ieee1394 183076 0
usb-storage 61760 0 (unused)
usb-uhci 21644 0 (unused)
usbcore 57600 1 [usb-storage usb-uhci]
ataraid 6180 0
BusLogic 83388 1
ide-scsi 8816 1
---------------------------------


The /mnt/system/boot can be writen to (I copyed a file to it) but the /boot/ directory can not (knoppix cd makes it readonly) it looks like it is trying to change the /boot on the knoppix disk and NOT the /mnt/system/boot disk

For some reason the sub.sed was screwed, but I manualy fixed it. Here is the new one.

--------------------------------
root@ttyp1[tmp]# more sub.sed
s/@@IP@@/162.48.1.11/;
s/@@GW@@/162.48.1.1/;
s/@@DNS@@/24.247.24.53/;
s/@@DISK@@/sda1/;
s/@@SWAP@@/sda5/;
s/@@MBR@@/sda1/;
--------------------------------

Still didnt work after that..


on a whim I also changed the lilo.conf to reflect the MNT piont. Still no go.

--------------------------------
root@ttyp1[etc]# more lilo.conf
boot=/dev/sda1
vga=normal
prompt
timeout=50
append = "hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=sc
si apm=power-off nomce noapic"
image=/mnt/system/boot/linux24
label=dsl
root=/dev/sda1
read-only
append = " toram"
------------------------------
__________________
Yo it's Moe
  #16  
Old 12-23-2004, 03:02 PM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Ahhhh ha!!!!

root@ttyp1[files]# lilo -C /mnt/system/etc/lilo.conf -M /dev/sda mbr -s /mnt/system/boot
Backup copy of /dev/sda in /mnt/system/boot/boot.0800
The Master Boot Record of /dev/sda has been updated.

Gonna give it a try now
__________________
Yo it's Moe
  #17  
Old 12-23-2004, 03:33 PM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
Well it doesent get any closer than this..

I no longer getting an error when running Lilo using the command "lilo -C /mnt/system/etc/lilo.conf -M /dev/sda mbr -s /mnt/system/boot" I get no errors and it looks like it wrote it. For boot in my lilo.conf I have used both sda and sda1 no diffrence.
-------------------------
boot=/dev/sda1
vga=normal
prompt
timeout=50
append = "hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=sc
si apm=power-off nomce noapic"
image=/mnt/system/boot/linux24
label=dsl
root=/dev/sda1
read-only
append = " toram"
-------------------------

I am getting a diffrent error on boot up now.. It says

No boot signature in partition
Opperating system not found

I am so close I can taste it.!!
Any ideas?
__________________
Yo it's Moe
  #18  
Old 12-23-2004, 03:51 PM
unhappy_mage [H]ard|DCer of the Month - October 2005, 5.4 Years
 
unhappy_mage is offline
Try an fdisk -l /dev/sda and see if any partitions are marked active. Also try taking out all the "hdx=scsi" things in the append= line. The image= line should probably be /boot/linux24, because that's where it will eventually be when it boots for real.

Then do:
Code:
lilo -M /dev/sda mbr              // write the MBR
lilo -C /mnt/system/etc/lilo.conf -s /mnt/system/boot -A /dev/sda1   // write the boot sector to sda1
  #19  
Old 12-23-2004, 04:14 PM
moetop [H]ard|Gawd, 5.6 Years
 
moetop is offline
What fdisk and the commands looks like..

-------------------------------------
root@ttyp1[etc]# fdisk -l /dev/sda

Disk /dev/sda: 1073 MB, 1073741824 bytes
128 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 256 524272 6 FAT16
/dev/sda2 257 512 524288 5 Extended
/dev/sda5 257 512 524272 6 FAT16


root@ttyp1[etc]# lilo -M /dev/sda mbr -s /mnt/system/boot
/mnt/system/boot/boot.0800 exists - no /dev/sda backup copy made.
The Master Boot Record of /dev/sda has been updated.
root@ttyp1[etc]# lilo -C /mnt/system/etc/lilo.conf -s /mnt/system/boot -A /dev/sda
/dev/sda1
root@ttyp1[etc]# more /mnt/system/etc/lilo.conf
boot=/dev/sda1
vga=normal
prompt
timeout=50
append = "apm=power-off nomce noapic"
image=/boot/linux24
label=dsl
root=/dev/sda1
read-only
append = " toram"
-------------------------------------

Dam It did not work.. Is that the right file system? fat16 I thought that it was supposed to be converted..

Last edited by moetop; 12-23-2004 at 04:20 PM..
__________________
Yo it's Moe
  #20  
Old 12-23-2004, 04:26 PM
rogue_jedi [H]ardness Supreme, 7.2 Years
 
rogue_jedi is offline
the filesystem should be of type 'linux'

hit 't' '1' '82' in fdisk to change it.

then, 't' '5' '83' to make the swap partition.

unhappy_mage says he's sorry he forgot to mention that. he'll never do it again (until next time, anyway)
__________________
˙ɹǝʌo ǝɯ uɹnʇ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:58 PM.


Valid XHTML 1.0 Transitional

Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2000 - 2009 KB Networks, Inc.