Can't create ext4 filesystem out of unallocated space(unknown error)

I just recently installed Manjaro on PC that had Linux Mint. I decided to delete mint, i deleted the partition it was on plus one other ntfs partition(belonged to windows before i got rid of it and installed Manjaro).
Now i have 2 partitions on my hdd:
1 - /dev/sda1(root,boot)
2 - /dev/sda2(unallocated space)

Trying to create an ext4 file system out of that space using kde partition manager ends in this error

Job:Create file system ext4 on partition /dev/sda2
command: mkfs.ext4 -qF /dev/sda2
create file system ‘ext4’ on partition ‘/dev/sda2’: Error
create a new partition(334.17 Gib, ext4) on partition ‘/dev/sda’: Error

Before i tried this my hdd partitions were ordered like this
/dev/sda1 (Manjaro)
/dev/sda2 (extended partition)
– /dev/sda3(mint)
– /dev/sda4(swap)
– /dev/sda5(mint home)
/dev/sda6(data ntfs filesystem)

i can still divide and create a swap partition form that unallocated space,but it ends up on /dev/sda4 giving me
/dev/sda1(Manjaro)
/dev/sda2(unallocated)
/dev/sda4 (shouldn’t it be sda3)

When i reboot, my PC shows a notification saying my MBR has been changed! then it starts normally like nothing is wrong.
I don’t really know what’s going on here.How do i fix this?

That cannot be correct. If you have an extended partition container, then the first logical partition in that container starts at ─ in this case ─ /dev/sda5. So your partition layout would most likely have looked like this… :arrow_down:

/dev/sda1      ─ primary partition
/dev/sda2      ─ extended partition container
   └─/dev/sda5 ─ logical partition
/dev/sda3      ─ primary partition
/dev/sda4      ─ primary partition

That said, you cannot simply create a new partition in the place of an extended partition container. You need to first remove all of the logical partitions in the extended partition container and then remove the extended partition container itself. Only then can you create a new partition, which can be either a primary partition or a logical partition in an extended partition container ─ the container will be recreated when you create the logical partition.

Also, the fact that you had an extended partition container means that your drive has an MS-DOS MBR partition table, because a GPT (“GUID Partition Table”) contains only primary partitions. You also don’t have an EFI system partition, which means that your system boots in legacy BIOS mode.

Not that there’s anything wrong with any of the above, but it’s important to know these things, given the differences between an MS-DOS MBR partition table and GPT, and between booting in legacy BIOS mode and booting in native UEFI mode (if the machine supports that).

3 Likes

Thanks for answering. And your right about the partition table i gave being wrong(tried recalling the order) the one you gave looks closest to what it was then.
Anyways, i deleted all the logical partitions in the extended partition then tried to create an ntfs partition out of the free space. It worked fine. From their i made a swap partition too. (wonder why it failed when i tried to use ext4, can u not have 2 ext4 primary partitions on an mbr partition table??).

Sure you can. But the problem was probably the fact that your partition table was messed up. :wink:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.