This describes how to install NetBSD (i386/amd64) using a Memory Stick instead of a CD-ROM Drive.
**Contents**
[[!toc levels=3]]
#Easy method using mkmemstick.sh
[Create an image using mkmemstick.sh](http://jmcneill.spaces.live.com/blog/cns!F507161C07E89CBE!170.entry)
This script depends on the sysutils/cdrtools package.
1 Fetch a copy of the ISO you wish to install along with [mkmemstick.sh](http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/mkmemstick.sh)
2 Create a disk image from the ISO:
$ sh mkmemstick.sh i386cd-5.0.1.iso i386memstick-5.0.1.img
3 Write the newly created image to the memory stick as root:
# dd if=i386memstick-5.0.1.img of=/dev/sd0d
4 Boot from the USB device and follow the [installation process below](/How_to_install_NetBSD_from_an_USB_Memory_Stick/#index3h2).
#Manual method
##Make the Memory Stick bootable
1 Install the Master Boot Record (MBR):
# fdisk -i /dev/rsd0d
2 Create an fdisk partition for NetBSD:

##Copy the installation sets to the Memory Stick
7 For the installation you need an installation kernel and the installation sets. To get them, fetch for example a NetBSD CD-image file from a local FTP-Mirror [1](http://www.netbsd.org/mirrors/#ftp):
$ cd /home/mark
$ ftp -a ftp://ftp.netbsd.org/pub/NetBSD/iso/4.0.1/i386cd-4.0.1.iso
8 Mount the CD-image file:
$ su
# mkdir /image
# vnconfig -c vnd0 /home/mark/i386cd-4.0.1.iso
# mount_cd9660 /dev/vnd0d /image
9 Mount the Memory Stick and copy the **Install kernel** and **sets**:
# mount /dev/sd0a /stick
# cp /image/i386/binary/kernel/netbsd-INSTALL.gz /stick/netbsd.gz
# cp -R /image/i386/binary/sets /stick/sets
# umount /stick
# rmdir /stick
10 Umount the CD-image:
# umount /image
# vnconfig -u vnd0
# rmdir /image
The Memory Stick is now ready to boot the NetBSD-Install system. Just reboot and change your BIOS to boot the USB Memory Stick.
##The installation process
If the Memory Stick boots fine, proceed with the Installation as usual, but the selection of the Install-sets is not quite intuitive:
"Your disk is now ready for installing the kernel and the distributions sets [...]"
[...]
Install from
f: Unmounted fs
Press RETURN and the following screen appears:
"Enter the unmounted local device and directory on that device where the distribution is located. [...]"
Choose the following options:
a: Device sd0a
b: File system ffs
c: Base directory
d: Set directory /sets
Yes, "c: Base directory" is left empty, because we had copied the distribution .tgz files to the /sets directory on the Memory Stick (9.)
Now continue with the installation as usual. Good luck!
###Alternative Method
An alternative setup method saves space on the Stick at the expense of sysinst automation and is therefore more advanced. This method skips the sysinst tool by copying the sets and the **normal** GENERIC Kernel instead of the install-Kernel.
Extract the sets from the harddisk directly on to the Memory stick (/mnt).
# tar xvfzp sets.tgz -C /mnt
Extract the Kernel to the target root
# tar xvfzp GENERIC-kernel.tgz -C /mnt
All you need to do is now to create a valid /etc/fstab and modify /etc/rc.conf to RC_CONFIGURED=yes on the target root (/mnt) and reboot. All fine tuning can be done, when you're logged in.