[phpwiki] Debian USBInstall

Purpose

To create a bootable Debian network-Install with a USB memory stick. This is an alternative to using CD-ROM or Business Card size CD-ROM. After this is completed you will be able to boot from a USB memory stick and install from a Debian mirror, external or internal (see Setting Up A Local Debian Mirror).

The procedure outline below is the flexible method so that you can update it later with Debian install image and it will not limit your memory stick storage size. There is a simpler alternative method where you use the boot.img.gz but it limits your storage size. The following instruction varies slightly from the standard Debian Installation Manual.

Always make proper backup before proceeding.
Please report problems and direct all inquiries to Contact US.


Prerequiste


Procedures

1. Install the following packages from terminal as root. Alternately, perpend it with sudo if your computer is installed without a root account.

 # apt-get install mbr syslinux mtools

2. Check the USB memory stick device id by checking /dev/sd* in dmesg after insertion or simply use GParted - the partition editor to see the device. It is typically listed as sdb if it is the second serial device, with the first serial device - sda being the SATA drive. USB memory stick usually comes preformatted as MS DOS partitions. We will represent the device id as sd? hence forth, replace ? with your drive letter. You can also use GParted to partition and format the USB memory stick if you choose so but for crying out loud, make a back of your USB memory stick first.

3. Download the kernel, the initial ramdisk image and the net-install iso image from your favourite mirror. Replace the following ftp site with the mirror of your choice. You may also replace the iso image with the image of your choice but you will need to get it from other directories.

 $ wget ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/netboot/debian-installer/i386/linux
 $ wget ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz
 $ wget ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/netboot/mini.iso

The netboot version is necessary because it contains network communication modules.

4. Make sure the USB memory stick is unmounted.

5. Install the master boot record. This will make the USB memory stick a bootable device. As root,

 # install-mbr /dev/sd?

6. Install the bootloader - Syslinux. It is a for loading the Linux kernel and works off a MS DOS partition. In this case we are making it work off of partition 1 in the USB memory stick.

 # syslinux /dev/sd?1

7. Mount the USB memory stick and copy kernel, initial ramdisk image and the net-install iso image to it. You may replace the mount point with another.

 # mount /dev/sd? /mnt
 # cp linux initrd.gz mini.iso /mnt

8. Create the configuration file in the root directory of the USB memory stick.

 # echo -e 'default linux vga=791 \nappend initrd=initrd.gz ramdisk_size=12000 root=/dev/ram rw' > /mnt/syslinux.cfg

9. Unmount the USB memory stick.

 # umount /mnt

Test and Verify

Remove and reinsert USB memory stick and browse the volume. You should now see the following in the USB memory stick.

 $ls
 $ initrd.gz ldlinux.sys linux mini.iso syslinux.cfg

Boot your target computer with the USB memory stick. Be sure to enable the USB port as part of the boot sequence.serial device.


References


Page locked (last edited December 2, 2009) [info] [diff])
FindPage by browsing or searching
5 best incoming links: FrontPage (4)
5 best outgoing links:
5 most popular nearby: FrontPage (2047)