15

In gparted, repartitioning a disk into one single partition and formatting the partition to a filesystem is very fast. It seems not write zeros to the partition.

How can I achieve the same when using commands? Here is what I got:

$ sudo mkfs -t ntfs /dev/sdb1
Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes:  14% 16%
Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Tim
  • 98,580
  • 191
  • 570
  • 977

1 Answers1

41

If you would like to format a partition as NTFS, please use mkfs.ntfs or mkntfs. From man mkfs:

This  mkfs  frontend  is  deprecated  in  favour of filesystem specific
mkfs.<type> utils.

For NTFS, you can add the -f or -Q flag to perform a quick format. From man mkntfs:

-f, --fast, -Q, --quick
       Perform  quick  (fast) format. This will skip both zeroing of the volume and bad sector checking.

Therefore, your command should be:

$ sudo mkfs.ntfs -f /dev/sdb1
mxmehl
  • 743
  • 1
  • 5
  • 9
  • Thanks. Why "This mkfs frontend is deprecated in favour of filesystem specific mkfs. utils."? – Tim Feb 27 '19 at 12:43
  • 8
    @Tim why do you keep asking why things are deprecated? If the documentation tells you so, isn’t that good enough for you? – Stephen Kitt Feb 27 '19 at 12:58
  • 3
    @Tim glad it worked. Would you please mark my answer as accepted if it lead you to a solution? I can only speculate why it has been deprecated. Probably because it's a good approach to have specialised tools for such complicated operations. – mxmehl Feb 27 '19 at 14:56
  • ... And as of 2022-08-07 Tim has not yet awarded any points. Tsk, tsk.. – barrypicker Aug 08 '22 at 02:24