6

we created the ext file system on new sdd disk as the follwing

 mkfs.ext4  -j -m 0 /dev/sdd -F

in order to get the disk as was before mkfs

I guess we need to delete the partition that created by mkfs ,

how to perform that ?

2
  • Duplicate of superuser.com/questions/1281326/… Commented Dec 31, 2017 at 9:41
  • 1
    @IgnacioVazquez-Abrams You're right, but since there is my answer here (I didn't notice the duplicate before) and no answer there (yet), maybe it's better to mark the other question as a duplicate of this one. Commented Dec 31, 2017 at 9:46

1 Answer 1

14

mkfs doesn't create a partition, it creates a filesystem. You created a filesystem on the entire device /dev/sdd (as opposed to a partition e.g. /dev/sdd1).

Your disk is not partitioned, the resulting layout is called superfloppy. If you want to utilize (almost) the whole device to a single filesystem then it's still better to have a partition table with one partition. Compare: Uses of single-partition disk configuration.

Tools like fdisk or gdisk should allow you to create a partition table without any preparations (you will lose data from the current filesystem though, so copy what you want to save). If you create a single partition then you should later run mkfs.ext4 with /dev/sdd1 as a target to create a filesystem on the partition.

If you want to wipe the current filesystem (prior to fdisk/gdisk/whatever or for any other reason) then

  • fill the beginning of the disk with zeros, 1MB should be enough:

      dd if=/dev/zero of=/dev/sdd bs=1M count=1
    
  • or use wipefs on /dev/sdd; this tool is designed to erase filesystems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .