I installed Ubuntu only in my drive. I didn't make any partition. I erased partition and installed Ubuntu. I want make partition to install Windows alongside. But I can't edit partition.

- 3,887
-
4You cannot edit a partition that is in use; boot from a LiveUSB instead. Best practice is usually to install Windows first, since the Windows installer will usually try to reformat the entire disk. – user535733 Feb 17 '19 at 20:10
2 Answers
First. if you used MBR partition table you cannot install windows alongside you have write partition table again which will erase all data on disk. so first make sure you have GPT partition table using gparted then proceed
You have to use Ubuntu live flash drive/cd to resize partitions.
Here are steps 1. Make bootable flash drive
sudo umount /dev/sdx #x is character designated to your usb
sudo dd bs=4M if=input.iso of=/dev/sdx conv=fdatasync
You can also use other tools to make bootable USB Google them. OR Make gparted live flash drive and use it to resize partitions
Boot from live usb and select try Ubuntu (do not install)
Open gparted and resize the partitions
If gparted won't work then use kde partition manager
sudo apt install partitionmanager
Make sure you do everything after step 1 using live Ubuntu flash drive.
If you have problems booting boot using nomodeset.

- 419
-
Both Ubuntu and Windows install in the boot mode, that you boot installer in. If you want UEFI/gpt you must boot install media in UEFI mode. Windows only boots in UEFI mode from gpt. And Windows only boots in BIOS boot mode from MBR, but must have a primary NTFS partition with boot flag. If your boot mode changes partitioning you then erase drive. Just be sure to have good backups, regardless of which way you install. – oldfred Feb 17 '19 at 21:49
Windows needs several smaller partitions for the operating system to work and it is easiest done by letting the windows installer make those other partitions needed on the disk. you should first erase the disk install windows then install Ubuntu if you want them to coincide on the same disk. so for example
first back up files wanted from Ubuntu
second boot into windows install disk choose custom installation
third delete Ubuntu and swap partition then click on new make the size small enough for both windows and Ubuntu to work correctly.
fourth you click on new the windows installer will ask you to create other partitions needed.
fifth continue and complete installation of windows
sixth boot into Ubuntu ISO via DVD or flash drive
seventh when the prompt comes up click either install along side windows or do something else and make your own partitions and mount points
eighth continue and complete Ubuntu installation

- 180