NetBoot from an unRAID?


Recommended Posts

How hard would it be to Netboot off of an unRAID box. It looks like I need a TFTP server that will respond to requests, not sure what else. Is there any reason why this wouldn't or couldn't be done off of an unRAID? Still learning about what exactly is needed but I'd be interested in thoughts.

 

duh just found this -> http://lime-technology.com/forum/index.php?topic=828.0 So tftpd is included already, guess I need to figure out what else is needed and give it a whirl. If anyone is doing this I'm all ears!

Link to comment

I don't know much (read: anything), but I looked into this a little when I was looking at LinuxMCE a while back.  I think there is also a requirement regarding the DHCP server.  I think I remember something about a specially formed dhcp request, and the dhcp server has to forward properly forward the request to the TFTP server.  This is not simply a port forward, and most off-the-shelf routers cannot do this.  If you're using a linux machine that is doing your dhcp, I think it's supposed to be pretty easy.  I'd assume that if you're using a server-type OS to do your routing, that would work too.

 

LinuxMCE can do network booking for diskless HTPC clients (its Media Directors).  However, because most routers can't process these requests correctly, the LinuxMCE core needs to be the dhcp server on the network to be able to do this.

Link to comment

he LinuxMCE core needs to be the dhcp server on the network to be able to do this.

 

This is correct, the linux machine or unRaid would need to be the DHCP Server for the network

 

Here's a chunk example from my linux machine (overlord) /etc/dhcpd.conf file

 

host unraid.cotrone.com {
    hardware ethernet 00:30:18:ab:f0:37;        # Jetway 1GB
    fixed-address 192.168.1.178;
    option routers 192.168.1.1, 192.168.1.254;
    option domain-name-servers 192.168.1.252;
    option domain-name "cotrone.com";
    filename "pxelinux.0";
}

 

 

Overlord has the dhcp server and tftpd.

in the /var/tftpboot folder I have the following

 

[root@overlord etc]# cd /var/tftpboot/
[root@overlord tftpboot]# ls -l
total 1980
drwxr-xr-x  3 root sysadmin    4096 May 30  2004 boot
-rw-rw-r--  1 root sysadmin     164 Jun  2  2004 BOOTMSG.TXT
lrwxrwxrwx  1 root sysadmin      20 Mar  4  2006 default -> pxelinux.cfg/default
drwxr-xr-x  2 root root        4096 Jan  8 17:24 image
drwxrwxr-x  2 root sysadmin    4096 Jan 12 18:58 images
-r--r--r--  1 root sysadmin  365509 May 29  2004 initrd.img
-rw-rw-r--  1 root sysadmin   20056 Dec 30 12:35 memdisk
-r--r--r--  1 root sysadmin   14848 Jul 27  2002 memdisk-1.75
-rwxr-xr--  1 root sysadmin   14336 Dec 30 13:47 memdisk-2.0
-rw-rw-r--  1 root sysadmin   20056 Dec 30 12:35 memdisk-3.50
-r--r--r--  1 root sysadmin   14848 Jul 27  2002 memdisk.bak
-rw-rw-r--  1 root sysadmin      30 Jun  2  2004 memdisk.cfg
-r--r--r--  1 root sysadmin  123104 Jun  2  2004 nbgrub
-rw-rw-r--  1 root sysadmin    1637 Jan 12 19:05 options.txt
-r--r--r--  1 root sysadmin  124128 Jun  2  2004 pxeboot.test
-r--r--r--  1 root sysadmin  124128 May 30  2004 pxegrub
-rw-rw-r--  1 root sysadmin   13940 Dec 30 12:35 pxelinux.0
-r--r--r--  1 root sysadmin   10052 Jul 27  2002 pxelinux.0-1.75
-rw-r--r--  1 root sysadmin   10820 Dec 30 13:47 pxelinux.0-2.0
-rw-rw-r--  1 root sysadmin   13940 Dec 30 12:35 pxelinux.0-3.50
-r--r--r--  1 root sysadmin   10052 Jul 27  2002 pxelinux.0.bak
-rw-r--r--  1 root sysadmin   13940 Dec 30 12:35 pxelinux.bin
-rw-r--r--  1 root sysadmin   13940 Dec 30 12:35 pxelinux.bin-3.50
drwxrwxr-x  2 root sysadmin    4096 May 26  2007 pxelinux.cfg
-r--r--r--  1 root sysadmin    1536 May 30  2004 pxeloader
-r--r--r--  1 root sysadmin 1030147 May 29  2004 vmlinuz
[root@overlord tftpboot]# 

Note there are many duplicates and versioned files.

 

In my images folder I have the following floppy boot images

 

[root@overlord tftpboot]# cd images
[root@overlord images]# ls -l
total 106544
-r--r--r--  1 root     sysadmin 2533465 Jan 31  2006 centos-3.6-initrd.img
-r--r--r--  1 root     sysadmin  900113 Jan 31  2006 centos-3.6-vmlinuz
-rw-r--r--  1 rcotrone users    5482335 Jan 12 18:50 centos-5.1-initrd.img
-rw-r--r--  1 rcotrone users    1844028 Jan 12 18:50 centos-5.1-vmlinuz
-rw-r--r--  1 root     sysadmin 5482335 Jan 12 18:50 centos-5.1-x86_64-initrd.img
-rw-r--r--  1 root     sysadmin 1844028 Jan 12 18:50 centos-5.1-x86_64-vmlinuz
-rw-r--r--  1 root     sysadmin 4916737 Apr 10  2007 centos5-initrd.img
-rw-r--r--  1 root     sysadmin 1765428 Apr 10  2007 centos5-vmlinuz
-rw-r--r--  1 root     sysadmin 1474560 May 27  2006 dban.img
-rw-r--r--  1 root     sysadmin 1474560 May 26  2006 dft32_v406_b00.img
-r--r--r--  1 root     sysadmin 2949120 Jul 29  2002 di20-288.img
-r--r--r--  1 root     sysadmin 1474560 Oct 18  2003 dosfs-netboot.img
-r--r--r--  1 root     sysadmin 2949120 Jul 29  2002 dw603-288.img
-r--r--r--  1 root     sysadmin 1474560 Jan  6  2003 gatekeeper.img
-r--r--r--  1 root     sysadmin 1474560 Jul 29  2002 ghost.img
-rw-r--r--  1 root     sysadmin 1474560 Jun  2  2004 grubboot.img
-rw-r--r--  1 root     sysadmin 1474560 May 11  2006 grub.img
-rw-r--r--  1 root     sysadmin 1474560 Mar  2  2003 grub.img.bak
-rw-r--r--  1 root     sysadmin 1474560 Jun  2  2004 grubnew.img
-rw-r--r--  1 root     sysadmin 1474560 Jul 27  2002 grub-old.img
-r--r--r--  1 root     sysadmin 2698200 Jan  7  2004 initrd-everything.img
-rw-r--r--  1 root     sysadmin 4916737 Apr 10  2007 initrd.img
-r--r--r--  1 root     sysadmin 1474560 Mar  8  2003 linux-hercules.img
-r--r--r--  1 root     sysadmin 1474560 Oct 28  2005 memt86-3.2.img
-r--r--r--  1 root     sysadmin 1474560 Oct  4  2003 memt86.img
-rw-r--r--  1 root     sysadmin  933888 May 24  2006 pcplus.img
-r--r--r--  1 root     sysadmin 1474560 Oct  4  2003 pcpro.img
-r--r--r--  1 root     sysadmin 2949120 Jul 29  2002 pm50-288.img
-r--r--r--  1 root     sysadmin 2949120 Nov 24  2003 pm80-288.img
-rw-rw-r--  1 root     sysadmin 1474560 Nov  5  2005 powermax.img
-r--r--r--  1 root     sysadmin   17863 Aug  1  1997 rawrite2.exe
-r--r--r--  1 root     sysadmin 1474560 Nov  5  2005 scsimax.img
-rw-r--r--  1 root     sysadmin 1474560 May 26  2006 seatools.img
-r--r--r--  1 root     sysadmin 1474560 Jul 29  2002 spinrite.img
-r--r--r--  1 root     sysadmin 1474560 May 16  2004 syslinux-2.4.18-3.img
-rw-r--r--  1 root     sysadmin 2949120 May 27  2004 syslinux-2.4.18-3smp.img
-rw-r--r--  1 root     sysadmin 2949120 May 26  2006 syslinux-2.4.22-dev.img
-rw-r--r--  1 root     sysadmin 1474560 Nov 26  2005 syslinux-2.4.31.img
-rw-r--r--  1 root     sysadmin 2949120 May 26  2004 syslinux-288.img
-rw-r--r--  1 root     sysadmin 2949120 May 30  2004 test.img
-rw-r--r--  1 root     sysadmin 2949120 May 29  2004 test.img.bak
-rw-r--r--  1 root     sysadmin 1765428 Apr 10  2007 vmlinuz
-r--r--r--  1 root     sysadmin 1474560 Oct  4  2003 win2k.img
-r--r--r--  1 root     sysadmin 1474560 Jun 13  2006 win98-bios-asus.img
-r--r--r--  1 rcotrone sysadmin 1474560 May 24  2006 win98-bios-x5dal.img
-r--r--r--  1 root     sysadmin 2949120 Jul 27  2002 win98se-288.img
-r--r--r--  1 root     sysadmin 1474560 Dec  7  2003 win98se-bios.img
-r--r--r--  1 root     sysadmin 1474560 May 24  2006 win98se-bios-x5dal.img
-r--r--r--  1 root     sysadmin 1474560 Jul 27  2002 win98se.img
-r--r--r--  1 root     sysadmin 1474560 Nov  5  2005 win98se-scsimax.img
-r--r--r--  1 root     sysadmin 2949120 Oct 21  2006 win98se-usb.img
-rw-r--r--  1 root     sysadmin 1474560 Oct 21  2006 windows98-startup.img
[root@overlord images]# 

 

So as a possibility it exists,

You would have the kernel and init ram disk on the network server.

You still need a flash drive on the machine to store the /boot folder.

 

So I'm not sure if this effort is totally worthwhile unless you want speed or your motherboard does not support booting from USB.

 

Frankly a kicker floppy might be easier.

 

I have allot of experience with PXEBOOT so feel free to ask questions.

 

You will need the tools pxelinux and memdisk from here http://syslinux.zytor.com/

 

 

 

 

 

Link to comment

Ouch, was afraid it would be less than simple. My router is a Linksys running 3rd party firmware - DD-WRT. Looking at the interface I have some options for modifying the DHCP daemon's behavior but I'm not sure to this extent. I do not feel like setting up another server, especially since this one has plenty of mods for static IPs based on MAC for some of my hardware...

Link to comment

It's not that hard.

There are only a few things to set up.

 

DHCPD

A segment in dhcpd

PXELINUX

MEMDISK

and a boot image.

 

My extensive list shows how many different boot images I have.

 

I have all sorts of boot floppies for bios updates, partition magic, ghost, DOS, windows, grub, and various other linux boot disks.

I created them years ago when I removed the floppies from all my machines.

The point was to show you what you can do, you only need the boot images you'll use.

 

That being said, I still say, a floppy disk with the proper drivers would be better in this case.

 

If you were willing to give up an IDE port you can use a compact flash adapter on an IDE port and have speed too!

 

I've found special compact flash adapters that are brackets where PCI cards go.

On the inside it connects to an IDE port.  This lets you pull it out and update it as needed.

 

Under any of the circumstances you still need a flash drive (I believe).

 

I wonder if you can get a GUID off a compact flash adapter on the IDE port... Hmmmmmmmmmmm

 

 

 

 

 

 

Link to comment

Well, my thought here was to netboot Ubuntu with XBMC onboard, thus removing the laptop drive from my HTPC. I do already have a CF to IDE adapter in my desk drawer - spotted one CHEAP on eBay and couldn't resist. Shortly after purchase I spotted the dual C/F to IDE adapters - doh! Anyway, I certainly have lots of options but was curious as to how this might be done after it was suggested on the XBMC forums. No one has tried it yet and I knew little about it - wasn't sure if there was something I could run on unRAID to facilitate it. I do like the idea of being able to choose from boot floppy images etc. though at startup - hrm! Might be a good way to go with an image of my Acronis boot CD for backups, wouldn't have to worry about digging it up anymore. ;D

Link to comment

OK, I misunderstood a piece of this, however I've provided plenty of food for thought in the process.

 

In any case, having unRaid be a PXEBOOT server is quite possible.

It just means it has to be the DHCP server also.

 

This way you put all your mac definitions and IP addresses in the DHCP server config.

 

Come to think of it, if you have direct editable access to the router's dhcpd.conf file, you can add the respective code,

However, I'm not sure if you can direct the "filename "pxelinux.0";" option to another host.

 

If that is possible, then having unRaid only serve PXELINUX and the respective MEMDISK images would work.

 

 

 

 

Link to comment

Hmm, seems to be an option called NEXT-SERVER

 

The next-server statement

next-server server-name;

The next-server statement is used to specify the host address of the server from which the initial boot file (specified in the filename statement) is to be loaded. Server-name should be a numeric IP address or a domain name. If no next-server parameter applies to a given client, the DHCP server's IP address is used. 

 

So if you can get to the /etc/dhcpd.conf file on your router, then it's possible to store the images on unRaid.

 

http://www.fifi.org/cgi-bin/man2html/usr/share/man/man5/dhcpd.conf.5.gz

 

 

 

Link to comment

I can get into /etc but there's no dhcpd.conf file - weird! I admit I've not often dug into my router at the command prompt and I could probably use a software upgrade on it but hey it's working :P DD-WRT is good stuff but I'm going to have to poke around some. The WEB interface DOES allow me to pass commandline options to the DHCP daemon though - hrm!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.