Score:0

Install windows from Ubuntu, could not prepare computer to boot

co flag

I'm currently running Ubuntu 22.04.2 LTS I am trying to install Windows on the the same hard drive without wiping my linux partition.

I have created both a windows 11 and a windows 10 bootable USB. However, when I boot from the USB, select unallocated space, and let the windows installer work it's magic, I get met with an error stating windows could not "prepare the computer to boot"

Link: Problem described here

My disk is GPT partitioned and I'm using UEFI to boot. I have updated bios to latest version. I've tried disconnecting all peripherals except the ones necessary.

Do I have any options other than wiping my drive?

Edit: I have a lot of continuous unallocated space that windows can use. (Around 500GBs) That is not an issue.

Even Pardides avatar
co flag
I edited it. Ubuntu 22.04, and the example problem was as close as I could get :/
sudodus avatar
jp flag
I suggest that you boot into a live Ubuntu system (typically booted from a USB pendrive) and use `gparted` to shrink a partition that belongs to your installed Ubuntu (typically the root partition (or the home partition if you have a separate home partition)). Then there will be unallocated drive space available for Windows.
Even Pardides avatar
co flag
I have 500GB available (in one continuous chunk right after the grub EFI partition) that I am letting windows use.
sudodus avatar
jp flag
So my guess was wrong. You have another problem. **I am afraid that you need help from people who are experts on Windows (here we know Ubuntu better than Windows).** My best suggestion would be a workaround: Backup everything that you want to keep from your Ubuntu system and let Windows grab the whole drive. Then, from Windows, shrink its main partition `C:` and install Ubuntu into the unallocated drive that you created. Finally restore your backed up data files into Ubuntu or into a shared data partition.
C.S.Cameron avatar
cn flag
It is usually simpler to install Windows first. When you install Windows after Ubuntu, it overwrites the Ubuntu boot loader and the Windows bootloader will not boot Ubuntu. This means that you will need to reinstall GRUB.
Score:1
co flag

Figured it out. Had to reformat my hard drive. "oh no, my files!" Well, I was able to recover the lost partition because I made sure that the windows partitions would not encroach on my linux partition. If anyone else can't solve this problem and is facing the same fate I was, here's what I recommend:

Disclaimer: You could lose your data. Research what I'm saying here on your own as I don't know much about this. Goodluck!

You're going to need a live ubuntu bootable usb AND a windows installation. Ventoy lets you put both on the same drive.

  1. Get parted, and run sudo parted /dev/[drive]
  2. I recommend using unit s to change the unit to sectors. It worked for me and it seems more accurate than MB but someone can correct me.
  3. Run print and make note of your partitions. (Where they end and start) you should also take note of the type of partition. You can use something like Gparted or disks to figure out the file system (ext4, FAT32, FAT16, etc) and the type (primary, extended, logical). You need this info.
  4. Now reboot ur computer into windows installation, and format the drive by opening a command prompt and running
DISKPART
LIST DISK
SEL DIS # (replace # with the disk # of the Windows disk from list in previous command)
CLEAN
EXIT
  1. Reboot into live ubuntu, and use our good friend parted again.
  2. Choose the same unit as before unit s
  3. Use mkpart to recreate your partitions. For me I only wanted to recover my Ubuntu partition so I just ran mkpart primary ext4 [startsector] [endsector]
  4. Now you can shut down, and see if windows installation will go normally.

Note: I did NOT recreate my partitions before installing windows. I did step 8 before step 5. I didn't think of doing it this way at the time. I recreated my partition AFTER installing windows. My grub partition got overwritten because of that. But my files are fine

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.