Create bootable usb with linux cli (tutorial)

so lately i used this to make bootable usb and it’s just easier/faster than a dedicated program IMO.

basically plug in your usb and run $ sudo fdisk -l

to get path to your usb.

then run $ sudo dd bs=4M if=/path/to/file.iso of=/dev/sdX status=progress oflag=sync

and it’ll create your bootable iso on the usb.

source : https://linuxconfig.org/how-to-make-a-bootable-usb-from-an-iso-in-linux

maybe it’s old news lol but i just recently discovered that

(also i can’t find a appropriate category to post this , but here it is anyway)

2 Likes

Yeah dd is simple, but it’s dangerous. It gives no warnings or confirmations and just writes to the device specified regardless of whether it’s the right one. Many people, myself included, have overwritten the wrong disk.

There’s a reason it’s called data destroyer!

2 Likes

well just make super sure the device specified , is the device you want to write to , yes ?

( iv’e done it now about 5 times , and 5 of those times i was semi intoxicated , and i got it right , it;s not that hard if you focus )

:grin:

Yeah for sure, until the one time you don’t. These days I quadruple check before hitting enter. If I remember the next time an iso is released, I’m going to try iso image writer.

1 Like

but thanks for pointing it out , that link should also have pointed out the danger.

i just thought i’d share it cause it’s easier and much faster than finding a program that does it and then figuring out how to use the program ( for me at least , a dummy lol )

PS : doesn’t the BB code thing work anymore now that the text box/editor thing have changed recently ?

It is also in the wiki.

https://discovery.endeavouros.com/installation/create-install-media-usb-key/2021/03/

1 Like

also , isin’t that what sudo on linux do anyway ?

No, it just asks for your password. By confirmation I mean “You are going to overwrite /dev/sdX with the file filename. Are you sure you want to continue?”.

I’m not arguing against using dd, I’m just saying be bloody careful when you do. I’ve used it for nearly 25 years, but as I’m getting older I want something safer :slight_smile:

2 Likes

dd to the rescue”—been a trusted friend over decades, same here. From repairing a mucked-up MBR to cloning complete disks, or writing an ISO. Surely, “bloody careful” is the word.

I’m also older, and always forget the new “progress” thing (it’s only been there for a few years, after all), so it usually comes down to reading the man in another terminal and finding the correct signal to send it for showing progress… Then hitting , Return all the time and cross fingers… :wink:

As someone who has been using dd for years I have to say it just works. I have a script I use that makes this easy for me. Again just make sure of the destination path or you could overwrite something important.

dd is what I use too, very quick and lightweight.

Always found it odd there are large bloated programs out there to make images when there is already something built in, fast, and incredibly small size wise.

Only difference is when I use dd I select the device by device id. For my use case this means every time I need to update the boot image the script always has the correct USB flash drive set. I saved this script so it works other than updating the ISO path.

Of course I wouldn’t advise anyone just copying what I done, best to read on using dd with device ID and making sure nothing is removed that shouldn’t be.

dd bs=4M if="path/to/image.iso" of=/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_1C1B0D9322EC21911973KDFV-0:0 conv=fsync oflag=direct status=progress
1 Like

I did so for decades…

But some weeks ago I found somewhere, these ISO´s need a special format, there are some others not usable on sticks.

You should beware of this. Has been a great surprise to me…

What about bootable usb with multiple iso’s use case? Any recommendation?

Ventoy

Edit: If a (new) .iso will not boot, it´s time to update ventoy (on the stick).

4 Likes

And in the Archwiki.

i use dd maybe 3-5 times a month, i “make” bootable usb-sticks alot and test different Distros.

so far no accidents with it :slight_smile:

dd is the method I always use. It may be “old school”, but it works very well and it’s easy.

grgaud

I thought it had a –verbose flag. I might be wrong. been a while since I used it

-verbose won´t help you.

If you hit ´enter´ it´s running, of=/dev/root :wink:

Triple-check before hitting ´enter´!

1 Like

There’s nothing in the man page that mentions verbose.