# Adding mender-partuuid causes an error: "/dev/sda1 Does not contain a valid PARTUUID path"

**URL:** <https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992>\
**Category:** General Discussions\
**Tags:** yocto, thud\
**Created:** [September 9, 2019, 12:03pm UTC](https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992 "2019-09-09T12:03:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![c3ntry](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/c3ntry/32/677_2.png) [@c3ntry](https://hub.mender.io/u/c3ntry)\
**Post date:** [September 9, 2019, 12:03pm UTC](https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992/1 "2019-09-09T12:03:42Z")

</div>

Hello,

my device uses it’s USB ports for the initial network configuration, so the user plugs in USB drives which makes it very likely that someday my device will be rebooted while a USB drive is still present.

As rreignier mentiond in his [thread](https://hub.mender.io/t/force-grub-to-select-emmc-when-flash-drive-plugged-in/725) booting with a plugged in flash drive, grup boots into the grub cli instead of starting the os from the internal drive (An SSD in my case). As I am using yocto-thud I am trying the suggested solution from rreignier’s thread: I have added “mender-partuuid” to “MENDER\_FEATURES\_ENABLE\_append”, but now when I am trying to build an Image I am getting the following errors:

```auto
Loading cache: 100% |####################################################################################################################################################| Time: 0:00:00
Loaded 98 entries from dependency cache.
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb: /dev/sda1 Does not contain a valid PARTUUID path | ETA: 0:00:40
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb: /dev/sda1 Does not contain a valid PARTUUID path
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-controller.bb
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb: /dev/sda1 Does not contain a valid PARTUUID path
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb: /dev/sda1 Does not contain a valid PARTUUID path
ERROR: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb: /dev/sda1 Does not contain a valid PARTUUID path
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-guest.bb
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb: Exception during build_dependencies for mender_update_fstab_file
WARNING: /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb: Error during finalise of /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/cloud-image-compute.bb
ERROR: ExpansionError during parsing /home/parallels/Documents/yocto/poky/meta-virtualization/recipes-extended/images/xen-image-minimal.bb
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable mender_update_fstab_file, expression was local tmpBootPart="/dev/sda1"
    local tmpDataPart="/dev/sda4"
    if ${@bb.utils.contains('DISTRO_FEATURES', 'mender-partuuid', 'true', 'false', d)}; then
        tmpBootPart="PARTUUID=${@mender_get_partuuid_from_device(d, '/dev/sda1')}"
        tmpDataPart="PARTUUID=${@mender_get_partuuid_from_device(d, '/dev/sda4')}"
    fi

    if ! ${@bb.utils.contains('DISTRO_FEATURES', 'mender-image-ubi', 'true', 'false', d)}; then
        if ["16" != "0"] && [-n "/dev/sda1"]; then
            echo "# Where the U-Boot environment resides; for devices with SD card support ONLY!" >> /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/etc/fstab
            mkdir -p /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs//boot/efi
            printf "%-20s %-20s %-10s %-21s %-2s %s\n" ${tmpBootPart} /boot/efi auto defaults,sync 0 0 >> /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/etc/fstab
        else
            bbdebug 2 "MENDER_BOOT_PART not applicable. Not adding to fstab..."
        fi
    fi

    mkdir -p /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/data
    printf "%-20s %-20s %-10s %-21s %-2s %s\n" ${tmpDataPart} /data auto defaults 0 0 >> /home/parallels/Documents/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/xen-image-minimal/1.0-r0/rootfs/etc/fstab
 which triggered exception BBHandledException: 

Summary: There were 11 WARNING messages shown.
Summary: There were 6 ERROR messages shown, returning a non-zero exit code.

```

I know, as mentioned in the other thread, the feature isn’t fully documented yet, but maybe someone knows what the problem is.

Any help would be greatly appreciated.

Best regards,  
c3ntry

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 9, 2019, 12:20pm UTC](https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992/2 "2019-09-09T12:20:25Z")

</div>

You are using `thud` branch of meta-mender? Can you also share the configuration options in `local.conf`.

Also please note that `mender-partuuid` will not solve your problem, see my comment here,

> [@Force Grub to select eMMC when Flash Drive plugged in](https://hub.mender.io/t/force-grub-to-select-emmc-when-flash-drive-plugged-in/725/11):
>
> Makes sense now, that partuuid only applies to the mender\_root variable and not to the mender\_grub\_storage\_device. I can not think of an easy way to get around this, because GRUB is not able to scan/probe for a partuuid. But I know of one user who has solved a similar problem using the GRUB [search](https://www.gnu.org/software/grub/manual/grub/grub.html#search) command, which supports looking up filesystem image by label or fs-uuid. But this would require changes to the grub.cfg file + making sure that the partitions are labeled accordingly on each update.

---

<div class="post-metadata">

**Author:** ![c3ntry](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/c3ntry/32/677_2.png) [@c3ntry](https://hub.mender.io/u/c3ntry)\
**Post date:** [September 9, 2019, 1:38pm UTC](https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992/3 "2019-09-09T13:38:16Z")

</div>

I am using the the thud branch of meta-mender.

I somehow missed your answer on the other thread, sorry.

If I use the search command with the fs-uuid, how could I update the grub.cfg without interfering with the mender configuration for grub? Can the fs-uuid change between older & newer .uefiimg images (installed directly using dd, not via mender update - for newer devices)?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 9, 2019, 1:58pm UTC](https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992/4 "2019-09-09T13:58:06Z")

</div>

> If I use the search command with the fs-uuid, how could I update the grub.cfg without interfering with the mender configuration for grub?

This would require some significant effort to do, but this is probably the location to update.

> <https://github.com/mendersoftware/grub-mender-grubenv/blob/master/90_mender_boot_grub.cfg>

> Can the fs-uuid change between older & newer .uefiimg images (installed directly using dd, not via mender update - for newer devices)?

Yes, fs-uuid changes between uefiimgs, it also changes between Mender Artifact updates. So this needs to be resolving using some “smart” state-scripting.

---

<div class="post-metadata">

**Author:** ![mdavis777](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mdavis777/32/65_2.png) [@mdavis777](https://hub.mender.io/u/mdavis777)\
**Post date:** [September 16, 2019, 2:22pm UTC](https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992/5 "2019-09-16T14:22:33Z")

</div>

I somewhat solved this issue back when I implemented partuuid.  
A small secret about the grub disk order is that it is derived from the BIOS boot priority order (in most cases). So if the disk you have grub on is highest in boot priority there is a good chance it will always be hd0 regardless of new media being added.

Not a perfect solution but it should cover most embedded cases where someone isn’t expecting to boot from a different device.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [March 28, 2020, 3:22pm UTC](https://hub.mender.io/t/adding-mender-partuuid-causes-an-error-dev-sda1-does-not-contain-a-valid-partuuid-path/992/6 "2020-03-28T15:22:24Z")

</div>

FYI, there are changed up for merge that will resolve this, meaning that `mender_grub_storage_device` is dynamically determined at run-time.

> <https://github.com/mendersoftware/meta-mender/pull/951>
