You can use dd
.
sudo umount /dev/sd<?><?>
where <?><?>
is a letter followed by a number, look it up by running lsblk
.
It will look something like
sdb 8:16 1 14.9G 0 disk
├─sdb1 8:17 1 1.6G 0 part /media/username/usb volume name
└─sdb2 8:18 1 2.4M 0 part
I would dismount sdb1.
Then, next (this is a destructive command and wipes the entire USB drive with the contents of the iso, so be careful):
sudo dd bs=4M if=path/to/input.iso of=/dev/sd<?> conv=fdatasync status=progress
where input.iso
is the input file, and /dev/sd<?>
is the USB device you're writing to (run lsblk
to see all drives to find out what <?>
is for your USB).
This method is fast and has never failed me.
EDIT: for those on a Mac ending up here, use lowercase for bs=4m
:
sudo dd if=inputfile.img of=/dev/disk<?> bs=4m && sync
EDIT: If USB drive does not boot (this happened to me), it is because the target is a particular partition on the drive instead of the drive. So the target needs to be /dev/sdc and not dev/sdc <?>
For me it was /dev/sdb .
Reference: https://superuser.com/a/407327 and https://askubuntu.com/a/579615/669976
If you run Startup Disk Creator, you'll notice that it does three (four) things:
- Format the drive
- Copy over the data from the ISO to the drive
- (Add an extra casper1 file for persistence, if selected.
dd
does not give you persistence.)
- Install a bootloader
It is not a GUI for dd
(there are GUIs for dd
, but SDC is not one of those).
You can think of it as doing equivalent of Arch Linux's or Gentoo's manual methods. You should be able to create a bootable USB using most (reasonably popular) distros' installation ISOs at present. This was not true about three or four years ago, when I looked at Arch. It was only 2010 that all Arch ISOs gained this feature (where you could write it directly to a USB drive) - from 2008 to 2010 they had special USB images.
Further, if you dd
a drive directly, that drive is effectively read-only until you format it or use the remaining space somehow. A SCD-created disk is still usable as a USB drive, even though the contents are are not accessible from the live environment easily. So if you dd
a 1GB ISO to a 8 or 16 GB USB drive, you're effectively abandoning the remaining space unless extra steps are taken.
1Typically, most live images use a SquashFS file for the root partition. SquashFS is read-only, so for persistence, a casper-rw
file is created in /casper
. I am not sure of the origins of casper
. From what I understand, when booted with the boot=casper
option, the kernel overlays the casper file (creating one if none exists) on top of the squashfs, so that it gains write capability. casper
doesn't have to be a file, it can also be a partition.
Best Answer
Depending on how you created the USB boot drive, it will be read-write or read-only.
Cloned drive
A cloned drive created with the 'Startup Disk Creator' in Ubuntu 16.04 LTS or newer versions, has a hybrid iso9660 file system, which works both in DVDs and USB pendrives (and memory cards), but it is read-only by design, so you cannot edit anything in it. Also 'Disks' alias
gnome-disks
, and 'mkusb' (when cloning and creating live-only drives) make USB drives with a hybrid iso9660 file system.Extracted drive
An extracted drive, for example
can be edited. You can add
nomodeset
and other boot options to the boot configuration file, so that they will persist (survive to be used in the future). Editboot/grub/grub.cfg
in partition #3, 'usbboot' for mkusb. You may need to boot from another drive in order to mount the FAT32 file system read-write for Rufus.New tips to make your USB boot drive with Ubuntu 19.10+
You can edit your binary iso file and replace the cosmetic boot options
quiet splash
with the boot option'persistent '
or'nopersistent'
(the strings contain 12 characters, so the replacement can be done without any offset in the following part(s) of the iso file. You can do it withsed
and clone the modified iso file, or flash directly with
where x is the device letter for the USB pendrive.
You can do it with a safety belt using
mkusb-minp
It is more convenient and also safer to use
mkusb-plug
for the whole process including thesed
commands, and there is a graphical user interface.You can do it yourself with an extracting method and get whatever combinations of boot options, that you like, according to this link