1

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**

  • You're trying to partition a partition. The one you just created ext4 on earlier. And the disklabel is the one it would create if you actually choose to write. – frostschutz Jul 17 at 17:28
  • im not trying to create a partiton if i did i would have selected the 'n' option for a new partiton but i did not do that – Qasim Jul 17 at 17:52
  • What will running that do? – Qasim Jul 17 at 19:50
2

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.

  • Wait a minute i thought there was a partiton table on my sda2 partition, i guess their isnt, so why does it say 'Disklabel type: dos" on fdisk /dev/sda2 doesnt this mean their is in fact a partition table for my sda2 partiton? – Qasim Jul 17 at 22:10
  • It says, that it creates a new DOS disklabel with disk identifier 0x3a701490 for you. AFter that creation, the disk label is there. If you write it to the partition, it will be there next time. (obviously, if you do not write it to the partition, it won't be there next time) – Ljm Dullaart Jul 18 at 5:39
  • if i do not write it i will still have a dos partition in the first place right? all its asking is to create a whole new dos partition table when i already got one? – Qasim Jul 18 at 7:00
  • obviously, if you do not write it to the partition, it won't be there next time. So no: if you do not write it to /dev/sda2, it won't be there next time. Fdisk will generate a new and empty one. – Ljm Dullaart Jul 18 at 17:59
  • Ah i see thanks for the help :) – Qasim Jul 18 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.