To protect the data on my disk I am leveraging the self encrypting drive feature available on my SSD. For this I use a tool called sedutil [0]. This allows me to have access to hidden space on my SSD where a small disk image can be stored to unlock the drive. Basically it acts like small unencrypted USB stick that shadows the actual disk while being in a locked state. The drive will stay unlocked while it remains powered, so the machine can reboot without having to unlock the drive again, but once fully powered off, it will have to unlocked again. In its unlocked state it will just show the regular partition table as if the drive was never locked. The default disk image for unlocking the drive will just reboot once the drive has been unlocked, but I would rather not have to go through the BIOS twice, so instead I refresh the partition table in the Linux kernel and use kexec to boot in my actual OS located on the now unlocked drive. I have done this successfully for my Linux installations, but on one SSD I run Windows 10. The only case I have been able to find of being able to boot into Windows from Linux has been by using grub4dos [1]. So that is what I have tried:
kexec --load grub.exe --command-line='--config-file="chainloader (hd0,0)+1"' sync swapoff -a umount -a -r kexec --exec
However I got the following error. The only reference to this error that I could find by Googling was the actual source code, so that did not help much.
GRUB4DOS 0.4.6a 2018-01-10, root is (0x80,0) Processing the preset-menu ... Error: invalid boot indicator(0xC3) for entry 0.
So I did manage to kexec into grub4dos, but it takes a really long time to determine there is an error. I have not timed it, but it felt like at least a minute. The prompt showed up as well, but this took even longer to finally show up. Also, my USB keyboard did not function, but I read this to be quite common. I tried the following configs as well, but all resulted in the same error message as shown above:
kexec --load grub.exe --command-line='--config-file="chainloader (hd0,0)+1"' kexec --load grub.exe --command-line='--config-file="root (hd0,0); chainloader /bootmgr"' kexec --load grub.exe --command-line='--config-file="root (hd0,1); chainloader /bootmgr"'
I installed Windows 10 by letting it handle the partition itself and got the following:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 549M 0 part └─sda2 8:2 0 465.2G 0 part
I am not quite sure which partition I should be using and if my config formats are correct, but since it took so long to figure out the was an error and since the root depicted in the error message remains the same, I am unsure how to proceed. Right now it is faster to just reboot, but if I would to be able to use grub4dos for this case, it should speed up things and would allow new use cases for kexec.
Does anyone have successfully kexec'ed into Windows 10 using grub4dos? Alternatives would be welcome as well.
Did I get my config correct?
Could the error have to do with the encryption? Something that can only be reset by rebooting, something I just happen to circumvent when kexec'ing into Linux, but is needed for grub4dos to function properly.
The machine on which I am running into this problem is using BIOS. The motherboard is a P6T Deluxe V2, if that is relevant. If any more information is needed, please ask.
[0]: https://github.com/D...ce/sedutil/wiki
[1]: http://reboot.pro/to...-kexecgrub4dos/
Edited by ottidmes, 09 March 2018 - 08:14 PM.