Skip to main content

Fdisk Error Message [Resolved]

So basically i was messing around in Linux and i wiped the fileystem from a partition with wipefs and then decided to delete this partition (/dev/sda2) so i went on parted and deleted it.

After this i went to fdisk and created it again. I then went on to add a file system to this partition using sudo mkfs -t ext4 /dev/sda2 and this created a etx4 filesystem on the partition.

I then went onto fdisk again by typing sudo fdisk /dev/sda2 and then a message in red text came up, which is this:

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device /dev/sda2 already contains a ext4 signature.
The signature will be removed with a write command.

Device does not contain a recognized partiton table.
Create a new DOS disklabel with disk identifier 0x3a701490.

Command (m for help): p
Disk /dev/sda2: 46.6 GiB 50000297984 bytes, 976
Units: sectors of 1 * 512 bytes
Sector size (logical/physical) : 512 bytes / 512 bytes
I/O size (minimum optimal) 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier 0x3a701490

** My question is, why does fdisk show that the disk has a previous ext4 signature even though i removed all signatures on the disk with wipefs**

Also why does it say that a partiton table is not recognised, it clearly says on the **Disklabel section that the partition table is a dos one**


Question Credit: Qasim
Question Reference
Asked July 18, 2019
Posted Under: Unix Linux
6 views
1 Answers

As the comment by frostschutz said, you are trying to create a partition in a partition. Your disk is /dev/sda, your partition is /dev/sda2.

On your partition, you created a filesystem with

sudo mkfs -t ext4 /dev/sda2

So, examining your output of sudo fdisk /dev/sda2:

Device /dev/sda2 already contains a ext4 signature.
The signature will be removed with a write command.

That is correct. Your sudo mkfs -t ext4 /dev/sda2 put it there.

Device does not contain a recognized partiton table.
Create a new DOS disklabel with disk identifier 0x3a701490.

That is also correct: the partition /dev/sda2 does not contain a partition table. The disk /dev/sda contains a partition table; the partition /dev/sda2 contains an ext4 file system.

So, to your question:

why does fdisk show that the disk has a previous ext4 signature even though i removed all signatures on the disk with wipefs

Because you put it there with sudo mkfs -t ext4 /dev/sda2.

Also why does it say that a partiton table is not recognised, it clearly says on the **Disklabel section that the partition table is a dos one

It says, that there is no partition table recognised, and that it is now creating a partition table for it. After fdisk has created the partition table, you type p and, because fdisk has just created this table for you, you see the freshly created table appearing.


credit: Ljm Dullaart
Answered July 18, 2019
Your Answer