59

I've got a shining new x64 laptop running Windows 7 and I want to dual boot Debian stable.

I've installed Ubuntu on loads of laptops in the past using a USB drive, but I can't find decent instructions for installing Debian like the Ubuntu instructions.

I've installed Debian from CD a couple of times in the past too, but my new machine doesn't have an optical drive.

The questions are:

  1. Which files do I need from the Debian download page?

  2. How do I make the Debian files on a USB drive bootable?

  3. Does the Debian installer have a disk partitioner (like the Ubuntu one does)? Reading the installation guide it seems not to, which would be another hurdle. If this is the case, which partitioner can I use?

12 Answers 12

45

Download UNetbootin, which allows one to create bootable USB installation media for almost any Linux and BSD distribution out of the box.

Just run it, select Debian, choose the usb drive and wait while it downloads the .iso and transfers it to your usb. After that it's bootable and the install works like from a CD.

12
  • Great answer so far. Do you know if, during installation, debian gives the option to partition the disk?
    – blokeley
    Commented Apr 2, 2011 at 13:41
  • 1
    Any linux distro that doesn't let you partition the disk is doomed to fail. Partitioning the disk is a basic part of any installation of Linux. So I'd say yes, it does.
    – Majenko
    Commented Apr 2, 2011 at 13:51
  • 1
    Fantastic answer. Worked first time, and that was after several hours of trying to get the instructions in the debian installation guide to work.
    – Recurse
    Commented May 10, 2012 at 3:56
  • 1
    I've had more luck with the Universal USB Installer, with UNetBootin bootmgr was missing Commented Oct 6, 2013 at 12:11
  • 2
    In case anyone is interested, while attempting to install Debian 9.4.0 the installer detected that I created the install medium with UNetbootin. It warned that "UNetbooin is regularly linked with difficult or unreproducible problem reports from users..." Additionally, it stated that if there were any problems to try installing without UNetbooin. Commented Mar 11, 2018 at 20:57
50

If you're on Linux, the easiest way is to simply do (as per the docs):

cat debian.iso > /dev/sdX; sync

Where X is your drive letter, you can find out the correct letter by checking the output of dmesg right after connecting your USB device. For example for me (and probably many) it would be /dev/sdb

This will wipe everything from your USB drive, so be careful!

UPDATE:

For completeness, I should also mention Rufus for Windows.

8
  • 1
    Why the downvote? this method works and is by far the easiest way to create a bootable Debian USB drive. Commented Dec 10, 2012 at 6:18
  • 2
    It didn't work for me. Just a blank screen showed up when I tried to install. Not sure if it is a problem with my usb drive or the image or the command mentioned above.
    – Sivaji
    Commented Jan 17, 2013 at 15:15
  • @Sivaji what do you mean "tried to install"? if you actually got to the menu then it's probably none of those. Try running the normal installer (not the graphical one) and see if that works. Commented Mar 21, 2013 at 20:16
  • 3
    No idea why this isn't the accepted answer, it's simple, easy to remember, and works, and requires no other tools. Best usb iso suggestion I've ever seen.
    – Lizardx
    Commented Feb 29, 2016 at 1:12
  • 3
    I wonder how many people just copied and pasted your code into their terminal and wiped their /dev/sdb, whatever was in there. My usb stick gets assigned to /dev/sdd. You should make it something like "/dev/sdX" that won't hurt anyone. Commented May 20, 2019 at 0:37
22
  1. Open Debian Download page and download the right cd / dvd for your pc. Most likely, if you have a modern computer, you'll want amd64 version. I'd suggest to choose cd because today you'll probably have a broadband connection and you'll be able to download other needed packages later very quickly.
  2. If you use Linux terminal you can use dd to prepare your usb stick (iso filename in this command is just an example, you'll have to use your downloaded iso name and path:

    dd if=/your/path/debian-7.5.0-i386-netinst.iso of=/dev/sdX bs=4M
    sync

See Debian official instructions here.

Edit: added sync, to flush device writes before ejecting the usb device.

  1. Modern Debian versions include a partitioning tool and wizard, the process should be fairly easy, as pointed out in all the guides, here's one.
0
6

So far the easiest way I have found is

cp debian-7.2.0-i386-netinst.iso /dev/sdX
sync

Where X is the drive letter assigned to the devise (see dmesg right after inserting the USB)

As seen in the Debian instructions

1
  • Didn't work for me.
    – DrBeco
    Commented Aug 6, 2016 at 20:02
4

4.3.3. Manually copying files to the USB stick — the flexible way (Debian Official Ref.)

After trying other options and some notebooks refusing to boot, I've tried this "flexible way" and it was the only one that worked for me.

  1. Stick your new USB stick to the USB (a new one or one that you don't care to lose all data).

  2. unmount it, if it has mounted automatically

    • umount /dev/sdX1 (and sdX2, ...)
  3. partition it (i like old-fashion fdisk)

    • fdisk /dev/sdX
    • d to delete all partitions
    • n to create a new, using all space
    • t to change the partition type to ID c: W95 FAT32 (LBA)
    • a to make sure it is bootable
    • w to write the changes and exit
  4. Install an MBR with (I didn't need this step, so you may test. But its no harm to use it):

    • install-mbr /dev/sdX
  5. Create the filesystem

    • mkdosfs -F32 -n "Debian85" /dev/sdX1
  6. Keep it unmounted and generate the system in it:

    • syslinux /dev/sdX1
  7. Lets mount the USB stick:

    • mount /dev/sdX1 /mnt/d2/
  8. Copy some files (be certain you download them from hd-media):

    • cp vmlinuz /mnt/d2
    • cp initrd.gz /mnt/d2
  9. Edit the file syslinux.cfg, and add the following content to it:

    • vim /mnt/d2/syslinux.cfg

DEFAULT linux
LABEL linux
    SAY Boot Debian Jessie 8.5 CD-1 from SYSLINUX...
    KERNEL vmlinuz
    APPEND ro root=/dev/ram initrd=initrd.gz vga=788
    PROMPT 1

  1. Copy the ISO image to the USB stick:

    • cp /some/path/debian-live-8.5.0-amd64-kde-desktop.iso .
    • sync
  2. Unmount the stick and it is ready to boot some machines:

    • umount /mnt/d2

Notes:

  1. If at some point you become confused about what is mounted where, don't forget to run:

lsblk -fo +size

  1. A comment from my experience: if you copy the files on step 8 from your mounted ISO CD image instead of from the hd-media, then, after a successful boot, during the beginning of the installation (step "Detect and mount CD-ROM"), it will show you the message:

    "incorrect cdrom / cdrom detected cannot be used for installation".

Googling it may show you problems with unetbootin, but as you can see, this method gives the same error and doesn't use such program.

  1. Also, as this method keeps the USB stick available space after the process usable, it is a good idea to create a folder (use the name firmware so debian can find it during the install) and add to it all sorts of non-free firmware that may be needed during the installation. You can get them from this unofficial netinstall image.
1
3

You can try EasyBCD to boot from the iso file directly without creating a bootable usb

1
  • Thanks for the note, but this doesn't answer any of the 3 specific questions.
    – blokeley
    Commented Apr 2, 2011 at 13:58
2

Debian.org - 4.3. Preparing Files for USB Memory Stick Booting

4.3.1. Preparing a USB stick using a hybrid CD or DVD image

Debian CD and DVD images can now be written directly to a USB stick, which is a very easy way to make a bootable USB stick. Simply choose a CD or DVD image (such as the netinst, CD-1, DVD-1, or netboot) that will fit on your USB stick. See Section 4.1, “Official Debian GNU/Linux CD/DVD-ROM Sets” to get a CD or DVD image.

The CD or DVD image you choose should be written directly to the USB stick, overwriting its current contents. For example, when using an existing GNU/Linux system, the CD or DVD image file can be written to a USB stick as follows,

# cp debian.iso /dev/sdX
# sync

4.3.3. Manually copying files to the USB stick — the flexible way

If you like more flexibility or just want to know what's going on, you should use the following method to put the files on your stick. One advantage of using this method is that — if the capacity of your USB stick is large enough — you have the option of copying any ISO image, even a DVD image, to it.


Regarding the boot loader for MS FAT formatted file system.

1

To quote from the Very Verbose Debian Installation Walkthrough:

Step 3 � (cfdisk) You should now be at a black screen that says, "cfdisk 2.11n", at the top. This is where we will partition our hard drive to prepare it so we can install Debian. Probably one of the most "scary" tasks when installing Debian is partitioning the drive. Debian uses a command line tool called cfdisk, which is really quite simple to use, so don't be discouraged by its monochrome presentation.

1

This will hopefully be useful to others.

At present, the official FAQ about Debian install CDs - https://www.debian.org/CD/faq/#write-usb (alongside the usual Linuxy methods, which are nice until you're on a Windows-only machine) - also suggests Win32DiskImager, a simple GUI-based program to write bootable images (such as the Debian .iso) to USB: http://sourceforge.net/projects/win32diskimager/files/latest/download

I've used this method to install latest x86 and x64 Debian with no issues whatsoever.

2
  • Please describe the content of the sites you linked, otherwise when they'll be removed your answer will be useless. Commented Sep 1, 2015 at 19:47
  • 1
    What more description do you want than "the official FAQ about Debian install CDs" and "Win32DiskImager"? These both seem self-explanatory to me. I'm not being sarcastic, but if you want more info, specify what. Commented Sep 1, 2015 at 23:23
0

An alternative method: From your question, I don't see any specific reason why you would want to put Debian onto a USB stick (if there's one, correct me). If you really just want to dual boot Debian on a machine running Windows 7, the Win32-Loader offers an easy way to do so. One can grab this from any debian mirror, inside the directory debian/tools. It's easy to use and self explaining. Once executed, just set the options to your needs (things like keyboard layout are automatically detected) and then click the install button. The setup will download the needed files and then allows you to directly boot into the installer, without the need for making an USB stick bootable and copying a lot of files on it. And yes, the Debian installer offers a way to partition the disk.

1
  • It is easy to install Debian by booting a USB drive with a Debian ISO on it. Commented Feb 16, 2021 at 15:18
0

Etcher is more reliable and faster than unetbootin. https://www.balena.io/etcher/

For Debian, find the ISOs here, best to get the non-free DVD in case there are non-free drivers that are needed. https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/

I wrote up the process here: https://jeffmcneill.com/install-debian-from-usb/

0

By far, the best USB boot software I've used is called Ventoy, because after you install Ventoy onto a USB thumb drive, from then on you can add and remove as many ISOs to it as will fit by simply dragging and dropping them there or deleting them.

Each time you boot, from a Ventoy usb thumb drive, it simply lists all the images you've placed onto it and asks you which one you want to boot.

To me, this is ideal. Yes, it is also free and open source. It is exactly what I was looking for.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .