I am trying to install Ubuntu in dual boot with Windows 10, but after many failed attempts I realized that I have to change SATA mode to AHCI. I have tried literally everything I have read online, even the 'bcdedit /set {current} safeboot minimal' thing doesn't work (instead of restarting it just says 'unaccessible boot device'). I've been stuck 2 days with this problem, I really need help.

I have a HP Zbook 15 G1

  • Install Ubuntu as a Virtual Machine. I do that very successfully.
    – John
    Apr 3, 2022 at 20:14
  • You could have Ubuntu inside Windows by using WSL2.
    – harrymc
    Apr 3, 2022 at 20:15
  • If you change from SATA to AHCI, your disks will need to be reinitialized and you will have to create new partitions. You would lose your Windows 10 install. Make backups before continuing or risk losing data.
    – LPChip
    Apr 3, 2022 at 20:18
  • 1
    You will likely need to reinstall Windows. This is not worth it as there are alternatives, as listed above.
    – harrymc
    Apr 3, 2022 at 20:18
  • You could just revert the AHCI mode back to what it was. This probably won't prevent Ubuntu from working if you already installed it. If all else fails, insert a Windows installation media and select "Repair Windows", that will try to fix those kinds of problems but will make it so that Ubuntu won't boot (if you installed it, but you can fix that by reinstalling GRUB, and then they both probably work.) Apr 3, 2022 at 20:24

1 Answer 1


All of this assumes that:

  • The Ubuntu installer detected that Windows was there, or that you immediately stopped after it didn't.
  • You selected to install Ubuntu "Alongside Windows" (If it didn't even see Windows it couldn't know how to avoid overwriting its data.)

Seeing just an empty disk when attempting to install a second system on the same disk means the first system will be destroyed if you don't immediately stop at that point.

To fix the Windows boot:

  1. Revert the AHCI option back to what it was when Windows worked.
  2. (If they exist, revert Safe Boot and BIOS security options to what they were when Windows worked.)
  3. Try to boot Windows, if it didn't work:
  4. Insert a Windows installation media and select "Repair Windows" (This will attempt to make Windows the only thing that boots)

If it still won't boot do step 4 again. Sometimes it needs another go for some reason.

You could try just doing step 4, it could work even if the BIOS settings were different to what they were when Windows worked.

Only after that if you want Ubuntu to work (if you installed it/almost finished installing it):
Boot any Linux boot media and reinstall GRUB without touching the BIOS settings again.
If it didn't work for some reason and Windows won't boot, you can always fix Windows boot again by doing the "Repair Windows" thing once or twice.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .