# Crypted partition not unlockable after mender-convert

**URL:** <https://hub.mender.io/t/crypted-partition-not-unlockable-after-mender-convert/3657>\
**Category:** General Discussions\
**Tags:** mender-convert\
**Created:** [May 20, 2021, 5:23pm UTC](https://hub.mender.io/t/crypted-partition-not-unlockable-after-mender-convert/3657 "2021-05-20T17:23:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![profff](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/profff/32/1117_2.png) [@profff](https://hub.mender.io/u/profff)\
**Post date:** [May 20, 2021, 5:23pm UTC](https://hub.mender.io/t/crypted-partition-not-unlockable-after-mender-convert/3657/1 "2021-05-20T17:23:53Z")

</div>

I’ve made a golden image that include an encrypted partition

```auto
Device Boot Start End Sectors Size Id Type
input/2021-05-20_17-55-08-DVMC-AQ-dev.img1 8192 532479 524288 256M c W95 FAT32 (LBA)
input/2021-05-20_17-55-08-DVMC-AQ-dev.img2 532480 8728575 8196096 3,9G 83 Linux
input/2021-05-20_17-55-08-DVMC-AQ-dev.img3 8728576 9035775 307200 150M 83 Linux

```

the 3rd one 150MB sized in the list above  
it’s bind to `/dev/mmcblk0p3` before mender conversion

But I think I miss some config when running mender-convert because after converting  
it change of name (`/dev/mmcblk0p4` but it’s not a big deal) but it change of size and I cant unlock it any more

```auto
Device Boot Start End Sectors Size Id Type
deploy/2021-05-20_17-55-08-DVMC-AQ-dev-DVMissionComp-dev-mender.img1 * 24576 548863 524288 256M c W95 FAT32 (LBA
deploy/2021-05-20_17-55-08-DVMC-AQ-dev-DVMissionComp-dev-mender.img2 548864 14467071 13918208 6,7G 83 Linux
deploy/2021-05-20_17-55-08-DVMC-AQ-dev-DVMissionComp-dev-mender.img3 14467072 28385279 13918208 6,7G 83 Linux
deploy/2021-05-20_17-55-08-DVMC-AQ-dev-DVMissionComp-dev-mender.img4 28385280 28647423 262144 128M 83 Linux

```

128MB left on partition

it looks that it lost somewhere that it’s a LUKS partition because when trying to unlock it in the mender converted image :

```auto
$ sudo cat /data/masterkey.pem | sudo cryptsetup open /dev/mmcblk0p4 dm -
Device /dev/mmcblk0p4 is not a valid LUKS device. 

```

any idea would be much appreciated it’s my last issue before running in production !!  
thank’s a lot

---

<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:** [May 20, 2021, 7:13pm UTC](https://hub.mender.io/t/crypted-partition-not-unlockable-after-mender-convert/3657/2 "2021-05-20T19:13:13Z")

</div>

I’m fairly sure this is not supported as mender-convert doesn’t preserve your partitons. Just the contents of your single root partition in the golden image and creates the data partition from the contents of the /data directory on the golden image root partition. mmcblk0p4 will be the data partition.

---

<div class="post-metadata">

**Author:** ![profff](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/profff/32/1117_2.png) [@profff](https://hub.mender.io/u/profff)\
**Post date:** [May 21, 2021, 7:38am UTC](https://hub.mender.io/t/crypted-partition-not-unlockable-after-mender-convert/3657/3 "2021-05-21T07:38:49Z")

</div>

I’m so sory I should have understand that alone and earlier I will try to mod the mender convert for importing directly any added partition  
i was not awaked yesterday all my apologies

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [September 21, 2021, 11:58am UTC](https://hub.mender.io/t/crypted-partition-not-unlockable-after-mender-convert/3657/5 "2021-09-21T11:58:11Z")

</div>

@profff do you have any update on adding LUKS support to mender convert before I start looking into it? Thanks.
