tech-install archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Installation from USB stick

On Mon, Mar 23, 2009 at 4:52 AM, Martin Husemann <> 
> [This topic came up elsewhere, but realy is worth discussing here]
> We seem to have all the tools and pieces to provide an easy to use install
> from USB stick but no instructions in the release notes - I wonder what
> way of installation people do prefer, and what tools we could optimize
> to make the experience as smooth as possible.

I want to be able to do installs of multiple versions, and I want to
be able to do other things with my flash drives, so I use the
instructions Jason White wrote a while ago about how to set up a flash
drive with grub under NetBSD, with a pre-existing FAT filesystem on
it. There does seem to be a grub installer for Windows which might
make it straightfoward to do this without already having a NetBSD
system set up.

How to install grub on a usb flashdrive under NetBSD
Jason White <>
 * Flashdrive is attached and recognized as sd0.
 * /dev/sd0e is assumed to have a FAT filesystem on it.
 * Grub should already be installed on the local machine the flashdrive is 
   connected to.

mount /dev/sd0e /mnt
mkdir /mnt/grub
cp /grub/stage* /grub/fat_stage1_5 /mnt/grub/

# grub
grub> find /grub/stage1

grub> root (hd1,0)
 Filesystem type is fat, partition type 0x6

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

Then, install menu.txt in /grub on the flashdrive.
Installing NetBSD From a Flashdrive
Jason White <>

This document will explain how to install NetBSD from a flashdrive.  This 
procedure uses GRUB to load the installation kernels.  Unlike other 
procedures that use installboot on the flashdrive to boot the install 
kernels, I prefer GRUB so that I may boot other images besides NetBSD install 

  * A flashdrive with the GRUB bootloader already installed, mounted on 
    /mnt/usb.  See <>
    for details on installing GRUB to a flashdrive.  Filesystem format 
    doesn't matter.  I use FAT (msdos) because it offers the most flexability
    between operating systems.

  * A NetBSD installation CDROM (or image of one), mounted on /mnt/cdrom.
    The NetBSD-3.0.1 CDROM is used in this procedure.

Copying the Kernel and Install Sets
Before we can install NetBSD from a flashdrive, we must copy the NetBSD 
installation kernels and install sets to the flashdrive.

In the root directory of your flashdrive, create a release directory for the 
particular installation of NetBSD you'll be using:

  mkdir /mnt/usb/nbsd301

From the installation CDROM, copy the /i386/binary/* tree to the release 
directory of your flashdrive, preserving the directory structure.  When done, 
the directory structure on the flashdrive should look like:

  /mnt/usb/netbsd301/i386/binary/{kernel, sets}/...

Installing From the Flashdrive
Boot the flashdrive.  Depending on your GRUB configuration, you may get a 
menu or a "grub>" prompt.  If you get a menu, you can type 'c' to get a 
command prompt.

Once at the command prompt, you can use the 'kernel' command to load the 
NetBSD installation kernel of your choice:

  grub> kernel --type=netbsd /nbsd301/i386/binary/kernel/netbsd-INSTALL.gz
  grub> boot

If you'll be using this a lot, you'll probably want to create a menu.lst file
to save youself some typing.  A sample is included at the end of this 

Follow the sysinst procedure.  When prompted to "Select medium", select 
"Unmounted fs".  Change the device, filesystem, and base directory settings 
to reflect the flashdrive's current device, filesystem, and release to 

Example: a flashdrive detected as sd0 with a FAT filesystem on the 'e' 
partition, and the 'nbsd301' release directory:

  device:         sd0e
  file system:    msdos
  base directory: nbsd301
  set directory:  /i386/binary/sets           (default)

At this point, the installtion sets should be read from the flashdrive and 
the installtion procedure continues as usual.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sample GRUB /mnt/usb/grub/menu.lst:
color white/blue white/red
default 0

title netbsd-INSTALL i386/3.0.1
  kernel --type=netbsd /nbsd301/i386/binary/kernel/netbsd-INSTALL.gz

title netbsd-INSTALL_LAPTOP i386/3.0.1
  kernel --type=netbsd /nbsd301/i386/binary/kernel/netbsd-INSTALL_LAPTOP.gz

title netbsd-INSTALL_PS2(mca bus) i386/3.0.1
  kernel --type=netbsd /nbsd301/i386/binary/kernel/netbsd-INSTALL_PS2.gz

title netbsd-INSTALL_SMALL i386/3.0.1
  kernel --type=netbsd /nbsd301/i386/binary/kernel/netbsd-INSTALL_SMALL.gz

title netbsd-INSTALL_TINY i386/3.0.1
  kernel --type=netbsd /nbsd301/i386/binary/kernel/netbsd-INSTALL_TINY.gz

Home | Main Index | Thread Index | Old Index