So I’ve been looking high and low for some type of tool to create a bootable USB with an image file. If you know of a tool that I can download to dietpi I would greatly appreciate it.
what exactly you are looking for? Maybe you can describe your use case more in detail. USB boot depends on device/SBC type.
I downloaded an image file that I want to use to make a USB bootable drive. I have the image file on my dietpi desktop but when I right click it I see no option to create a bootable drive. I look through all the software and utilities and it’s not one tool to do this. I was looking for something like Rufus.
I’m on a raspberry pi4 by the way.
simply flash the img file to a USB drive and attach it to your RPi4. If mass storage boot has been enabled on the RPi4, it should boot right away. This way my production RPI4B is working since ages.
Or do you mean something else? Like whatever image (not DietPi) and you want to create a bootable USB drive for a complete different computer?
I want to create a boot drive for my Steam deck. The image is really big around 1 terabyte and it’s on my raspberry pi which is using dietpi. Instead of pulling the image off my raspberry pie onto another USB just to bring it over to my windows PC, I was wondering if there was a utility where I can create a bootable drive right on my raspberry pi.
we don’t have such a tool available ootb. Do you know of the img contains a boot partition? If yes, it should be possible to us dd
command to falsh the img directly.
Are you saying within the image? I would suppose so. It’s Batocera os. That’s the image file.
than try using dd
command to write the image directly to USB drive.
So I just did research on the DD command because I didn’t even know it existed but it seems pretty simple. So it’s basically input file equals whatever the file is output to SDA SDB SDC whichever the drive is on with BS equal 1 megabyte as far as transfer data and conv=sync to synchronize the data on the drive and status=progress to see some type of progress bar or percentage. I’m hoping that I got the DD command understood.
Not necessarily needed and slows down the procedure. Linux of course syncs changes from cache to disk when needed. This is more a safety measure when writing small essential parts, like a bootloader image, to a specific area of the drive.
Note that dd
copies the whole disk bit by bit, including empty space and holes, so it is naturally very slow. To speed things up, reduce the image size and reduce overall disk writes, you could minimise the partition size before creating the image, e.g. using our imager tool:
bash -c "$(curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-imager')"
We use this for our DietPi image creation, but it actually is a wrapper to dd
and can be used for any disk image. It:
- minimises the last included filesystem and partition, usually the rootfs
- check all filesystems for consistency
- overwrites empty space with zero’s on ext4 to allow better compression
- flushes the ext4 journal to further reduce data size
- creates the minimised disk image with
dd
and compresses it automatically
It can then be usually flashed back as well to smaller disks as well. But you need to again expand partition and filesystem, like:
sfdisk --no-reread --no-tell-kernel -fN2 /dev/sda <<< ',+'
partprobe /dev/sda
resize2fs /dev/sda2
assuming /dev/sda
being the system drive and /dev/sda2
the rootfs/last partition. Adjust where needed.
@MichaIng it’s already an img file of Batocera os that should be written to USB and not a partition or disc to clone.
That is correct. I’m writing an image to a drive.
Whoops, not sure how I could have misunderstood . Then
dd
is indeed my first thought as well.
BelanaEtcher is a well known trusted GUI tool indeed, which probably flashes faster. Apart of the ARM packages (and build script) WarHawk linked, there is also an official APT repository, but for x86_64
only: GitHub - balena-io/etcher: Flash OS images to SD cards & USB drives, safely and easily.
There is also a slim alternative USBImager: Files · binaries · bzt / usbimager · GitLab