It is generally not recommended to work on disks and partitions from within a running operating system. So prepare the disk before installing any system to avoid possible trouble later on.
Boot from the Ubuntu installation media you created before and select Try Ubuntu without installing.
Open GParted, create a new partition table. This will erase the disk, so backup your data before.
In case you have an UEFI based BIOS, select gpt
. In case you have a legacy BIOS, select msdos
.
Now create new partitions for Windows - here you find all information about what to consider :
After having prepared the partitions for Windows, prepare the partitions for Ubuntu. Creating an EFI partition is not necessary, because this already has been done before. All boot loaders will be installed there, the Windows boot loader and the Ubuntu GRUB boot loader.
Create a new partition - format it with ext4 - choose a size of minimum 20 GB.
Create a new partition - format it with swap - choose a size matching the RAM.
First install Windows, disable hibernation and fast startup, then shutdown the PC completely.
Now install Ubuntu, boot from the install media - select Try Ubuntu without installing. On the desktop click Install Ubuntu - when asked what to do - choose Something else. Select the ext4 partition you had created with GParted for the Ubuntu system before. Select / as mount point and ext4 file system as format and then start the installation of the Ubuntu operating system.
Here you find further information including a GParted presentation : How to prepare a disk ...