Contents[Hide]

There are more and more Laptops nowadays which do not have a CD/DVD-ROM facility build in but are able to boot from USB memory stick. This small guide provides all needs on how to create a bootable USB memory stick to install a Debian without a need for CD/DVD drive.

Before you continue make sure that you have backed up all your data from your USB memory stick. After completing this guide your USB memory stick will contain a new partition table and all your data will be lost.

This guide also assumes that you have a running linux system and USB memory stick with minimal size of 512MB which you will use for the process of creating Debian boot installation USB stick.

1. Find USB device name

Plug in your USB stick and find its device file name by:

fdisk -l

For the rest of this guide we are going to use /dev/sdb as our target.

WARNING: DO NOT COPY AND PASTE COMMANDS FROM THIS PAGE UNLESS YOUR TARGET DEVICE IS ALSO /dev/sdb !!

2. Create FAT16 partition

Next we need to create FAT16 partition. For this we can use cfdisk with -z option. This command will completely remove all your data from your USB stick, so backup first !:

cfdisk -z /dev/sdb

and create a first primary partition with the minimal size of 260MB and leave the rest unpartitioned or create second partition with some other filesystem for normal use of your USB stick. The size of 260 MB will fit a current Debian stable boot.img.gz and and Debian netinst ISO image.

NOTE: it is fine to create a single partition with full size of your USB memory stick but you will not be able to use more than 239MB of from your actual USB disk memory size. Once done the output of fdisk -l will look similar to the one below.

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1 1 197 390817 6 FAT16
/dev/sdb2 198 1016 1624896 b W95 FAT32

Download Debian boot image As a nest step we need to download Debian boot image. Use wget:

wget ftp://ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/boot.img.gz

NOTE: if you want testing or unstable version of Debian boot image just change a keyword stable in the previous URL to unstable or testing.

3. Copy boot image

Now we need to copy a Debian boot image to our first partition which in our case is /dev/sdb1:

zcat boot.img.gz > /dev/sdb1

If you will get an error "gzip: stdout: No space left on device" then just increase a size of your first partition.

4. Copy Debian netinst ISO

At this point is time to copy debian netinst image to our /dev/sdb1 partition. To do that we need to mount /dev/sdb1:

# mkdir /mnt/sdb1
# mount /dev/sdb1 /mnt/sdb1
# cp /path/to/image/debian-504-i386-netinst.iso /mnt/sdb1

If you do not have Debian netinst ISO you can download it from: http://www.debian.org/CD/netinst/

# umount /mnt/sdb1

5. Install Master Boot Record

To be able boot from our USB stick a MBR ( Master Boot Record ) needs to be installed.

# install-mbr /dev/sdb

if you do not have a install-mbr command available install mbr package:

# apt-get install mbr

At this point all should be ready to boot from USB stick and install Debian Linux.

6. Change BIOS boot settings and boot

Place your USB stick into to USB port of your PC / Laptop and change BIOS settings to boot from USB HDD . After reboot you will see MBR FA: press "a" followed by "1"



Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Linux Online Training

Learn to run Linux servers and prepare for LPI certification with Linux Academy. 104 available video lessons with PDF course notes with your own server!

Go to top