# Booting a converted image from USB

**URL:** <https://hub.mender.io/t/booting-a-converted-image-from-usb/4197>\
**Category:** General Discussions\
**Tags:** raspberry-pi-4, boot, usb\
**Created:** [October 18, 2021, 4:48pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197 "2021-10-18T16:48:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdynes](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sdynes](https://hub.mender.io/u/sdynes)\
**Post date:** [October 18, 2021, 4:48pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/1 "2021-10-18T16:48:22Z")

</div>

Hello -

I would very much like to use Mender to manage a fleet of RPi4 things that will sporadically connect via cell modem and (less often) Wifi. SD cards are too slow for a satisfactory uesr experience, and so we are using fast USB devices. The delta update capability is important.

I’ve spent the past week or two learning how to connect devices to Mender Hub, creating and updating via artifacts, and mender-converting our .img files.

What I can’t figure out how to do is to get the RPi4 to boot from a converted img file that is copied to the USB stick using the RPI imager. I’ve tried adding a 'MENDER\_STORAGE\_DEVICE=/dev/sda ’ --config file to the mender-convert options with no success.

I would think lots of folks are (or want to be) booting RPis from USB, but can’t find much about doing this other than [Pi3 USB boot support](https://hub.mender.io/t/pi3-usb-boot-support/595).

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [October 18, 2021, 5:16pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/2 "2021-10-18T17:16:58Z")

</div>

I haven’t tested this with raspberry pi, but for general booting from various media in a kernel name agnostic way, I use the partuuid feature of mender config to reference boot devices and its partitions, usb booting being one of the motivations for my developers to easily test iterations.

---

<div class="post-metadata">

**Author:** ![sdynes](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sdynes](https://hub.mender.io/u/sdynes)\
**Post date:** [October 18, 2021, 7:45pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/3 "2021-10-18T19:45:02Z")

</div>

@dellgreen Thanks for the pointer - this makes sense. I will try to make this work for me.

---

<div class="post-metadata">

**Author:** ![sdynes](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sdynes](https://hub.mender.io/u/sdynes)\
**Post date:** [October 19, 2021, 7:18pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/4 "2021-10-19T19:18:31Z")

</div>

Hello -

So I tried mender-convert with the raspi lite image, and a config file that includes:

MENDER\_STORAGE\_DEVICE = “/dev/sda”  
MENDER\_STORAGE\_DEVICE\_BASE = “${MENDER\_STORAGE\_DEVICE}”  
MENDER\_BOOT\_PART = “${MENDER\_STORAGE\_DEVICE\_BASE}1”  
MENDER\_ROOTFS\_PART\_A = “${MENDER\_STORAGE\_DEVICE\_BASE}2”  
MENDER\_ROOTFS\_PART\_B = “${MENDER\_STORAGE\_DEVICE\_BASE}3”  
MENDER\_DATA\_PART = “${MENDER\_STORAGE\_DEVICE\_BASE}5”

The conversion without the above and put on an SD card boots fine, but a conversion with the above and put on a USB stick doesn’t boot. The Pi will boot from other USB sticks.

I’m hoping this is obvious to those who know, but I am yet in that group.

Any help would be very welcome.

---

<div class="post-metadata">

**Author:** ![sdynes](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sdynes](https://hub.mender.io/u/sdynes)\
**Post date:** [October 21, 2021, 6:33pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/5 "2021-10-21T18:33:51Z")

</div>

I spent more time tracking down this issue, and my current thinking is that the challenge is in the u-boot boot.scr. Even when setting the MENDER\_STORAGE\_DEVICE etc. as /dev/sda, the u-boot boot.scr has:

mmc dev ${mender\_uboot\_dev}

where the mmc tries to load the image from an SD card, which I’m trying to not use.

Are there switches or config files where I can get the boot.scr file generated with the needed USB command, e.g.

ums 0 usb 1:2?

Or is the expectation that there will always be an SD card for the U-boot, which might then point to an USB drive for the second A/B images?

Thanks!

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [November 19, 2021, 2:25pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/6 "2021-11-19T14:25:26Z")

</div>

> [@sdynes](#):
>
> Or is the expectation that there will always be an SD card for the U-boot, which might then point to an USB drive for the second A/B images?

This is not a requirement for Mender. In fact, in most cases U-Boot and the A/B images are on the same drive. Raspberry Pi is a bit of a special case since it has custom compiled U-Boot which is downloaded during the image conversion process. I think this is [hard coded](https://github.com/mendersoftware/uboot-mender/blob/mender-rpi-2020.01/include/config_mender_defines.h#L14-L15) to point to the SD card.

You could try to change this to “usb”, recompile U-Boot, and then change [the link for the U-Boot binary](https://github.com/mendersoftware/mender-convert/blob/master/configs/raspberrypi_config#L13-L14) to point to a local file before you convert a new image.

---

<div class="post-metadata">

**Author:** ![SpaceAce](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@SpaceAce](https://hub.mender.io/u/SpaceAce)\
**Post date:** [March 10, 2022, 4:51pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/7 "2022-03-10T16:51:08Z")

</div>

Did you ever manage to figure this out? I’m trying to migrate from SD card to USB but have hit the same issue on CM4.

Thank you.

---

<div class="post-metadata">

**Author:** ![mender1234](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mender1234](https://hub.mender.io/u/mender1234)\
**Post date:** [March 4, 2024, 3:26pm UTC](https://hub.mender.io/t/booting-a-converted-image-from-usb/4197/8 "2024-03-04T15:26:19Z")

</div>

Having same issue here. Tried a lot of different ways but cannot get it work. Anybody solved the issue?
