6

The problem:
I first installed Windows 10. It created the following partitions:

  • System partition (Primary partition).
  • C: partition (Primary partition)
  • Recovery partition (Primary partition).

Then when installing Ubuntu, I tried using the installer's partition tool to resize the C: partition to create a 10GB NTFS partition which would be accessible via Windows and via Ubuntu (I've done this in the past). However, I was informed by the software, that I'd have to create it as (I think) an extended partition. This meant that the 10GB partition would be a logical partition and I'd have to create any extra partitions only within the logical partitions of the extended partition, so I couldn't install Ubuntu into a primary partition. So I rebooted and selected the "Install Ubuntu alongside Windows" option, and did the install. Now I see that there are five primary partitions.

enter image description here

So why am I not allowed to create more than 4 primary partitions, but the system can create how many ever partitions it likes? I don't seem to have any "overlapping partitions" issues as this question mentions.

ps: What I really want now, is to be able to resize the 343GB partition and create a 10GB partition which will be accessible from Windows and from Ubuntu (to be able to share files between the OS'es).

Update: Checked on Ubuntu. So it was indeed an extended partition. Now I'm in a quandry about how to create that 10GB partition that's accessible by Windows and Ubuntu. I used to be able to create it when I was using Windows 8.1 and Ubuntu 16.04.
enter image description here

Nav
  • 1,059
  • 4
    "What I really want now, is to be able to resize the 343GB partition and create a 10GB partition" boot using a live USB and you'll be able to do that – muru Jun 02 '22 at 12:24
  • 1
    Note that Windows only boots in UEFI mode from gpt and only in BIOS mode from MBR(msdos). And Windows conversion is not easy. Typically requires backup & total new install. Linux allows either partition type with both boot modes, but really should only use gpt with UEFI. And if dual booting both systems need to be in same boot mode. Windows has required vendors to install Windows in UEFI/gpt mode since 2012 & release of Windows 8. So most hardware now is UEFI, and then should be UEFI/gpt installs. How you boot install media UEFI or BIOS is how it installs for both Windows & Ubuntu. – oldfred Jun 02 '22 at 19:17
  • @muru: Worked! Thanks! – Nav Jun 03 '22 at 09:39

1 Answers1

10
  • The old MSDOS partition table can contain only 4 primary partitions, but one of them can be an extended partition and contain 'any number' of logical partitions.

  • The new GUID partition table, GPT, can contain 'any number' of partitions, and does not use extended partition and logical partitions. I have read that Windows can 'only' manage 128 partitions on GPT, but it might be old information. Anyway it should be enough for almost all cases. It seems Linux can manage more partitions (if you have a tool for it), according to this link 255 partitions.


  • In a fairly new computer I would recommend that you use GPT and UEFI mode. This is not necessary for Windows 10, but if/when you want to upgrade to Windows 11 it will be necessary. (It is not necessary for Ubuntu, but it is better, and more 'future proof').

  • It is best to start by installing Windows, and install Ubuntu afterwards. Otherwise, if you start with Ubuntu and install Windows afterwards, Ubuntu's grub bootloader will be overwritten and must be repaired, because Windows does not recognize it. This is possible but means extra work that can be avoided.


Edit 1: When you boot from a live Ubuntu system, typically from a USB pendrive, you can run gparted and edit the partitions. If a partition is mounted or 'swapped on', unmount or 'swap off' and it will be available for editing. (Ubuntu cannot let you edit partitions that are used by the running Ubuntu operating system, this is why you should boot from an external drive.)

Finally, it is a good idea to backup everything that you cannot afford to lose before using gparted, because editing partitions is risky, it can destroy the whole partition table.

Edit 2: When running gparted from Ubuntu live in an external drive,

  • right-click on the partition you want to shrink in order to edit, in this case /dev/sda6: the padlock symbol shows that it is mounted, so unmount it.
  • right-click again to shrink it by moving its tail end. (If you move its head end the bootloader may get problems to find it.) Unallocated drive space will be created.
  • right-click on the unallocated drive space to create a partition with the desired file system. I suggest NTFS. Put a label, that makes it easy for you to identify it both from Ubuntu and Windows, for example data.
  • Finally, click on the tick icon to actually perform the operations, and when it has finished, exit from gparted.
sudodus
  • 46,324
  • 5
  • 88
  • 152
  • 1
    The mountpoint / indicates that you are running gparted from the installed Ubuntu (in the internal drive). This means that the partition that you want to edit is mounted by the operating system itself, cannot be unmounted, and is therefore locked. You must boot into Ubuntu (or some other modern Linux distro) from an external drive, typically a live USB pendrive (for example the drive you installed from), and run gparted from there. – sudodus Jun 02 '22 at 14:11
  • 1
    Source that claims GPT can have more than 128 partitions? I recall 128 being a limit in fdisk/gdisk as well. – Oskar Skog Jun 02 '22 at 15:56
  • 1
    @OskarSkog, For example this link says max 128 partitions in GPT. It seems Linux can manage more partitions (if you have a tool for it), according to this link 255 partitions. – sudodus Jun 02 '22 at 16:26
  • 1
    It seems the partition table can be created at any number of entries (32-bit int), but usually defaults to 128. So adding a 129th partition would (usually) require recreating the GPT entirely and likely have to move data as well. – Oskar Skog Jun 02 '22 at 17:18