0

I want to dual boot Windows and Ubuntu from my computer, which has only Ubuntu installed. I have done dual booting before but in that case, Windows was installed first. Here are my Ubuntu partitions:

enter image description here

And I want to free up some 60GB space for my Windows. How do I do that?

1 Answers1

-1

It is inadvisable to modify mounted partitions.
Thus, You should boot from a LiveCD or USB.

First make a back up of your data in case of problems.

Use gparted to shrink your home partition.
Then create a partition for the windows install.
Boot the windows installer. and install it to the partition.

Note: windows will write a bootloader to EFI/boot/bootx64.efi. If you use device boot, Grub will need to be put back in.

ravery
  • 6,874
  • 1
    No, it is not likely Windows will overwrite Grub if the installation is properly done in UEFI mode. That information is outdated and applicable only to Legacy systems. –  Jul 13 '17 at 10:47
  • @Michael -- depends on his UEFI. windows will write to /EFi/boot/bootx64.efi. if his computer system device boots only he will have to replace grub to this path – ravery Jul 13 '17 at 10:54
  • 1
    No, Windows do not use the same EFI stanza therefore it won't overwrite. It'll overwrite an 'hacked' stanza but you wouldn't have that unless you already installed the dual boot and the computer was booting by name descriptor only. So, no, normally that isn't what happens. You need to learn what UEFI is, how it works. –  Jul 13 '17 at 11:02
  • @MichaelBay -- if the system device boots (which many do especially older ones) it boots from /efi/boot/bootx64.efi only and this file will be over written by windows because that is how windows boots – ravery Jul 13 '17 at 11:07
  • 1
    So, it's now clear you have the whole UEFi situation pretty unclear. –  Jul 13 '17 at 11:41
  • @Micjael -- I have it very clear .... many of you seems to forget default media path and ignore system that use only this. system less than 2 years old I have seen will only device boot.and with a 225GB hard drive I bet his is older than 2 years. and windows will always write /efi/boot/bootx64.efi but for you I will quantify my answer – ravery Jul 13 '17 at 11:43
  • In all probability, Windows will not overwrite GRUB when Windows is installed; but it will probably set Windows as the default boot manager. This is easily fixed if one knows how; see this answer of mine for details. The fallback boot loader (EFI/BOOT/bootx64.efi) is used as that -- a fallback, in case other boot entries don't work. Some EFIs are broken and boot only via this entry, but they were never common and are increasingly rare. – Rod Smith Jul 14 '17 at 18:23
  • @RodSmith -- if he is device booting there EFI/BOOT/BOOTX64.efi is grub. It is not fallback it is the default media path (device boot). even system that will OS boot give you the option to set device boot as prority. and some systems will only device boot. third-- many systems that do OS boot have device boot set at default. because that is how it is loaded at the factory – ravery Jul 14 '17 at 19:05
  • @ravery, the term "fallback boot loader" is commonly used to refer to EFI/BOOT/bootx64.efi. Google it if you don't believe me. After installing Windows, chances are the system will not be using this boot loader, but Microsoft's official Windows boot loader location, EFI/Microsoft/Boot/bootmgfw.efi. Thus, changing the fallback loader as you suggest is unlikely to do anything useful -- at least not by itself. This change will be useful only on badly broken EFIs, which are rare. – Rod Smith Jul 14 '17 at 22:33
  • @RodSmith -- It is also (and more commonly) referred to as default media path .... as everything but the internal drive will only boot this path. changing it will most often work. as computer usually come set for device boot priority over OS boot or will only device boot – ravery Jul 14 '17 at 22:41
  • @ravery, when most OSes (including Windows) install, they change the boot order so that the OS's boot loader (EFI/Microsoft/Boot/bootmgfw.efi for Windows) is the first in the boot order. Thus, in Dylan's situation, once Windows installs, the computer will be set to boot from bootmgfw.efi, and changing the fallback boot loader by itself will not restore GRUB as the default boot loader. To do that, the boot order must be changed, as described here. – Rod Smith Jul 15 '17 at 13:45
  • @Rod, an windows will often set itself as next boot everytime it runs. my fix prevents that – ravery Jul 15 '17 at 14:15
  • @ravery, no, your fix (simply overwriting EFI/BOOT/bootx64.efi with GRUB) will not prevent Windows resetting itself as the default boot manager. I've seen numerous threads in which people have tried that in order to fix such a "boot coup," to no avail. The least hackish but effective solution to this problem seems to be using bcdedit in Windows to set the desired boot manager. The most reliable (but very hackish) solution is to rename EFI/Microsoft/Boot/boogmgfw.efi and replace it with GRUB; that's the file that Windows sets to boot by default when it does a boot coup. – Rod Smith Jul 15 '17 at 14:44
  • the second half does. putting grub in slot 0000. because nvram is refence by number not name – ravery Jul 15 '17 at 14:52
  • @rob -- I never said anything about replacing bootmgfw.efi now you are really digging for reason to say I am wrong. efi/boot/bootx64.efi points to bootmgfw.efi every thread I have seen my method mentioned in is a success – ravery Jul 15 '17 at 14:54