Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
By Linux_420 at 2011-12-08 00:35
BE CAREFUL NOT TO OVERWRITE THE MBR OR BOOTLOADER ON YOUR PRIMARY BOOT DISK! BACK THEM UP BEFORE YOU BEGIN THIS PROCESS!
Here is a detailed example of how to make a bootable USB disk:
What you will need:
Hardware:
A USB disk large enough to hold the .iso image (which may be compressed using gzip or zip)
A device which has a BIOS capable of booting from USB. (It is possible to boot from another disk and chainload to the USB disk but that is beyond the scope of this tutorial.)
Software:
A Linux operating system (I am using Fedora 16 .. Debian based distros' filesystem is different. Things like package managers and the location of memdisk and vesamenu.c32 will differ.)
The ISO image you wish to boot
Bash (or your favorite shell)
Gedit (or your favorite text editor - I'm not sure if both <cr> and <lf> are acceptable as I do not use Windows)
Syslinux
Memdisk (included with Syslinux)
Vesamenu.c32 (included with Syslinux)
Parted/Gparted
Fdisk (optional)
mkfs.vfat
Steps:
1. Open a shell (i.e. Bash)
2.Make sure you have the packages required and that they are up to date. Use one of the following:
Quote:
yum list installed | less
or
Quote:
yum list installed | grep syslinux
yum list installed | grep etc.
Note: Debian based distros use apt-get as the default package manager. Also you may want to check out Yum Extender if you are using Fedora
3.Plug in your USB disk and determine which device node it is by issuing the following command:
Quote:
sudo fdisk -l
or by issuing the following command after you plug in your USB disk:
Quote:
dmesg | tail
4.Unmount the usb disk using the following command:
Quote:
sudo umount /dev/sdb1
5.Make a FAT filesystem on the partition you wish to boot from using the following command:
Quote:
sudo mkfs.vfat /dev/sdb1
6. Install a MBR (master boot record) to your USB disk if you don't already have one or the one you have is not working properly. Use the following command:
Quote:
sudo syslinux -m /dev/sdb
7.Install Syslinux to the partition you wish to boot from by issuing the following command:
Quote:
sudo syslinux -i /dev/sdb1
sudo parted /dev/sdb set 1 boot on
Note: if your device node happens to be /dev/sdc2 you would use the following command:
Quote:
sudo parted /dev/sdc set 2 boot on
8.Mount the USB disk:
Quote:
mkdir /media/usb_disk
mount /dev/sdb1 /media/usb_disk
9.Now copy the files you need to the root directory (or the directory you chose to install to) of the partition which has Syslinux installed on it.
Note: The location of these files is different on Debian based systems. I am using an Enterprise style filesystem. On Debian based distros the location will be something like /usr/lib/syslinux/ but I'm not 100% positive.
LABEL gb
KERNEL memdisk
INITRD /GeexBox/geexbox-2.0-i386.iso
APPEND iso raw
LABEL dsl
KERNEL memdisk
INITRD /DamnSmallLinux/dsl.iso
APPEND iso raw
Note: Versions of Syslinux prior to 4.04 also needed the raw parameter. Syslinux can handle disk images that have been compressed with zip or gzip. The smaller files load faster and CRC checks provide data integrity. Just compress the image and use the compressed image filename in the menu entry.
That's a very nice writeup, but seems like a lot of work to do something that can be done with one line of code on my FreeBSD box.
Insert your USB stick and make sure it is NOT mounted. Use the cd command to change directories to where the .iso is you want to work with, then run:
Code:
# dd if=./nameof.iso of=/dev/da0 bs=512k
I've used that command to make bootable USB sticks with Debian and Kali .iso files on several occasions. Of course, the syntax for where the USB stick resides will be different on Linux (sda2 maybe?) but I don't know why it wouldn't work.
Please correct me if I am mistaken.
by BW-userx on Sat, 2017-07-15 09:20
Quote:
Originally Posted by Trihexagonal
That's a very nice writeup, but seems like a lot of work to do something that can be done with one line of code on my FreeBSD box.
Insert your USB stick and make sure it is NOT mounted. Use the cd command to change directories to where the .iso is you want to work with, then run:
Code:
# dd if=./nameof.iso of=/dev/da0 bs=512k
I've used that command to make bootable USB sticks with Debian and Kali .iso files on several occasions. Of course, the syntax for where the USB stick resides will be different on Linux (sda2 maybe?) but I don't know why it wouldn't work.
Please correct me if I am mistaken.
when I use this dd thingy -- and am in the same dir as the iso - I do not use that ./ leading I just
Code:
dd if=NameOf.ios of=/dev/sdxx && sync
works Okey Dokey for me. just saves two key strokes is all leaving out the ./
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
Insert your USB stick and make sure it is NOT mounted. Use the cd command to change directories to where the .iso is you want to work with, then run:
Please correct me if I am mistaken.
Insert your USB stick and make sure it is NOT mounted. Use the cd command to change directories to where the .iso is you want to work with, then run:
Please correct me if I am mistaken.