Cannot set secondary hard drive offline in Disk Management

diskmanagementhard drivewindows-server-2016

I need to set a disk as offline in order to connect it to a Hyper V virtual machine.

This disk has Ubuntu installed on it. Windows has absolutely no use for it.

The ubuntu disk is "Disk 1". It has 3 partitions, one EFI and two "Primary" volumes.

The error I get when I right click -> 'offline' is :

Disk attributes may not be changed on the current system disk or BIOS disk 0

Which is rather cryptic because this disk is neither a current system disk or disk 0.

Best Answer

Solution was to remove the UEFI loader on the drive by deleting /boot/EFI/Microsoft and using efibootmgr, and update-grub.

Further steps were required to get hyper V to work, but I will not detail that here. (involves copying shimx64 and grubx64 to /boot/EFI/boot, rename shimx64 to bootx64)