How to move EFI Disk to other storage

Bouni

Member
Nov 3, 2017
8
0
6
37
Hi,

I try to move the EFI disk image from one storage to another, but if I do so using the GUI "move" option, the installed Windows 10 Guest doesn't boot and I get some sort of EFI Shell.

Can anybody point out if there is a way to move said EFI disk?

I use Proxmox 5.1 on a system with 3 disks, local and local-lvm reside on a 500GB mSATA, the zfs-pool consists of two 128GB SSD disks.
System.PNG
Unfortunately I did the mistake and choose the zfs-pool as target for the Windows images. I already moved the system disk image to the local-lvm, that works. But as soon as I move the EFI disk, I end up with this:

EFI.PNG

Any ideas how to get this done?
 
I try to move the EFI disk image from one storage to another, but if I do so using the GUI "move" option, the installed Windows 10 Guest doesn't boot and I get some sort of EFI Shell.
did you turn off the vm before? did you only reboot from inside the vm?
 
I do the following procedure:

  1. Turn off the VM
  2. Move the system disk to the other storage
  3. Boot up again (that works fine)
  4. Turn off again
  5. Move the EFI disk to the other storage
  6. Boot up again
  7. Then it fails with above screen
What I can see is that the EFI image on the ZFS pool has just 128K, after moving it to the local-lvm it has 4M.
Maybe thats the problem!?
 
mhmm yes i can reproduce that, i have to investigate further what is wrong here
do you still have the original efi disk ?
if yes, can you insert it again as an efi disk and move it to the local storage (not local-lvm) as a workaround?
 
ok short update from me:

i can kinda reproduce your problem

there seems to be an issue with caching when moving a disk shortly after shutting down a vm
if i wait some time after shutdown or do a sync and then move the disk, it works without problems

i do not know if the problem is lvm(thin), qemu-img convert, qemu or something else yet
 
Hi,

thanks for the reply, I'll try you suggested method of waiting longer before starting the move task.
I'll let you know if I have success.

P.S. Yes I've managed to use the old EFI image from the ZFS pool, everything is up and running at the moment.
 
Just tried two methods:
  1. Shutdown VM, wait 10 Minutes, move EFI disk -> no luck
  2. Shutdown VM, use sync command on command line, move EFI disk -> no luck
The move task output is:
Code:
create full clone of drive efidisk0 (zfs-pool:vm-200-disk-1)
  Using default stripesize 64.00 KiB.
  Rounding up size to full physical extent 4.00 MiB
  Logical volume "vm-200-disk-1" created.
transferred: 0 bytes remaining: 131072 bytes total: 131072 bytes progression: 0.00 %
transferred: 131072 bytes remaining: 0 bytes total: 131072 bytes progression: 100.00 %
transferred: 131072 bytes remaining: 0 bytes total: 131072 bytes progression: 100.00 %
TASK OK

Is it possible that the problem is the "Rounding up size to full physical extent 4.00 MiB"!?

Any other idea how to get the image over to the local-lvm?
 
Is it possible that the problem is the "Rounding up size to full physical extent 4.00 MiB"!?
no this should work regardless

Any other idea how to get the image over to the local-lvm?
you could try to manually copy it

remove the efi disk from the vm (will be marked as unused)
create a new one
then copy it with e.g. dd or qemu-img convert from the old location to the new
 
I tried the manual way, still the same result:

1. removed EFI disk
2. created a new one on local-lvm
3. used dd to copy data over to new EFI disk
Code:
root@server:/# find -name vm-200-disk-1
./dev/zvol/zfs-pool/vm-200-disk-1
./dev/zfs-pool/vm-200-disk-1
./dev/pve/vm-200-disk-1
root@server:/# dd if=/dev/zfs-pool/vm-200-disk-1 of=/dev/pve/vm-200-disk-1
256+0 records in
256+0 records out
131072 bytes (131 kB, 128 KiB) copied, 0.00393968 s, 33.3 MB/s
root@server:/#

Can you spot anything wrong?
 
Can you spot anything wrong?
no sorry, no idea really,
but you could try to manually boot from the efi shell and regenerate the efi entries from your os ? (sadly i do not know how to do this from windows, only linux via efibootmgr)
to do that you have to enter the efi partition
e.g.,

fs0:<enter>
cd path-to-the-efi-file<enter>
grubx64.efi<enter>

where grubx64.efi the name of the file is (in case of windows i believe the path is EFI/Boot/ and the file is BOOTX64.EFI)
 
I think I'll just reinstall the VM because I have no idea how to fix the EFI stuff.
Anyway, thanks for your help!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!