Chit chat

=======

Finally started putting back together my desktop. so I can get off a borrowed laptop.

This weekend is for building electeronic stuff.

—————————————————————–

Just a few notes about doing an http based linux install.

 

Linux Debian is kind of taking of the reigns of being one of the most popular linux distros. Like installing any operating system the traditional way, you can run into roadblocks.  For example, you may not be able to burn a linux cd, the machine you want to load linux on has a broken cd/dvd rom, or a host of other reasons. What we are about to do is what is known as pxeboot networking. Another words we will use a web server to get us started with a linux install on a system. Traditionally you actually had to have several servers to do the network install. You had to modify a Dhcp (Ipaddress servers) server,  a Tftp (boot files) server, and among other systems which general required a lot of setup and the blessing of the system administrator,

Tried this with the python web server, but you have to have all the files in one directory from what I could see.  I just did not want to take the time to do it.

$ python -m SimpleHTTPServer

I went ahead and used the Apache2 web server. You can get portable versions of the Apache2 web server so that there is not much to install. But before I get ahead of myself, we need a way to boot the target computer to access the network.

Etherboot led the way in this direction and had now graduated to Ipxe. (more information at http://www.etherboot.org). So we need to make a boot disk for the computer we want to install linux on. You have severaal choices. For our purposes a floppy will be used. You can also use a cd/dvd rom disk and or a very small usb stick. We need to go to http://www.romomatic.org to create the boot media for our system.

We chose the floppy disk. Now even though we can use the floppy disk to access the network, we need to add a short script to let the floppy know about the web server we want to use. in our case the script was for oeorgan1 using the debian in /var/www directory. The script is pretty standard so all we had to do was to change one line of the script.

#!gpxe
echo Performing DHCP on first network interface
dhcp net0
set 209:string pxelinux.cfg/default
set 210:string http://oeorgan1/debian/
chain ${210:string}pxelinux.0

You will press the customization button to get the text box where to enter the script. If the script is ok, the you want to save it to your existing system.  It is usually saved as a very long name so I use the gui to rename it to test.dsk.

Now we need to get the image written to the floppy and that is pretty easy,

$ sudo dd if=test.dsk of=/dev/fd0

Note: on newer systems it might be something like:

$ sudo dd if=gpxe-1.0.1+-gpxe.dsk of=/dev/sdb

The client machine is ready to go, so now let us look at the server. You probably want to make a special directory such as debian in your document root. /var/www/.

$ sudo mkdir debian
$ cd debian

Now that we have a place to store the files we need to download them. Remember we will not have to burn a dvd. Here is where the files are, so all you have to do is download them directly to your web server,

$ sudo wget http://debian.linuxmint.com/incoming/dists/testing/main/installer- i386/current/images/netboot/netboot.tar.gz

The we need to expand the archive in the /var/www/debian directory.

$ tar zxvf netboot.tar.gz

Then you also need to get the cdrom image file for your system. In this case we are going for the i386 version,

$ wget http://ftp.nl.debian.org/debian/dists/wheezy/main/installer-i386/current/images/netboot/mini.iso

That is all you need! Make sure your apache2 web server is running though.

$ sudo service apache2 status

Apache is running (pid 12345)

Now it is time to boot up your client machine with the floppy media!

 

In just a few seconds you should get the install menu. Now the rest of the install should come from the internet. That is another article. We have our server set up to support several linux distros. i.e. Debian, Mint,  Ubuntu, and others. Using a standard boot media, there is.no need to burn new cd’s every time a new version of linux comes out.  Have fun!

Even if your computer does not have a floppy drive you can get a usb floppy drive fairly cheap. Since the data on the floppy is so small, it should not take long to load even with a usb floppy drive.. For mass installs we recommend the cobbler, drbd/clonezilla, or as a last resort the Fog software. I will talk about them later.  Last but not least you can also use this method to install MSWindows systems.

 

Arch Linux Netboot Live System

The Arch Linux netboot environment allows booting Arch Linux live media directly over the network. It will boot into a menu where you can choose from a list of available mirrors. The image will be downloaded into memory.
Requirements: A computer that connects to the internet via LAN and DHCP.
If your ethernet NIC is not supported by iPXE, you must use your NIC’s netboot capabilities. This is only possible if you select “Boot from network” in the BIOS and configure your DHCP server to load the PXE image provided below. In this case, the UNDI driver will be used for downloads until Linux is booted. The first stage of the download can be extremely slow.

Test netboot with qemu

Download an iPXE kernel image.

Run qemu with the kernel image:

qemu -m 1G -kernel ipxe.lkrn

Boot with any Linux bootloader

Download an iPXE kernel image to /boot.

Add the image to your bootloader configuration:
GRUB 2:

menuentry 'Arch Linux Netboot Environment' {
  set root='(hd0,1)'
  linux16 /ipxe.lkrn
}

Syslinux:

LABEL archnetboot
MENU LABEL Arch Linux Netboot Environment
KERNEL /ipxe.lkrn

GRUB Legacy:

title Arch Linux Netboot Environment
    kernel (hd0,0)/ipxe.lkrn

Boot from USB

Install a bootloader (e.g. GRUB or syslinux) onto the USB drive and use the .lkrn file as described above.

Boot from Floppy

Download an iPXE floppy image.

Write the image to your floppy:

dd if=ipxe.dsk of=/dev/fd0

Boot from CD

Download an iPXE ISO image and write it to a CD.

Boot from the network   (from the Arch documentation)

There are two ways to do this:

Using an iPXE image

Download an iPXE PXE image into your TFTP root.

Set the PXE filename to ipxe.pxe (using the filename option in dhcpd or the -M option in dnsmasq).
This method is recommended, as it will always work – if iPXE lacks a native NIC driver, the UNDI driver will be used.

Flashing your boot ROM

You can build a custom iPXE images and flash it to your boot ROM. You must include one of the following iPXE scripts:

If you do this, your computer will always boot the Arch netboot environment when you netboot your computer.

 

Been spending time looking at booting systems to the net to install linux operating systems. So far we have looked at Arch and Debian based systems. Both Fedora and Centos have pre-made iso’s for network install.

Centos:

http://www.centos.org/download/

Fedora:

http://fedoraproject.org/en/get-fedora

But if you want to roll your own, here are some scripts to look at:

Fedora

#!ipxe
dhcp any
# Set source URI
set mirror http://download.fedoraproject.org/pub/fedora/linux/releases/20

# Detect CPU architecture and calculate repository URI
set arch i386
set repo ${mirror}/Fedora/${arch}/os

# Start installer
kernel ${repo}/images/pxeboot/vmlinuz initrd=initrd.img repo=${repo}
initrd ${repo}/images/pxeboot/initrd.img
boot

or

#!ipxe
dhcp any
# Set source URI
set mirror http://download.fedoraproject.org/pub/fedora/linux/releases/18

# Detect CPU architecture and calculate repository URI
cpuid –ext 29 && set arch x86_64 || set arch i386
set repo ${mirror}/Fedora/${arch}/os

# Start installer
kernel ${repo}/images/pxeboot/vmlinuz initrd=initrd.img repo=${repo}
initrd ${repo}/images/pxeboot/initrd.img
boot

or older releases

#!ipxe
dhcp any
# Set source URI
set mirror http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/14

# Detect CPU architecture and calculate repository URI
set arch i386
set repo ${mirror}/Fedora/${arch}/os

# Start installer
kernel ${repo}/images/pxeboot/vmlinuz initrd=initrd.img repo=${repo}
initrd ${repo}/images/pxeboot/initrd.img
boot

———————————————-

Centos

dhcp any
set base http://mirror.centos.org/centos/6/os/x86_64
kernel ${base}/images/pxeboot/vmlinuz stage2=${base}/images/install.img ksdevice=${netX/mac}
initrd ${base}/images/pxeboot/initrd.img
boot

=================================

Our local server ipxe script

dhcp any
set base http://oeorgan1/distro/centos
kernel ${base}/pxeboot/vmlinuz stage2=${base}/install.img ksdevice=${netX/mac}
initrd ${base}/pxeboot/initrd.img
boot

Files  for local server needed:

${base}/
boot.iso
install.img
${base}/pxeboot/
initrd.img
vmlinuz

 —————————————————
Stromboli biscuit:
stroboli
Good day.
Advertisements