LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-29-2006, 09:57 AM   #1
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
How I did it: diskless netboot with Debian Etch


How-To to make a diskless Debian Etch workstation

This how-to is based on the following Ubuntu how-to:

https://help.ubuntu.com/community/DisklessUbuntuHowto

When I tried using the above how-to with Debian Etch, there were a number of things which didn't work, and there were a number of things which weren't explained. In any case, this is how I figured out how to do it.

This how-to assumes the client and server are already set up with Debian Etch, with the client set up on a single root partition. In this example, 192.168.1.4 is the server, while 192.168.1.1 is the router. You'll want to change these numbers for your own server and router.

--------------------------------------------
0. Install server packages

Install the following packages on the server:
Code:
apt-get install dhcp3-server
apt-get install tftp-hpa
apt-get install syslinux
apt-get install nfs-kernel-server
apt-get install initramfs-tools

apt-get install pxe
apt-get install atftpd
I'm not sure if pxe and atftpd need to be installed; they weren't in the Ubuntu How-To this is based on. I installed them in the process of trying to get stuff to work.

--------------------------------------------
1. Set up tftp boot

Create the /tftpboot and start populating it with something like:
Code:
mkdir -p /tftpboot/pxelinux.cfg
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
cp /boot/vmlinuz-2.6.15-1-486 /tftpboot/
Replace vmlinuz-2.6.16-1-486 with the kernel you're using.

Configure the tftp service to provide access to /tftpboot by editing /etc/inetd.conf. Make sure the line starting with "tftp" ends with "/tftpboot". It should look something like:
Code:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tft pd /tftpboot
Restart the tftp service with:
Code:
/etc/init.d/inetd restart
Create a net-bootable initrd image with:
Code:
cd /etc/initramfs-tools/
cp initramfs.conf initramfs.conf.originalbackup
vi initramfs.conf
mkinitramfs -o initrd.img.netboot
mv initrd.img.netboot /tftpboot/
When editing initramfs.conf, you want to change the BOOT line from "BOOT=local" to "BOOT=nfs". After creating this image, you may change the BOOT line back to local.

Create a PXE config file /tftpboot/pxelinux.cfg/default. If you know the workstation's MAC address, name the file 01-aa-bb-cc-dd-ee-ff where aabbccddeeff is the MAC address. (You'll need to name the files like this or by IP address in hex if you're setting up more than one diskless workstation.) Here's an example:
Code:
LABEL linux
KERNEL vmlinuz-2.6.15-1-486
APPEND root=/dev/nfs initrd=initrd.img.netboot nfsroot=192.168.1.4:/mnt/hda5/yuki ip=dhcp rw
You'll want to put your server's IP address in and your desired location of the workstation's OS.

--------------------------------------------
2. Set up DHCP

First, deactivate any DHCP service on your router or other server. Then configure DHCP service on your server with:

Code:
vi /etc/dhcp3/dhcpd.conf
/etc/init.d/dhcp3-server restart
Make sure to include this line at the top:
Code:
next-server 192.168.1.4;
Without this line, the client will hang on trying to load the pxe config file.

You'll need to insert lines to the file to configure assigned addresses. This entry will set up dynamic addresses:
Code:
default-lease-time 600;
max-lease-time 7200;

option domain-name "xephon";
option domain-name-servers 192.168.1.1, 192.0.0.1, 194.2.0.50;
option routers 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.99;
  filename "/tftpboot/pxelinux.0";
}
This entry will set up a static address. You'll need to know the MAC address--for example, by booting up a liveCD and running "ifconfig -a" as root.
Code:
host yuki {
  hardware ethernet 00:14:2a:ef:ea:07;
  fixed-address yuki.xephon;
  filename "/tftpboot/pxelinux.0";
}
Note that this assumes the address of yuki.xephon is defined in /etc/hosts. You can replace it with a numerical IP address.


--------------------------------------------
3. Set up nfs

Create the nfs share on the server with:
Code:
mkdir /mnt/hda5/yuki
vi /etc/exports
exportfs -rv
When editing /etc/exports, you want to create this entry:
Code:
/mnt/hda5/yuki yuki.xephon(rw,async,no_root_squash)
Note that this assumes the address of yuki.xephon is defined in /etc/hosts. You can replace this with a numerical IP address. You can also replace it with "*" if you don't mind any machine on the LAN to have access.

Copy over the files by running the following ON THE CLIENT:
Code:
mkdir /mnt/yuki
mount -tnfs -onolock 192.168.1.4:/mnt/hda5/yuki /mnt/yuki
cp -axv /. /mnt/yuki/.
cp -axv /dev/. /mnt/yuki/dev/.
Now, back on the server, modify the files to make them suitable for diskless netbooting. Edit /mnt/hda5/yuki/etc/network/interfaces and comment out any lines which automatically bring up eth0 (like "auto eth0" or "allow-hotplug eth0"). Just leave a line like "iface eth0 inet dhcp". The network interface eth0 will have already been brought up by net-booting, and we don't want to reset it.

Edit /mnt/hda5/yuki/etc/fstab to look something like this:
Code:
###/dev/hda1       /               ext3    noatime,errors=remount-ro 0       1
###/dev/hda5       /mnt/hda5       ext3    noatime         0       2
###/dev/hda6       none            swap    sw              0       0

/dev/nfs        /               nfs     defaults 0 0
none            /tmp            tmpfs   defaults 0 0
none            /var/run        tmpfs   defaults 0 0
none            /var/lock       tmpfs   defaults 0 0
none            /var/tmp        tmpfs   defaults 0 0
none            /media          tmpfs   defaults 0 0
Comment out any local partitions including swap.

--------------------------------------------
4. Configure BIOS

On the client workstation, boot up and enter setup to turn on PXE LAN boot. If you don't have this option, then you may have to set up a boot floppy or something (look elsewhere for help figuring this out). Then reboot, and see if everything works!

--------------------------------------------
Setting up more workstations

If you want to set up more than one workstation, you'll need to know the MAC addresses of them all. You can find it out by logging on as root and running "ifconfig -a" (on Debian systems). Then:

1. Create a new PXE config file /tftpboot/pxelinux.cfg/01-aa-bb-cc-dd-ee-ff where aabbccddeeff is the MAC address (use lowercase).

2. Create a new entry in /etc/dhcp3/dhcpd.conf for the new MAC address. Don't forget to restart the DHCP server with "/etc/init.d/dhcp3-server restart"

3. Create the new nfs shared directory and populate it. Create a new entry in /etc/exports as appropriate. Don't forget to resync the exports with "exportfs -rv"

4. Configure the BIOS on the client for LAN boot.

For creating the new workstation's directory, you can copy from an existing one and just edit /mnt/hda5/newworkstation/etc/hostname to change the hostname.
 
Old 07-30-2006, 12:26 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
How about entering this into the LQ Wiki for everyone to share?
 
Old 08-01-2006, 09:58 AM   #3
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546

Original Poster
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Okay, I've tried converting this How-To into a LQ Wiki entry: http://wiki.linuxquestions.org/wiki/...ss_Workstation

So...well, I don't really know whether I put it in the right place or if the format is okay. Is there anything I should change/edit?

Thanks!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian Etch. Theoretic Debian 14 08-08-2006 06:00 PM
Completing Inslaltion of Debian from Netboot ISO Sader Debian 5 11-29-2005 11:49 PM
which one to d/l for debian etch? greythorne Debian 8 07-27-2005 02:25 AM
Diskless boot problems - Netboot error 35 (Timeout) Decoy^3 Linux - Networking 5 01-14-2004 12:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration