Rufus: Reliable USB Formatting Utility
github.com
github.com
You will only need to format your thumb drive once and for all. After that, you will simply only need to copy the image file such as .iso, .vhd etc on to the drive and you are all set. Check details from the following sites.
https://www.ventoy.net/en/index.html https://github.com/ventoy/Ventoy
This is the neatest thing I've seen on HN since the actually portable executable!
I only had to patch script: https://github.com/ventoy/Ventoy/pull/877
I guess it will be valuable to ship this in distros no ?
EDIT: There have also been YUMI and Easy2Boot in a similar vein before Ventoy.
Life saver.
Unfortunately the required arguments tend to be poorly documented and quite specific to each distro. This looks like a neat tool that's sidestepping that issue. If anyone knows of a good resource that documents these boot arguments for a range of distros, please share!
I only got it to work with simple things that load fully from RAM -- say, debian-installer, which only requires kernel+initrd.
It has to be simple and reliable. If it's only one of them, I would rather carry an extra USB stick which I can always format (I do).
loopback loop (hd0,gpt1)/PATH/TO/UBUNTU.iso
set root=(loop)
configfile /boot/grub/loopback.cfg
which in turn seems to load the kernel via linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed iso-scan/filename=/PATH/TO/UBUNTU.iso
initrd /casper/initrd
if you just make sure your path doesn't have spaces. (I forget if you also need to pass boot=casper or not.)You'll have to detect the disk though. It's possible to automate it somewhat, but not trivial (at least if you don't know how). You'll want to use search. https://www.gnu.org/software/grub/manual/grub/html_node/sear...
And make sure you've insmod'ed any modules you need for your hardware if necessary (storage, USB, etc.)... unfortunately documentation on these is poor, and some modules are mutually exclusive, so have fun.
# Ubuntu
linux .../vmlinuz boot=casper file=.../ubuntu.seed iso-scan/filename=...
initrd ...
# Arch
linux .../vmlinuz img_dev=... img_loop=... earlymodules=loop
initrd ..._ucode.img .../archiso.img
# Kali
linux ... boot=live components findiso=... # noautomount
initrd ...
# GParted
linux ... boot=live union=overlay config components toram=....squashfs findiso=...
initrd ...
In general you'll have to boot the kernels directly as shown above. Using the built-in GRUB menus won't work in many cases. Which makes it difficult to make these future-proof.You'll also want to make sure you've insmod'ed any modules you need for your hardware as necessary (storage, USB, etc.)... unfortunately documentation on these is poor, and some modules are mutually exclusive, so have fun.
Best of luck getting a robust boot menu script going. Expect to spend weeks if not months on it if you're new to GRUB scripts/components.
For context, I have professionally deployed Linux on USB, ever since around 2004. I honestly don't care to remember all the odd issues/failures I've encountered during those 17 years. The situation certainly got better/easier with the years, but it can still be a gamble if an odd Linux distro will actually boot successfully from USB or not.
Until I discovered Ventoy, about a year or two ago, I would always be hesitant to recommend running Linux from USB, unless I knew the exact setup (or it involved someone with a decent technical skills).
Ventoy is great!!! I'd recommend everyone to at least have a look at it. It's one of the very few tools I endorse without any hesitation or reservation.
I am in no way personally involved with Ventoy, nor do I have a stake in it. I just love the tool for what it is.
Could you point to some good sources that explain in detail the whole "bootable USB" world? It seems it's always a hassle to get right, especially when preparing a Windows bootable USB.
I suppose I could dig up an old Debian Iso-but I'd prefer something with a recent-ish kernel (wireguard) and a half-secure libssl and opensshd.
Hm, maybe openbsd (current) still has support?
Ed: I've been doing Linux installs since the 90s... Around kernel 1.3 or there abouts - but it's been a while since dipped my toes in 32bit/hybrid x86 systems. .
There is also a couple of hardware projects that to that in hardware. I used the ISOstick for many years.
You can also PXE NetBoot a lot of installers with dynamic menu selection - see http://netboot.xyz
Without diving into the source code. :) Has anyone seen architecture/design documents on how it actually mounts the ISO file and "boots" from it? What does prevent "the other 10%" from not working?
I looked through the docs, found these so far:
Memdisk[1] section mentions:
> In normal mode, Ventoy will only read the iso file at booting time, and only read the content needed for boot.
Ventoy Compatible?[2] mentions a hook. What does this mean?
> Once Ventoy treats the iso file as Ventoy Compatible, it will just make the virtual disk and will not do the hook.
<https://unetbootin.github.io/>
<https://en.wikipedia.org/wiki/UNetbootin>
This is barely a year old and comes all, besides a handful of comments, from one account https://github.com/ventoy/Ventoy/graphs/contributors
Personally and subjective this rings quite some alarm bells for me, seems just a bit sketchy and in any way really young, so not as much time out on the field and thus possibly not as much bugs shaken out...
I'm not sure why a piece of software being built by one person is sketchy but ok.
> Multiple installs on the same device are not supported.
If one is limited to a single usb-stick per ISO, it's just easier to dd the installation image: run it the way it's (hopefully[x]) been tested by the vendors.
Ventoy is a different ballgame: drag & drop ISO file and boot from it. I tested it this morning with 3 things I carry around myself (debian-live, debian-installer, freebsd release installer), and it worked. 1 stick instead of 3, and I still have the remaining exFAT partition for other things. And a spare encrypted partition if I wanted to (I don't).
Regarding bugs -- it works or it doesn't for your distribution. I think it's remarkable what this, seemingly single developer, has achieved over a bit more than a year[2].
[1]: https://en.wikipedia.org/wiki/UNetbootin
[2]: https://github.com/ventoy/Ventoy/commit/2090c6fa978999d4ef1e...
[x]: don't get me started with Intel SSD firmware "bootable" images.
Too bad because I'd really like to have a single USB with everything I could really carry around instead of a bunch of small one.
I've used it to successfully boot into both Windows and Linux. Although it's is only available for Windows, there seems to be a Linux counterpart as well, which I've never tried out: https://www.pendrivelinux.com/multiboot-create-a-multiboot-u...
The only reason I even keep an old Windows based laptop around for was to burn ISO’s to flash drives with Rufus for repairing computers of friends and family members.
A nice companion could be a small *PI like board with a script that scans repositories for iso updates then downloads them using torrent to avoid taxing the servers too much, then when necessary (but not more than once every N days to avoid wearing the memory) updates the dongle automatically overnight. Just stick the dongle when you're back at home and the next morning if necessary it is updated to the latest images.
All it needs now is some way to keep persistent files and I'll never need another thumb drive to install an OS.
What the heck! How does anything else still exist!
I really despise BE from engineering perspective.
I judge it based on whether I get a bootable bit of flash out the other side.
Even ignoring those last two, which just seem gross, running an entire web browser to accomplish the same thing as a 1MB native application is like using an anvil as a hammer. Yeah, it'll work, but why?
Thouroughly unimpressed with it and any project recommending or even insisting on using it.
I especially like the interface, including the automatic download of the current Windows 10 ISO. I find the whole process (and more importantly, walking others through the process) a breeze.
I like the cheat mode codes that let me walk people through tasks easily, but still retaining functionality I want for myself. https://github.com/pbatard/rufus/wiki/FAQ#Power_keysCheat_mo... Alt+E being one that I use myself, but absolutely would not want enabled for a novice user.
That's not to take anything away from Ventoy (although I'm an IODD user myself). Just saying one is better or worse doesn't feel fair to me.
The best solution so far I've found is to manually partition the USB into a 1GB FAT32 partition and the rest NTFS. Then you extract the files where needed [0]
I learned this method just last year but it seems it's pretty universal. At least for Win10 ISOs. And I don't have to boot Windows and wait for its updates!
[0] https://techbit.ca/2019/02/creating-a-bootable-windows-10-ue...
It is still annoying to have to use Windows to run NTLite. ;)
https://evanshortiss.com/create-a-windows-install-usb-via-ma...
That's what I've done lately, and it works every time with no fuss.
https://www.microsoft.com/en-us/software-download/windows10
Edit: I just remembered that you might not be on a Windows device, in which case you may well want to download the ISO and use Rufus to make a bootable stick from it.
At least that‘s how I do it.
Except for the unfortunate install.wim file. The first releases of Windows 10 were fine, they had it under 4GB, but some of the half-year releases have it grown over 4GB, and FAT32 cannot handle that. Thus all the mitigations you see here.
The Microsoft's USB tool does not use install.wim; it contains install.esd instead. It is basically the same thing, but with different compression, so it is still a bit under 4GB. You can recompress install.wim into install.esd, if you have the inclination ...and a windows machine nearby (dism /export-image).
You download the tool and want to create a Windows 10 bootable USB, so you run the executable.
Then you find out that it won't let you choose where to save the temporary ISO file that it wants to download. It's hardcoded to the C:\ drive which can easily be a small SSD that is already almost full. You grumble a bit, proceed to delete/move some files off of C:\ so that it could download the ISO and then restart the tool.
This time the download finishes successfully, but after the download you get an error because it turns out it wants to extract what it downloaded - and of course hardcoded to the C:\ drive. You moan a bit, proceed to delete/move even more files off of C:\ and restart the tool.
Third time's the charm right? Well after waiting around forever, it has once again downloaded the ISO and this time also extracted it. Then it informs you that it can't actually create the bootable USB stick because it needs to be run as an administrator. You scratch your head in disbelief, wondering why instead of giving you an error message it doesn't just launch a privilege escalation prompt - or at least have the privilege requirement defined in its manifest.
The fourth time has to work. You manually run it as administrator, it re-downloads & re-extracts the ISO, and you still get the error message that it needs to run as an administrator. What is going on? You google for answers and realize that you've found the only Windows app in existence that is not satisfied with mere privilege escalation but instead demands you to be running directly as the administrator.
You log out of your regular user account, log in as the administrator, re-download & re-extract the ISO - and then finally the tool is willing to create the bootable USB.
...
On the other hand it is possible to create the Windows 10 bootable USB with just the command line [1] and this can be done without having the ISO on your C:\ drive, without having to extract the ISO files to a temporary location before being copied to the USB, or having to directly log in as administrator. A simple escalated privilege command prompt will do just fine.
Thus I'm left wondering what is going on at Microsoft. Did they assign some random intern to create the Windows 10 installation media tool? It is very incompetently made.
--
[1] https://davidzych.com/install-windows-10-from-a-usb-flash-dr...
I get the same feeling with a lot of other things in Win10 (which I'm only using because I'm forced to). IMHO it's a sign of the shift to a metrics-driven culture, where the "unquantifiable" parts of quality are being completely ignored in favour of bettering numerical ones. Microsoft isn't the only one, this seems to be happening industry-wide.
If you go to the Windows 10 download page, you can trick it into giving you the ISO by changing your responsive view mode in dev tools to an iPad or something and refreshing the page. Then burn with Rufus.
So long as you enable updates (to enable online functionality), the "SELECT" button has a dropdown to change it to "DOWNLOAD".
Click "DOWNLOAD", it walks you through a script ("Fido") that grabs the latest Windows 10 ISO (and lets you download it directly or using a browser). You can then use that ISO to make your bootable USB.
https://github.com/pbatard/rufus/wiki/FAQ#blah-uefi-blah-fat...
You probably left Secure Boot on. That prevents loading the NTFS UEFI driver.
Sadly most of my clients won't just accept the option of installing Linux ;)
I tried to dig into my documentation for the link that I saved, it doesn't seem like I saved the google search terms for it, but they can be deduced from the link anyway.
1. https://win10.guru/usb-install-media-with-larger-than-4gb-wi...
If you are the sysadmin, put the target computer in a policy group that doesn't include live scanning temporarily.
There are also USB drives you can get that have a write protection switch, but that doesn't mean you will be allowed to actually run the software.
Rufus comes through for me again and again, but why do we need to download a 3rd party tool for even basic configs? Nothing fancy, just a windows installer on USB.
It doesn't support Linux images, though, for reasons that should be obvious.
select disk ##
clean
create partition primary
active
format fs=ntfs quick
assign
Then just extract the disk image to the USB Drive and voila. I just noticed it's even documented on Dell's support page[0]0: https://www.dell.com/support/kbdoc/en-us/000136959/create-a-...
https://www.happyassassin.net/posts/2014/01/25/uefi-boot-how...
> What the firmware will actually do when trying to boot in this way is reasonably simple. The firmware will look through each EFI system partition on the disk in the order they exist on the disk. Within the ESP, it will look for a file with a specific name and location. On an x86-64 PC, it will look for the file \EFI\BOOT\BOOTx64.EFI. What it actually looks for is \EFI\BOOT\BOOT{machine type short-name}.EFI - 'x64' is the "machine type short-name" for x86-64 PCs. The other possibilities are BOOTIA32.EFI (x86-32), BOOTIA64.EFI (Itanium), BOOTARM.EFI (AArch32 - that is, 32-bit ARM) and BOOTAA64.EFI (AArch64 - that is, 64-bit ARM). It will then execute the first qualifying file it finds (obviously, the file needs to be in the executable format defined in the UEFI specification).
The only caveat is you need to make sure each ISO is stored on the USB in a contiguous file, since it tricks the host machine into thinking each ISO is separate partition. It includes a .cmd script for doing this on Windows, or on Linux you can use `rsync —preallocate` to copy the ISOs continuously.
He's actually great, when he's online he has a chat option on his website and he'll help you with any questions you have, I somehow screwed up an E2B MBR and he very graciously walked me through fixing it.
And this happens often enough that it’s worth carrying around a tool to do this? I thought that by now systems would be adequately armoured against this.
In my case, it was necessary because the computer had not been used for months and was unable to connect to various websites, perhaps due to an out-of-date certificate. Rather than troubleshoot the issue, it was easier to just do the refresh.
With windows no automated repair could fix it and the whole system is so opaque that I will probably never know what happened other than it works after reinstall.
Even if nothing ever goes wrong you will eventually need to install to a new system and usb drives are incredibly cheap with a 64GB USB 3.1 weighing in at all of $8-$12. You needn't carry it around just stick it in a desk drawer.
I ran distro upgrade on Fedora and it destroyed my grub. This is unusual, I ran several distro upgrades without issues, but this time it was different.
I am no expert on grub and after spending 20 minutes trying out various solutions from the Internet I gave up and ran a quick reinstall. At least most of it was unattended and I had a clean system as a result.
dd bs=4M if=path/to/archlinux-version-x86_64.iso of=/dev/sdx conv=fsync oflag=direct status=progress
# <image.iso >/dev/sdx; sync
I tried writing something[1] that would be a little smarter than Win32 Disk Imager. That is, it will adjust EFI partition labeling. Otherwise it will just write the image. After some experimentation that is what was needed to get a SmartOS disk image to boot on my old laptop.
It sounds obvious in retrospect, but you can’t use something like dd to write invalid disk partitioning data and expect it to boot. EFI expects there to be a header at the beginning and end of the disk. Furthermore, I can’t try to “optimize” my disk image writer by skipping zeroed sectors and expect everything to work out fine. Without knowledge of the file system format, leaving sectors uncleared causes all kinds of fun data corruption.
Personally I'm a fan of ventoy[0] though it doesn't appear to be installable on mac, but if you set it up on linux/windows you can just drop any iso you want onto it from any system and it'll work like a charm.
Imagine if the binary is 128MB how big the source code repo must be.
As in, even when I turned off 'report usage statistics', it kept making outbound network connections. That was it for me... trust lost; uninstalled immediately.
Only supports Windows, no Linux or macOS support planned.[1]
[1]: https://github.com/pbatard/rufus/wiki/FAQ#do-you-plan-to-por...
EDIT: running on, not creation of boot volumes for
cp my.iso /dev/sdc # cat path/to/archlinux-version-x86_64.iso > /dev/sdx
or
# dd bs=4M if=path/to/archlinux-version-x86_64.iso of=/dev/sdx conv=fsync oflag=direct status=progress
However, this was ridiculously slow. I waited a long time for cat, but not long enough to figure out if it would ever finish. dd reported speeds of less than half a MB/s, gnome-disk-utility was about eight times faster.I wonder if a different set of options to dd would have given better results. From what I can tell, gnome-disk-utility is just open() and write() (with suitable flags) in the end.
1: https://wiki.archlinux.org/title/USB_flash_installation_medi...
Now, you could also do without fsync, and call `sync` at the end, it could be faster.
I used to have a vmware player image that would run pxe boot on a 2nd nic I put in my laptop (USB), but it's been awhile since I've needed to do that.
https://github.com/pbatard/rufus/wiki/FAQ#Saving_an_existing...
I once had an issue using it with a certain computer + SD card adapter combination. I posted some logs and they responded within a few days with a fix. Thank you pbatard!
Anyone has an idea how to artificially limit write speed besides running it over a USB 1 hub?
Unfortunately install.wim on that image is bigger than the FAT32 max file size. Meaning that while the USB booted in the system, the installation was not possible.
Of course the installer doesn’t keep the disk image it downloads to make the usb, so it’s another 5-6G download to try again - this may be problematic for people on limited bandwidth connections.
Personally I just created an NTFS partition on my USB drive and copied the contents of another windows iso over to it.
Anytime that USB drive was stuck in a computer on boot it would be able to half boot tails.
I ended up having to use dd to wipe it and all was good.
(I don't mean Ubuntu Live, I'm talking about a full-fledged install which works on BIOSes that are picky about things like EFI).
You don't need any of this shit. Partition the drive as NTFS, mark the partition as active through Disk Management, and simply copy and paste the contents of the iso into the drive.
For maximum compatibility, just use FAT32 instead of NTFS. The official images will fit in a FAT32 volume. If you have a custom image that's more than the 4GB max file size of FAT32, and your device doesn't support ntfs or exfat, then you can use a single command to split the wim file into multiple chunks as explained here https://docs.microsoft.com/en-us/windows-hardware/manufactur...
Rufus also tends to format the drive strangely for *nix ISO files also. Last time I used it the write operation failed and I was stuck spending more time than necessary repairing the drive's partitions just to make it visible to my machine again. What compounds this is the documentation which can only be described as condescending and hostile.
If memory serves, there's a section in the documentation's FAQ where the author spends a paragraph first telling you that it's good your having problems with your USB drive since it will teach you a lesson. I can never understand why some documentation writers feel the need to take digs at their users. Very odd.
Some official Windows 10 images, as of a few years ago, no longer fit on FAT32 volumes and need to be split. The official Microsoft tool does not work on Linux, so I use WoeUSB for that, which in my experience has worked fine with Secure Boot.
rufus on the other hand always works without issue
Left me puzzled with regard to why copying over a new image still led to the older one booting for a while.
Switching to a different USB slot (2 VS 3) solved it, iirc (and I think I never used Rufus again).
Its a lot less hit or miss with Windows ISOs, but Linux ones can be VERY finicky.
Usually `dd` is good enough for Linux/Unix disk images, and preparing an exFAT/NTFS thumb drive (your mileage may vary on whether exFAT is supported on your system) and copying the contents over with `rsync` works good for windows 7+ images
But at least good ole Rufus works :) Wish we could get something like Rufus (or even better, YUMMI) working perfectly on Linux
like: cat ubuntu.iso >/dev/sdd
or
dd if=./ubuntu.iso of=/dev/sdd
That was a neat trick. Thank you for mentioning it.