2

Under FreeBSD 12.0 the command mkntfs -Q /dev/da3s1 (with the quick-format flag) still takes a very long time (not finished after some hours) for a 1 TB hard disk drive.

It gives the following warning:

The partition start sector was not specified for /dev/da3s1 and it could not be obtained automatically.  It has been set to 0.
The number of sectors per track was not specified for /dev/da3s1 and it could not be obtained automatically.  It has been set to 0.
The number of heads was not specified for /dev/da3s1 and it could not be obtained automatically.  It has been set to 0.
Cluster size has been automatically set to 4096 bytes.
To boot from a device, Windows needs the 'partition start sector', the 'sectors per track' and the 'number of heads' to be set.
Windows will not be able to boot from this device.
Creating NTFS volume structures.

How can I get a similar speed as in Windows for a quick format?

1
  • I doubt you can speed this up, because ntfs-3g works over FUSE. The only solution I see is to format using Windows.
    – arrowd
    Apr 25, 2019 at 19:06

3 Answers 3

5

This is due to a bug in the ublio library (a direct dependency of the sysutils/fusefs-ntfs port) - there is an open bug report for it.

I recently faced the same problem, and the workaround I used was less than elegant - reinstall sysutils/fusefs-ntfs, but disable UBLIO support. You will then be able to run mkntfs to format your device. On 1TB, it'll be pretty quick - don't know how it compares to doing it natively under Windows, but it finishes, which is an improvement on hanging indefinitely!

If you then want to mount the NTFS device under FreeBSD, you'll want to reinstall sysutils/fusefs-ntfs, but with UBLIO enabled, or you'll get really poor IO performance on the drive. You could make a copy of the mkntfs binary built without UBLIO support somewhere on your path under a different name so you still have use of it if needed after reinstalling with UBLIO.

0

A workaround (from the the mentioned bug's last comment) is to explicitly set the size of the partition at creation:

View Partitions/Drive:

gpart show

Destroy Partition/Drive:

gpart destroy -F da3

Create a GUID Partition Scheme:

gpart create -s GPT da3

Create a partition type (ntfs) and add the size (bytes, using “g” for GB):

gpart add -t ms-basic-data -s 4000g da3

Would be great if someone can tell how to get the exact available size

The drive needs a NTFS Filesystem and perform a fast format:

mkntfs --verbose --fast --label 4TB_HD /dev/da3p1

This worked for me

0

Just faced this problem, but pkg-message of fusefs-ntfs-2017.3.23 suggest us to read /usr/local/share/doc/ntfs-3g/README.FreeBSD

Current implementation does not properly work with partitions of size which is not a multiply of UBLIO_BLOCKSIZE (cannot read/write last cluster). For instance, you may not be able to create ntfs filesystem because of this

The UBLIO layer is configured through environment variables

NTFS_USE_UBLIO - 1. Disabling it drastically decreases performance.

UBLIO_BLOCKSIZE - 262144 (256KB). Larger improves reading/writing speed of large files, and smaller makes filesystem operations (creation, deletion, moving, find(1)) perform faster.

So possible solution is:

  1. Disable UBLIO layer (and slow down NTFS). No need to recompile anything. Just do

    setenv NTFS_USE_UBLIO 0
    

    (csh) or

    NTFS_USE_UBLIO=0
    

    (sh/bash) before running any ntfs tools in this terminal.

  2. -or- Adjust UBLIO_BLOCKSIZE. Partition size must be a multiply of UBLIO_BLOCKSIZE. Set this variable same way as 1.

  3. -or- Adjust partition size. Partition size must be a multiply of UBLIO_BLOCKSIZE, which is 262144 by default. Btw, I think that's impossible to hit this bug on medium, partitioned under modern Windows (Vista+), because Windows always creates partitions with size that is multiple of 1048576 bytes

You must log in to answer this question.

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