# QEMU KVM vs Hyper-V /dev/sdX or /dev/vdX

**URL:** https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254
**Category:** Board Integrations
**Tags:** qemu, qemux86-64
**Created:** [September 15, 2022, 10:23am UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254 "2022-09-15T10:23:34Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)
#### Post date: [September 15, 2022, 10:23am UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/1 "2022-09-15T10:23:34Z")

</div>

Hi,

I first used mender with a IMX board and now I also use it with QEMU machine for testing and easy deployement as a Virtual Machine.

My issue is that with KVM the disk is launched as a paravirtualized disk and Linux mount it as /dev/vda  
whereas on Microsoft Hyper-V the disk is laucned as fully-virtualized and Linux mount is as /dev/sda

Is there a way to have the same image compatible with both KVM and Hyper-V ?

Thanks for your help

---

<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: [September 15, 2022, 11:12am UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/2 "2022-09-15T11:12:57Z")

</div>

Hi, I use the partuuid feature to reference partitions in mender setup for exactly these type of situations, as well as being able to boot the same image from USB sticks.

I have only tested with mender-convert see variables here:

> <https://github.com/mendersoftware/mender-convert/pull/220>
>
> Partition UUID support added for gpt and dos partition tables for deterministic …booting
>     
> \[Issue: MEN-3725\](https://tracker.mender.io/browse/MEN-3725)    
> 
> The following new config variables have been added which closely mirror those used in meta-mender
> to give fine grained controll over partition device paths. If partuuid support is enabled then
> these partition variables must be used as format doesnt fit device/number variables scheme.
> If partuuid support is disabled then partition variables are optional liek in meta-mender.
>     
> 
> \- MENDER\_ENABLE\_PARTUUID
> \- MENDER\_BOOT\_PART
> \- MENDER\_ROOTFS\_PART\_A
> \- MENDER\_ROOTFS\_PART\_B
> \- MENDER\_DATA\_PART
> 
> 
> \`\`\`
> Example:
> MENDER\_BOOT\_PART="/dev/disk/by-partuuid/26445670-f37c-408b-be2c-3ef419866620" #gpt
> MENDER\_BOOT\_PART="/dev/disk/by-partuuid/26445670-01" #dos
> MENDER\_BOOT\_PART="/dev/sda1" #partuuid support disabled
> \`\`\`

Yocto meta-mender also has support with mender-partuuid feature

> **[Features | Mender documentation](https://docs.mender.io/system-updates-yocto-project/image-customization/features#list-of-features)**
>
> Mender documentation

---

<div class="post-metadata">

### Author: ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)
#### Post date: [September 15, 2022, 12:43pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/3 "2022-09-15T12:43:38Z")

</div>

Hi,

Indeed it could be a good fix, I’m already using the LABEL instead of PartUUID to detect /data and /boot  
because the Part UUID were not equal regarding hardwares (see: [Introduce partlabel feature to find partition by their label by clementperon · Pull Request #1543 · mendersoftware/meta-mender · GitHub](https://github.com/mendersoftware/meta-mender/pull/1543)).

Could it be a nice feature to introduce label for ROOTFS\_A and ROOTFS\_B ?  
@kacf @lluiscampos what do you think?

---

<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: [September 15, 2022, 1:29pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/4 "2022-09-15T13:29:56Z")

</div>

> because the Part UUID were not equal regarding hardwares

Are you able to elaborate on this further?

---

<div class="post-metadata">

### Author: ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)
#### Post date: [September 15, 2022, 1:48pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/5 "2022-09-15T13:48:23Z")

</div>

I have different hardware ARM / x86 and now QEMU, If I do blkid to look for the PartUUID each hardware have a different one. So i choose to use the label which were present on all hardware.

---

<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: [September 15, 2022, 2:07pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/6 "2022-09-15T14:07:07Z")

</div>

With PARTUUID, you set it to what you want to embed in the device’s GPT partition table in the mender config, this is different from the UUID which is globally unique per device.

---

<div class="post-metadata">

### Author: ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)
#### Post date: [September 15, 2022, 3:55pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/7 "2022-09-15T15:55:18Z")

</div>

Sorry I meant the hardware has been alread shipped and is used on-the-field.

My first hardware was built on Zeus release when I look at the boot partition for example PartUUID using blkid  
TYPE=“vfat” PARTUUID=“41b418dd-01”  
Second hardware X86  
TYPE=“vfat” PARTUUID=“bbc1178a-7f7f-4719-baa6-7d616155adcd”  
And my latest hardware QEMU  
TYPE=“vfat” PARTUUID=“994c8c84-3c62-4538-94d3-64a33ada7822”

---

<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: [September 15, 2022, 4:33pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/8 "2022-09-15T16:33:49Z")

</div>

Ah, if it’s already shipped, then it’s probably safer to stick with what you are using then

---

<div class="post-metadata">

### Author: ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)
#### Post date: [September 22, 2022, 1:40pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/9 "2022-09-22T13:40:55Z")

</div>

After talking with @kacf,

I think I will switch to PARTUUID, as explained by @kacf the LABEL are not “stuck” to the GPT partition table but to the partition itself.  
Whereas PARTUUID and PARTLABEL are defined in the GPT partition table, so they are less likely to be changed.

Thanks for your help @dellgreen 🙂

---

<div class="post-metadata">

### Author: ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)
#### Post date: [September 30, 2022, 3:31pm UTC](https://hub.mender.io/t/qemu-kvm-vs-hyper-v-dev-sdx-or-dev-vdx/5254/10 "2022-09-30T15:31:50Z")

</div>

Just replying to myself in case someone has the same issue.

Instead of migrating to PARTUUID, I will do a mix between LABEL and PARTUUID.

I will keep the LABEL for boot and data partitions in /etc/fstab/  
And generate new images / bootloader with PARTUUID support.

This will avoid a migration on the machine already shipped.

(This is actually not supported by mender but I could open a MR not sure it will be accepted)
