After you have obtained a Mender disk image, you need to write it to the storage of the device.
You need an image file to flash to the entire storage of the device. This section assumes that you already have one. If not, please visit Convert a Mender Debian image.
Image files end with the three letters
img, but not necessarily only those three letters. Common
.sdimg. Sometimes the image is compressed in which case there
may be an additional
.zip suffix. If the image is compressed, you need to
uncompress it first with one of the commands below:
# For gz compressed images.
# For xz compressed images.
# For zip compressed images.
In this initial provisioning you will flash and overwrite everything on the given device storage.
There are several methods to flash storage, and the simplest case is if your device uses an SD card. Currently, this is the approach we assume you take here, but you can use the image file to flash any block device.
Be careful! If you point to the wrong
<DEVICE> when executing the command below, you risk
overwriting your workstation's local or connected storage devices.
You can write the image to the SD card using the following command:
sudo dd if=<PATH-TO-IMAGE>.img of=<DEVICE> bs=4M && sync
<DEVICE> depends on where you placed your SD card. Normally this would be something like
/dev/sdb. If you are unsure how to find the correct device, the Raspberry Pi
Foundation provides some nice references that can help you for
The flashing may take a few minutes, depending on the size of the image.
Tip: Many versions of
dd support adding the
oflag=sync status=progress arguments to get
progress information during the flashing. To try it out, use the command
sudo dd if=<PATH-TO-IMAGE>.img of=<DEVICE> bs=4M oflag=sync status=progress instead of the command
above. Not all versions of
dd support these arguments.
© 2024 Northern.tech AS