Difference between revisions of "Netboot install"

From LSDevLinux
Jump to: navigation, search
(Initial creation)
 
(Clarifications and improvements)
Line 1: Line 1:
It's possible to install Debian/Ubuntu entirely over a network. Here are some guidelines on how to do that.
+
It's possible to install Debian/Ubuntu entirely over a network without downloading a full ISO CD image. This has the advantage that you are doing the download and the install in one step, which means that you can set it going without waiting for a large CD image to download, and when you come back the installation will be finished and the machine ready to use.
 +
 
 +
Here are some guidelines on the various options for doing network installs.
  
 
== Method of booting ==
 
== Method of booting ==
  
There are several ways to boot into an installer without downloading a full ISO CD image. Each involves downloading a few small files from a mirror and booting from them. All of the necessary files can be downloaded from the netboot directory of the mirror:
+
First you will need to decide which of several boot methods you will use, as described below. Each involves downloading a few small files from a mirror and booting from them. All of the necessary files can be downloaded from the netboot directory of any mirror site:
  
 
<blockquote><tt>''MIRROR''/dists/''DIST''/main/installer-i386/current/images/netboot/</tt></blockquote>
 
<blockquote><tt>''MIRROR''/dists/''DIST''/main/installer-i386/current/images/netboot/</tt></blockquote>
Line 11: Line 13:
 
=== Mini ISO ===
 
=== Mini ISO ===
  
The '''Mini ISO''' is a bootable CD image that is only 10-16MB in size. It is the file <tt>mini.iso</tt> at the top level of the <tt>netboot</tt> mirror directory mentioned above.
+
The Mini ISO is a bootable CD image that is only 10-16MB in size. It is the file <tt>mini.iso</tt> at the top level of the <tt>netboot</tt> or <tt>netboot/gtk</tt> mirror directory mentioned above.
  
Download and burn this to a CD, ideally a rewritable one. This is typically a good way set up a new virtual machine, by attaching the downloaded ISO to the virtual CD drive.
+
Download and burn this to a CD, ideally a rewritable one, since you probably won't ever need it again. This is also typically a good way set up a new virtual machine, by attaching the downloaded ISO to the virtual CD drive (ie no need to burn a CD in this case).
  
 
Set the machine to boot from the CD drive, eg by changing the boot order to "Floppy. CD, HD".
 
Set the machine to boot from the CD drive, eg by changing the boot order to "Floppy. CD, HD".
Line 19: Line 21:
 
=== GRUB flash ===
 
=== GRUB flash ===
  
It's possible to install GRUB on a USB flash drive and copy the netboot kernel+initrd to it. These are in the <tt>debian-installer/i386</tt> of the netboot mirror directory mentioned above. This can be done with any flash drive, and doesn't require any repartitioning or disk imaging.  
+
It's possible to install GRUB on a USB flash drive and copy the netboot <tt>kernel</tt> and <tt>initrd</tt> to it. These files are in the <tt>debian-installer/i386</tt> of the netboot mirror directory mentioned above. This can be done with any flash drive, and doesn't require any repartitioning or imaging of the drive.
 +
 
 +
The outline of the procedure is as follows:
  
 
# Create a <tt>boot</tt> directory at the top level of the drive, and a <tt>grub</tt> directory within that.
 
# Create a <tt>boot</tt> directory at the top level of the drive, and a <tt>grub</tt> directory within that.
# Copy the files <tt>linux</tt> and <tt>initrd.gz</tt> to the boot directory, or a subfolder of it.
+
# Copy the files <tt>linux</tt> and <tt>initrd.gz</tt> to the <tt>boot</tt> directory, or a subdirectory of it.
# Create a menu.lst in <tt>boot/grub</tt>.
+
# Create a <tt>menu.lst</tt> in <tt>boot/grub</tt>.
# Install GRUB to the MBR (see below).
+
# Install GRUB to the MBR.
  
It's possible to have multiple sets of linux+initrd for different distros and purposes all on the one drive. They don't take up much space. It's easier to keep things organized if you use separate subdirectories for each distro and release. You can also have memtest86 available, which is handy for checking suspect machines, even Windows ones.  
+
It's possible to have multiple sets of <tt>linux+initrd</tt> for different distros and purposes all on the one drive. They don't take up much space. It's easier to keep things organized if you use separate subdirectories for each distro and release. You can also have <tt>memtest86</tt> available, which is handy for checking suspect machines, even Windows ones.  
  
Having GRUB in the MBR is invisible until you boot from the drive, and doesn't affect its operation in any way.
+
Having GRUB in the MBR is invisible until you boot from the drive, and doesn't affect its operation in any way. You can keep GRUB and the <tt>boot</tt> directory on there permanently, which leaves you with a handy way to test or install linux on any machine as needed.
  
 
The layout of my flash drive looks like this:
 
The layout of my flash drive looks like this:
 +
 +
[to be supplied]
  
 
=== PXE boot ===
 
=== PXE boot ===
  
Many BIOSes have a PXE boot capability. This requires a bootp+tftp server to serve the netboot kernel+initrd.
+
Many BIOSes have a PXE boot capability. The BIOS is able to download a netboot kernel and initrd across the network, so that no external media of any kind (eg CD or flash drive) is required. However, PXE requires the presence of a bootp+tftp server to serve up the files.
  
The BIOS will expect the DHCP server to identify the TFTP server that is to be used for booting. This takes significant work to set up, and may not be possible in network environments that already have a DHCP server, unless you plug the installation machine directly into another Linux machine. It's not worth the effort unless you plan to do a lot of installs this way.
+
The BIOS will expect the DHCP server to identify the TFTP server that is to be used for booting. This takes significant work to set up, and may not be possible in network environments that already have a DHCP server, unless you plug the installation machine directly into another Linux machine. It's probably not worth the effort unless you plan to do a lot of installs this way.
  
The netboot kernel+initrd are the same as the ones used with GRUB as described above.
+
The netboot kernel+initrd are the same as the ones used with GRUB as described above, so this is just an alternative way of getting those into memory.
  
 
=== GRUB from a Windows partition ===
 
=== GRUB from a Windows partition ===
Line 46: Line 52:
 
== Using the installer ==
 
== Using the installer ==
  
The machine will boot straight into the installer. You are then asked a series of questions about locale, keyboard and mirror location. It is possible to use a local mirror by selecting ''enter manually'' from the mirror list. However, this entry is right at the top and will not be obvious if your country is lower down the list.
+
The machine will boot straight into the installer. You are then asked a series of questions about locale, keyboard and mirror location. It's possible to use a local mirror by selecting ''enter manually'' from the mirror list. However, this entry is right at the top and will not be obvious if your country is lower down the list.
  
 
Here in the Calgary office, our mirror host name is <tt>debian.wycliffe.ca</tt> and the directory is either <tt>/debian/</tt> or <tt>/ubuntu/</tt>. The release name is determined internally by the installer, based on the release from which you downloaded it.
 
Here in the Calgary office, our mirror host name is <tt>debian.wycliffe.ca</tt> and the directory is either <tt>/debian/</tt> or <tt>/ubuntu/</tt>. The release name is determined internally by the installer, based on the release from which you downloaded it.
  
After this, and some preliminary downloading, you will be invited to select "tasks". If you want minimal install, choose "Standard" and nothing else. You can install your chosen desktop environment later using a console login and <tt>apt-get install</tt>. This allows you to install KDE, XFCE or LXDE without installing GNOME first.
+
After this, and some preliminary downloading, you will be invited to select "tasks". If you want a minimal install, choose "Standard" and nothing else. You can install your chosen desktop environment later using a console login and <tt>apt-get install</tt>. This allows you to install KDE, XFCE or LXDE without installing GNOME first.
  
 
[[Category:Linux tools]]
 
[[Category:Linux tools]]

Revision as of 10:03, 31 March 2009

It's possible to install Debian/Ubuntu entirely over a network without downloading a full ISO CD image. This has the advantage that you are doing the download and the install in one step, which means that you can set it going without waiting for a large CD image to download, and when you come back the installation will be finished and the machine ready to use.

Here are some guidelines on the various options for doing network installs.

Method of booting

First you will need to decide which of several boot methods you will use, as described below. Each involves downloading a few small files from a mirror and booting from them. All of the necessary files can be downloaded from the netboot directory of any mirror site:

MIRROR/dists/DIST/main/installer-i386/current/images/netboot/

The gtk subdirectory contains versions that use the graphical installer. Otherwise the installer is console-based. Surprisingly, the graphical installer is only very slightly larger.

Mini ISO

The Mini ISO is a bootable CD image that is only 10-16MB in size. It is the file mini.iso at the top level of the netboot or netboot/gtk mirror directory mentioned above.

Download and burn this to a CD, ideally a rewritable one, since you probably won't ever need it again. This is also typically a good way set up a new virtual machine, by attaching the downloaded ISO to the virtual CD drive (ie no need to burn a CD in this case).

Set the machine to boot from the CD drive, eg by changing the boot order to "Floppy. CD, HD".

GRUB flash

It's possible to install GRUB on a USB flash drive and copy the netboot kernel and initrd to it. These files are in the debian-installer/i386 of the netboot mirror directory mentioned above. This can be done with any flash drive, and doesn't require any repartitioning or imaging of the drive.

The outline of the procedure is as follows:

  1. Create a boot directory at the top level of the drive, and a grub directory within that.
  2. Copy the files linux and initrd.gz to the boot directory, or a subdirectory of it.
  3. Create a menu.lst in boot/grub.
  4. Install GRUB to the MBR.

It's possible to have multiple sets of linux+initrd for different distros and purposes all on the one drive. They don't take up much space. It's easier to keep things organized if you use separate subdirectories for each distro and release. You can also have memtest86 available, which is handy for checking suspect machines, even Windows ones.

Having GRUB in the MBR is invisible until you boot from the drive, and doesn't affect its operation in any way. You can keep GRUB and the boot directory on there permanently, which leaves you with a handy way to test or install linux on any machine as needed.

The layout of my flash drive looks like this:

[to be supplied]

PXE boot

Many BIOSes have a PXE boot capability. The BIOS is able to download a netboot kernel and initrd across the network, so that no external media of any kind (eg CD or flash drive) is required. However, PXE requires the presence of a bootp+tftp server to serve up the files.

The BIOS will expect the DHCP server to identify the TFTP server that is to be used for booting. This takes significant work to set up, and may not be possible in network environments that already have a DHCP server, unless you plug the installation machine directly into another Linux machine. It's probably not worth the effort unless you plan to do a lot of installs this way.

The netboot kernel+initrd are the same as the ones used with GRUB as described above, so this is just an alternative way of getting those into memory.

GRUB from a Windows partition

[Under construction]

Using the installer

The machine will boot straight into the installer. You are then asked a series of questions about locale, keyboard and mirror location. It's possible to use a local mirror by selecting enter manually from the mirror list. However, this entry is right at the top and will not be obvious if your country is lower down the list.

Here in the Calgary office, our mirror host name is debian.wycliffe.ca and the directory is either /debian/ or /ubuntu/. The release name is determined internally by the installer, based on the release from which you downloaded it.

After this, and some preliminary downloading, you will be invited to select "tasks". If you want a minimal install, choose "Standard" and nothing else. You can install your chosen desktop environment later using a console login and apt-get install. This allows you to install KDE, XFCE or LXDE without installing GNOME first.