Difference between revisions of "Netboot install"

From LSDevLinux
Jump to: navigation, search
m (Reverted edits by Okopacare (Talk); changed back to last version by Mayhewn)
 
Line 1: Line 1:
----
+
<div style="float:right;margin-left:1.5em">__TOC__</div>
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://acisabukody.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 
----
 
=[http://acisabukody.co.cc CLICK HERE]=
 
----
 
</div>
 
&lt;div style=&quot;float:right;margin-left:1.5em&quot;&gt;__TOC__&lt;/div&gt;
 
  
 
It's possible to install Debian/Ubuntu entirely over a network without downloading a full ISO CD image.
 
It's possible to install Debian/Ubuntu entirely over a network without downloading a full ISO CD image.
Line 19: Line 11:
 
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:
 
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:
  
&lt;blockquote&gt;&lt;tt&gt;''MIRROR''/dists/''DIST''/main/installer-i386/current/images/netboot/&lt;/tt&gt;&lt;/blockquote&gt;
+
<blockquote><tt>''MIRROR''/dists/''DIST''/main/installer-i386/current/images/netboot/</tt></blockquote>
  
The &lt;tt&gt;gtk&lt;/tt&gt; subdirectory contains versions that use the graphical installer. Otherwise the installer is console-based. Surprisingly, the graphical installer is only very slightly larger.
+
The <tt>gtk</tt> 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 ===
 
=== Mini ISO ===
  
The  Mini ISO [http://help.ubuntu.com/community/Installation/MinimalCD] is a bootable CD image that is only 10-16MB in size. It is the file &lt;tt&gt;mini.iso&lt;/tt&gt; at the top level of the &lt;tt&gt;netboot&lt;/tt&gt; or &lt;tt&gt;netboot/gtk&lt;/tt&gt; mirror directory mentioned above.
+
The  Mini ISO [http://help.ubuntu.com/community/Installation/MinimalCD] 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, 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).
 
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 &quot;Floppy. CD, HD&quot;.
+
Set the machine to boot from the CD drive, eg by changing the boot order to "Floppy. CD, HD".
  
 
=== GRUB flash ===
 
=== GRUB flash ===
  
It's possible to install GRUB on a USB flash drive and copy the netboot &lt;tt&gt;kernel&lt;/tt&gt; and &lt;tt&gt;initrd&lt;/tt&gt; to it. These files are in the &lt;tt&gt;debian-installer/i386&lt;/tt&gt; 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.
+
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:
 
The outline of the procedure is as follows:
  
# Create a &lt;tt&gt;boot&lt;/tt&gt; directory at the top level of the drive, and a &lt;tt&gt;grub&lt;/tt&gt; 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 &lt;tt&gt;linux&lt;/tt&gt; and &lt;tt&gt;initrd.gz&lt;/tt&gt; to the &lt;tt&gt;boot&lt;/tt&gt; directory, or a subdirectory 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 &lt;tt&gt;menu.lst&lt;/tt&gt; in &lt;tt&gt;boot/grub&lt;/tt&gt;.
+
# Create a <tt>menu.lst</tt> in <tt>boot/grub</tt>.
 
# Install GRUB to the MBR.
 
# Install GRUB to the MBR.
  
It's possible to have multiple sets of &lt;tt&gt;linux+initrd&lt;/tt&gt; 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 &lt;tt&gt;memtest86&lt;/tt&gt; 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. You can keep GRUB and the &lt;tt&gt;boot&lt;/tt&gt; directory on there permanently, which leaves you with a handy way to test or install linux on any machine as needed.
+
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.
  
 
==== Copy boot files to the drive ====
 
==== Copy boot files to the drive ====
Line 66: Line 58:
 
  boot/grub/splashimages/...
 
  boot/grub/splashimages/...
  
I also have [http://www.damnsmalllinux.org/ DSL] and [http://www.damnsmalllinux.org/dsl-n/ DSL-n] available as boot options, although this requires additional files to be installed in a &lt;tt&gt;KNOPPIX&lt;/tt&gt; directory at the root of the drive.
+
I also have [http://www.damnsmalllinux.org/ DSL] and [http://www.damnsmalllinux.org/dsl-n/ DSL-n] available as boot options, although this requires additional files to be installed in a <tt>KNOPPIX</tt> directory at the root of the drive.
  
 
==== Set up menu.lst ====
 
==== Set up menu.lst ====
  
My &lt;tt&gt;menu.lst&lt;/tt&gt; looks like this:
+
My <tt>menu.lst</tt> looks like this:
  
 
  splashimage=/boot/grub/splashimages/fiesta.xpm.gz
 
  splashimage=/boot/grub/splashimages/fiesta.xpm.gz
Line 97: Line 89:
 
  kernel /boot/memtest/memtest86+.bin
 
  kernel /boot/memtest/memtest86+.bin
  
Note that the root is hd0, because when booting from an external USB hard drive Windows requires the boot drive to be drive C, so most BIOSes will reorder the drives to put a USB drive first. Linux doesn't have any such restriction, but GRUB does all its i/o through the BIOS. If you encounter a BIOS that doesn't work this way, you will need to edit &lt;tt&gt;menu.lst&lt;/tt&gt; or adjust the boot commands interactively after GRUB is loaded but before attempting to boot. Worst-case, you may need to reinstall GRUB on the flash drive (see below).
+
Note that the root is hd0, because when booting from an external USB hard drive Windows requires the boot drive to be drive C, so most BIOSes will reorder the drives to put a USB drive first. Linux doesn't have any such restriction, but GRUB does all its i/o through the BIOS. If you encounter a BIOS that doesn't work this way, you will need to edit <tt>menu.lst</tt> or adjust the boot commands interactively after GRUB is loaded but before attempting to boot. Worst-case, you may need to reinstall GRUB on the flash drive (see below).
  
For the graphical installer, according to the [http://www.debian.org/releases/lenny/i386/ch04s03.html.en Debian Installer Manual §4.3] it's necessary to pass some extra kernel arguments to set the video mode, as shown above: &lt;tt&gt;video=vesa:ywrap,mtrr vga=788&lt;/tt&gt;
+
For the graphical installer, according to the [http://www.debian.org/releases/lenny/i386/ch04s03.html.en Debian Installer Manual §4.3] it's necessary to pass some extra kernel arguments to set the video mode, as shown above: <tt>video=vesa:ywrap,mtrr vga=788</tt>
  
 
==== Install GRUB to the MBR ====
 
==== Install GRUB to the MBR ====
  
You will need to copy a minimal set of GRUB files to &lt;tt&gt;boot/grub/&lt;/tt&gt; on the drive, and then run the host-based GRUB (compiled as a Linux utility) to set up the MBR.
+
You will need to copy a minimal set of GRUB files to <tt>boot/grub/</tt> on the drive, and then run the host-based GRUB (compiled as a Linux utility) to set up the MBR.
  
 
Assuming your drive is formatted as FAT16 or FAT32:
 
Assuming your drive is formatted as FAT16 or FAT32:
Line 109: Line 101:
 
  cp -p /boot/grub/{stage[12],fat_stage1_5} ''MY_DISK''/boot/grub/
 
  cp -p /boot/grub/{stage[12],fat_stage1_5} ''MY_DISK''/boot/grub/
  
Before installing to the MBR, unmount the device. This can be done conveniently using the Disk Mounter panel applet, or from the command line using &lt;tt&gt;sudo umount ...&lt;/tt&gt;.
+
Before installing to the MBR, unmount the device. This can be done conveniently using the Disk Mounter panel applet, or from the command line using <tt>sudo umount ...</tt>.
  
 
Now start GRUB with root privileges (so that it can write to the device):
 
Now start GRUB with root privileges (so that it can write to the device):
Line 115: Line 107:
 
  sudo grub
 
  sudo grub
  
Although re-installing GRUB on a drive that already has GRUB installed is pretty harmless, you probably want to make sure that you are installing to the right place. Since GRUB's device naming is different from that of the host system, you should run a &lt;tt&gt;find&lt;/tt&gt; command to satisfy yourself that you have the right device:
+
Although re-installing GRUB on a drive that already has GRUB installed is pretty harmless, you probably want to make sure that you are installing to the right place. Since GRUB's device naming is different from that of the host system, you should run a <tt>find</tt> command to satisfy yourself that you have the right device:
  
  '''grub&amp;gt;''' find /boot/grub/stage2
+
  '''grub&gt;''' find /boot/grub/stage2
  
(&lt;tt&gt;'''grub&amp;gt;'''&lt;/tt&gt; indicates the GRUB prompt.) This will list all the devices that have a &lt;tt&gt;boot/grub/stage2&lt;/tt&gt; on them. For example:
+
(<tt>'''grub&gt;'''</tt> indicates the GRUB prompt.) This will list all the devices that have a <tt>boot/grub/stage2</tt> on them. For example:
  
 
   (hd0,0)
 
   (hd0,0)
Line 128: Line 120:
 
To make absolutely sure you have the right device, try to find a file that is on your flash drive and not on your host drive. For example:
 
To make absolutely sure you have the right device, try to find a file that is on your flash drive and not on your host drive. For example:
  
  '''grub&amp;gt;''' find /boot/debian-i386/linux
+
  '''grub&gt;''' find /boot/debian-i386/linux
 
   (hd1,0)
 
   (hd1,0)
  
Installing to the MBR is now a simple matter of using the &lt;tt&gt;setup&lt;/tt&gt; command. Assuming your USB device is &lt;tt&gt;(hd1,0)&lt;/tt&gt;:
+
Installing to the MBR is now a simple matter of using the <tt>setup</tt> command. Assuming your USB device is <tt>(hd1,0)</tt>:
  
  '''grub&amp;gt;''' setup (hd1) (hd1,0)
+
  '''grub&gt;''' setup (hd1) (hd1,0)
   Checking if &quot;/boot/grub/stage1&quot; exists... yes
+
   Checking if "/boot/grub/stage1" exists... yes
   Checking if &quot;/boot/grub/stage2&quot; exists... yes
+
   Checking if "/boot/grub/stage2" exists... yes
   Checking if &quot;/boot/grub/fat_stage1_5&quot; exists... yes
+
   Checking if "/boot/grub/fat_stage1_5" exists... yes
   Running &quot;embed /boot/grub/fat_stage1_5 (hd1)&quot;...  16 sectors are embedded.
+
   Running "embed /boot/grub/fat_stage1_5 (hd1)"...  16 sectors are embedded.
 
  succeeded
 
  succeeded
   Running &quot;install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/boot/grub/stage2
+
   Running "install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/boot/grub/stage2
  /boot/grub/menu.lst&quot;... succeeded
+
  /boot/grub/menu.lst"... succeeded
 
  Done.
 
  Done.
  
Exit GRUB by typing &quot;&lt;tt&gt;quit&lt;/tt&gt;&quot;. You may now reboot and test your flash drive. Hopefully you will see the GRUB menu that is on the flash drive rather than the one from your main system. You can try running one of the installers as far as entering (but not completing!) the disk partitioning stage without affecting your system. (See below for more information.) You can also try running &lt;tt&gt;memtest&lt;/tt&gt;.
+
Exit GRUB by typing "<tt>quit</tt>". You may now reboot and test your flash drive. Hopefully you will see the GRUB menu that is on the flash drive rather than the one from your main system. You can try running one of the installers as far as entering (but not completing!) the disk partitioning stage without affecting your system. (See below for more information.) You can also try running <tt>memtest</tt>.
  
 
Note that it is necessary to remove the USB drive in order to boot normally from the internal hard drive.
 
Note that it is necessary to remove the USB drive in order to boot normally from the internal hard drive.
Line 159: Line 151:
 
''[Under construction]''
 
''[Under construction]''
  
There is a version of GRUB built as a Windows NT boot loader. It can be installed alongside the regular Windows bootloader without touching the MBR. By adding one line to the system's &lt;tt&gt;\boot.ini&lt;/tt&gt; file GRUB can be made to appear as an additional Windows boot option. Once GRUB is booted, its menu as configured in &lt;tt&gt;menu.lst&lt;/tt&gt; appears. The various files that GRUB needs, such as &lt;tt&gt;menu.lst&lt;/tt&gt; and the &lt;tt&gt;linux&lt;/tt&gt;,&lt;tt&gt;initrd.gz&lt;/tt&gt; combinations, are all stored in a directory on the Windows partition.
+
There is a version of GRUB built as a Windows NT boot loader. It can be installed alongside the regular Windows bootloader without touching the MBR. By adding one line to the system's <tt>\boot.ini</tt> file GRUB can be made to appear as an additional Windows boot option. Once GRUB is booted, its menu as configured in <tt>menu.lst</tt> appears. The various files that GRUB needs, such as <tt>menu.lst</tt> and the <tt>linux</tt>,<tt>initrd.gz</tt> combinations, are all stored in a directory on the Windows partition.
  
This can be used as a way to start a Linux installation without any external media (not even USB flash). However, it can also be used as a permanent way to boot Linux without touching the MBR. GRUB can be disabled at any point simply by removing the extra line from &lt;tt&gt;boot.ini&lt;/tt&gt;. A borrowed computer can temporarily be turned into a dual-boot system by shrinking the Windows partition and installing Linux into a newly-created partition. Later, the Linux partitions can be deleted, the Windows partition expanded back to its original size, and the original boot setup restored by editing &lt;tt&gt;boot.ini&lt;/tt&gt; (and, optionally, deleting the &lt;tt&gt;\boot&lt;/tt&gt; directory used to hold GRUB and the kernel+initrd files).
+
This can be used as a way to start a Linux installation without any external media (not even USB flash). However, it can also be used as a permanent way to boot Linux without touching the MBR. GRUB can be disabled at any point simply by removing the extra line from <tt>boot.ini</tt>. A borrowed computer can temporarily be turned into a dual-boot system by shrinking the Windows partition and installing Linux into a newly-created partition. Later, the Linux partitions can be deleted, the Windows partition expanded back to its original size, and the original boot setup restored by editing <tt>boot.ini</tt> (and, optionally, deleting the <tt>\boot</tt> directory used to hold GRUB and the kernel+initrd files).
  
 
Note that this method of booting the installer can be used even if the entire hard drive is to be overwritten with Linux, since once the kernel and initrd are loaded into memory no further use is made of the hard drive.
 
Note that this method of booting the installer can be used even if the entire hard drive is to be overwritten with Linux, since once the kernel and initrd are loaded into memory no further use is made of the hard drive.
Line 169: Line 161:
 
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.
 
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 &lt;tt&gt;debian.wycliffe.ca&lt;/tt&gt; and the directory is either &lt;tt&gt;/debian/&lt;/tt&gt; or &lt;tt&gt;/ubuntu/&lt;/tt&gt;. 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 &quot;tasks&quot;. If you want a minimal install, choose &quot;Standard&quot; and nothing else. You can install your chosen desktop environment later using a console login and &lt;tt&gt;apt-get install&lt;/tt&gt;. 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]]

Latest revision as of 10:36, 24 November 2010

It's possible to install Debian/Ubuntu entirely over a network without downloading a full ISO CD image.

This has a number of advantages. One is 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. Another advantage is that you may use a mirror that doesn't carry CD images (many don't) and at busy times just after new releases these mirrors are fairly lightly loaded since the CDs contain all the latest packages and few additional mirror downloads are needed.

A live CD is always useful as a recovery disk, but it's not necessary to have the latest and greatest. A live CD from a previous release, or a different distro, will often do just as well.

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 [1] 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.

Copy boot files to the drive

The layout of my flash drive looks like this:

boot/debian-amd64/linux
boot/debian-amd64/initrd.gz
boot/debian-i386/linux
boot/debian-i386/initrd.gz

boot/ubuntu-amd64/linux
boot/ubuntu-amd64/initrd.gz
boot/ubuntu-i386/linux
boot/ubuntu-i386/initrd.gz

boot/memtest/memtest86+.bin

boot/grub/menu.lst
boot/grub/...
boot/grub/splashimages/...

I also have DSL and DSL-n available as boot options, although this requires additional files to be installed in a KNOPPIX directory at the root of the drive.

Set up menu.lst

My menu.lst looks like this:

splashimage=/boot/grub/splashimages/fiesta.xpm.gz
foreground = ff3366
background = 000066

root=(hd0,0)

title  New Debian Install (i386)
kernel /boot/debian-i386/linux root=/dev/ram0 ramdisk_size=12000 video=vesa:ywrap,mtrr vga=788
initrd /boot/debian-i386/initrd.gz

title  New Ubuntu Install (i386)
kernel /boot/ubuntu-i386/linux root=/dev/ram0 ramdisk_size=12000 video=vesa:ywrap,mtrr vga=788
initrd /boot/ubuntu-i386/initrd.gz

title  New Debian Install (amd64)
kernel /boot/debian-amd64/linux root=/dev/ram0 ramdisk_size=12000 video=vesa:ywrap,mtrr vga=788
initrd /boot/debian-amd64/initrd.gz

title  New Ubuntu Install (amd64)
kernel /boot/ubuntu-amd64/linux root=/dev/ram0 ramdisk_size=12000 video=vesa:ywrap,mtrr vga=788
initrd /boot/ubuntu-amd64/initrd.gz

title Memtest86+
kernel /boot/memtest/memtest86+.bin

Note that the root is hd0, because when booting from an external USB hard drive Windows requires the boot drive to be drive C, so most BIOSes will reorder the drives to put a USB drive first. Linux doesn't have any such restriction, but GRUB does all its i/o through the BIOS. If you encounter a BIOS that doesn't work this way, you will need to edit menu.lst or adjust the boot commands interactively after GRUB is loaded but before attempting to boot. Worst-case, you may need to reinstall GRUB on the flash drive (see below).

For the graphical installer, according to the Debian Installer Manual §4.3 it's necessary to pass some extra kernel arguments to set the video mode, as shown above: video=vesa:ywrap,mtrr vga=788

Install GRUB to the MBR

You will need to copy a minimal set of GRUB files to boot/grub/ on the drive, and then run the host-based GRUB (compiled as a Linux utility) to set up the MBR.

Assuming your drive is formatted as FAT16 or FAT32:

cp -p /boot/grub/{stage[12],fat_stage1_5} MY_DISK/boot/grub/

Before installing to the MBR, unmount the device. This can be done conveniently using the Disk Mounter panel applet, or from the command line using sudo umount ....

Now start GRUB with root privileges (so that it can write to the device):

sudo grub

Although re-installing GRUB on a drive that already has GRUB installed is pretty harmless, you probably want to make sure that you are installing to the right place. Since GRUB's device naming is different from that of the host system, you should run a find command to satisfy yourself that you have the right device:

grub> find /boot/grub/stage2

(grub> indicates the GRUB prompt.) This will list all the devices that have a boot/grub/stage2 on them. For example:

 (hd0,0)
 (hd1,0)

The details will vary from system to system, but you should be able to tell which is the USB drive. The number before the comma is the drive, and the number after the comma is the partition. GRUB numbers both from 0, not 1, which is a common cause of mistakes.

To make absolutely sure you have the right device, try to find a file that is on your flash drive and not on your host drive. For example:

grub> find /boot/debian-i386/linux
 (hd1,0)

Installing to the MBR is now a simple matter of using the setup command. Assuming your USB device is (hd1,0):

grub> setup (hd1) (hd1,0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/fat_stage1_5" exists... yes
 Running "embed /boot/grub/fat_stage1_5 (hd1)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

Exit GRUB by typing "quit". You may now reboot and test your flash drive. Hopefully you will see the GRUB menu that is on the flash drive rather than the one from your main system. You can try running one of the installers as far as entering (but not completing!) the disk partitioning stage without affecting your system. (See below for more information.) You can also try running memtest.

Note that it is necessary to remove the USB drive in order to boot normally from the internal hard drive.

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 (such as 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]

There is a version of GRUB built as a Windows NT boot loader. It can be installed alongside the regular Windows bootloader without touching the MBR. By adding one line to the system's \boot.ini file GRUB can be made to appear as an additional Windows boot option. Once GRUB is booted, its menu as configured in menu.lst appears. The various files that GRUB needs, such as menu.lst and the linux,initrd.gz combinations, are all stored in a directory on the Windows partition.

This can be used as a way to start a Linux installation without any external media (not even USB flash). However, it can also be used as a permanent way to boot Linux without touching the MBR. GRUB can be disabled at any point simply by removing the extra line from boot.ini. A borrowed computer can temporarily be turned into a dual-boot system by shrinking the Windows partition and installing Linux into a newly-created partition. Later, the Linux partitions can be deleted, the Windows partition expanded back to its original size, and the original boot setup restored by editing boot.ini (and, optionally, deleting the \boot directory used to hold GRUB and the kernel+initrd files).

Note that this method of booting the installer can be used even if the entire hard drive is to be overwritten with Linux, since once the kernel and initrd are loaded into memory no further use is made of the hard drive.

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.