# X86\_64 system showing grub prompt after debian image conversion

**URL:** <https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755>\
**Category:** General Discussions\
**Created:** [June 16, 2021, 9:06pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755 "2021-06-16T21:06:19Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![francoislefebvre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/francoislefebvre/32/1238_2.png) [@francoislefebvre](https://hub.mender.io/u/francoislefebvre)\
**Post date:** [June 16, 2021, 9:06pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/1 "2021-06-16T21:06:19Z")

</div>

Hi,

I am trying to setup a system with debian on x86\_64 system.

After following the steps for conversion, I get showed the grub prompt, but still can boot the system manually.

What is wrong. I would like the system to boot debian automatically, as usual.

Here are the steps I followed.

- Install debian on the system
- Export part of the disk image including both efi and root partitions as suggested in mender-convert `configs/generic_x86-64_hdd_config`.
- Fix the GPT.
- Run conversion successfully
- Flash the system back with the converted image.
- Fix the GPT once again (`sgdisk -e /dev/sda`)

Now, I get the following file tree in the efi partition:

```auto
/boot
├── config-4.19.0-16-amd64
├── efi
│ └── EFI
│ ├── BOOT
│ │ ├── bootx64.efi
│ │ ├── grub.cfg
│ │ ├── mender_grubenv1
│ │ │ ├── env
│ │ │ ├── lock
│ │ │ └── lock.sha256sum
│ │ └── mender_grubenv2
│ │ ├── env
│ │ ├── lock
│ │ └── lock.sha256sum
│ └── debian
│ ├── BOOTX64.CSV
│ ├── fbx64.efi
│ ├── grub.cfg
│ ├── grubx64.efi
│ ├── mmx64.efi
│ └── shimx64.efi
├── grub
│ ├── fonts
│ │ └── unicode.pf2
│ ├── grub.cfg
│ ├── grubenv
│ ├── locale
│ │ ├── ast.mo
│ │ ├── ca.mo
│ │ ├── da.mo
...
│ ├── unicode.pf2
│ └── x86_64-efi
│ ├── acpi.mod
│ ├── adler32.mod
│ ├── affs.mod
...
├── initrd -> initrd.img-4.19.0-16-amd64
├── initrd.img-4.19.0-16-amd64
├── kernel -> vmlinuz-4.19.0-16-amd64
├── System.map-4.19.0-16-amd64
└── vmlinuz-4.19.0-16-amd64

```

Thanks for you help,

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [June 17, 2021, 2:01pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/2 "2021-06-17T14:01:57Z")

</div>

How are you able to boot manually? I’m having difficulty following the steps here.

Why do you need to fix the GPT?

If you export the _entire_ disk image does it behave the same?

Drew

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://hub.mender.io/u/daniel1)\
**Post date:** [June 17, 2021, 6:50pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/3 "2021-06-17T18:50:23Z")

</div>

Hi.  
same problem here. I converted Debian Buster, with mender-convert 2.4.  
For me it looks like the EFI is using grub.cfg in folder “debian”, but the right one is grub.cfg in folder /efi/EFI/BOOT/  
If I reached grub prompt, I manually changed to the right grub.cfg by typing  
configfile /efi/boot/grub.cfg  
The System tries to start, but it cant. "error: can’t find command “hashsum”.  
If I edit the grub.cfg and comment out the functioncall “function mender\_check\_and\_restore\_env”, the system is starting up. But mender is not working how it should.

For fun I copied the content from /efi/EFI/BOOT to /efi/EFI/debian (overwrite existing in debian) and changed the one functioncall in grub.cfg. The system is starting up, every time I like to start, but without changing partition after successfull update.  
For me it sounds like the same problem, that’s yours. I’m glad if someone can help.

Sorry for my bad english and thank’s a lot,  
Daniel

---

<div class="post-metadata">

**Author:** ![francoislefebvre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/francoislefebvre/32/1238_2.png) [@francoislefebvre](https://hub.mender.io/u/francoislefebvre)\
**Post date:** [June 17, 2021, 8:55pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/4 "2021-06-17T20:55:21Z")

</div>

I boot manually to the first rootfs partition

```auto
linux (hd0,2)/boot/vmlinuz-4.19.0-16-amd64 root=/dev/sda2
initrd (hd0,2)/boot/initrd.img-4.19.0-16-amd64
boot

```

I did fix the GPT 1) bacause I only copied a part of my voluminous hard drive. This is what is also suggested in `mender-convert` repo, file `counfigs/generic_x86-64_hdd_config` (for the other partition not copied (swap?) and for the backup gpt table at the end of the disk not being copied either, I guess).

I also tried with an image installed on a small usb drive, exporting the entire disk, without the need to fix GPT, and I got the same result after converting the disk image.

---

<div class="post-metadata">

**Author:** ![francoislefebvre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/francoislefebvre/32/1238_2.png) [@francoislefebvre](https://hub.mender.io/u/francoislefebvre)\
**Post date:** [June 17, 2021, 8:56pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/5 "2021-06-17T20:56:16Z")

</div>

We might be facing the same issue.

For my part, the following command `configfile (hd0,1)/efi/boot/grub.cfg` prints a few lines that I don’t have the time to read, and then the system shuts down.

Doing the same but with `(hd0,1)/efi/debian/grub.cfg` simply resets the grub command line interface.

I hope someone can help. I would like to see if mender is a good solution for the project I work on.

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://hub.mender.io/u/daniel1)\
**Post date:** [June 17, 2021, 9:13pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/6 "2021-06-17T21:13:54Z")

</div>

![20210615_150439](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/6/6b7c641e143373114f525997665a1d04998f5ea5.jpeg)  
I made a photo from the lines

---

<div class="post-metadata">

**Author:** ![francoislefebvre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/francoislefebvre/32/1238_2.png) [@francoislefebvre](https://hub.mender.io/u/francoislefebvre)\
**Post date:** [June 17, 2021, 10:37pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/7 "2021-06-17T22:37:20Z")

</div>

Yeah, those lines look like what I get after the command `configfile (hd0,1)/efi/boot/grub.cfg`.

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [June 21, 2021, 2:34pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/8 "2021-06-21T14:34:11Z")

</div>

It seems your grub configuration is missing the [hashsum command](https://www.gnu.org/software/grub/manual/grub/html_node/hashsum.html).

@oleorhagen does the generic\_x86-64\_hdd\_config use a custom-built GRUB or the one provided by the distro?

@francoislefebvre @daniel1 which distro are you using? It’s possible that you will need a custom grub binary if the one provided by your distro does not have all the require configs enabled.

Drew

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [June 22, 2021, 10:42am UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/9 "2021-06-22T10:42:52Z")

</div>

@drewmoseley I’m fairly sure it is using a custom built GRUB

---

<div class="post-metadata">

**Author:** ![francoislefebvre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/francoislefebvre/32/1238_2.png) [@francoislefebvre](https://hub.mender.io/u/francoislefebvre)\
**Post date:** [July 6, 2021, 1:44pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/10 "2021-07-06T13:44:19Z")

</div>

@drewmoseley I use Debian 10, as do @daniel1 .

So what would be the next things to do?

Sorry for the late reply, I was on vacation.

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [July 6, 2021, 2:50pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/11 "2021-07-06T14:50:52Z")

</div>

You’ll need to try and figure out where the Grub image you are using is coming from. You may need to modify it to add the missing hashsum config. I’m not familiar enough with Grub to say how to do that but I don’t imagine it’s terribly difficult.

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [July 6, 2021, 3:40pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/12 "2021-07-06T15:40:24Z")

</div>

I just created a minimal Debian 10 image using [mkosi](https://github.com/systemd/mkosi) and did not have any issues booting it after conversion. I only booted it with QEMU but it did successfully launch. I wonder if it’s related to your specific hardware or your image?

Drew

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://hub.mender.io/u/daniel1)\
**Post date:** [July 16, 2021, 7:03am UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/13 "2021-07-16T07:03:33Z")

</div>

Now it’s working…  
I forgot sgdisk -e /dev/sda  
But this was not the only one reason, why I had this problems…  
The BIOS of my Hardware (I tested with Lenovo ThinkStation) is not supporting all features, I need. I changed the hardware and now It’s working.  
Thank you for all your help

---

<div class="post-metadata">

**Author:** ![francoislefebvre](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/francoislefebvre/32/1238_2.png) [@francoislefebvre](https://hub.mender.io/u/francoislefebvre)\
**Post date:** [July 17, 2021, 2:46pm UTC](https://hub.mender.io/t/x86-64-system-showing-grub-prompt-after-debian-image-conversion/3755/14 "2021-07-17T14:46:18Z")

</div>

For my part, I switched to the suggested method using `mkosi` and it works. It also ease the development process. Thanks for the tip @drewmoseley .
