[PATCH 2/2] generic/740: add --force option to mkfs.ntfs

David Timber <[email protected]> Fri, 19 Jun 2026 04:22:36 +0900
Newsgroups org.kernel.vger.fstests
Message-ID <[email protected]>
mkntfs refuses to format the target if it's backed by a "real" device
but not a partition to maintain compatibility with Windows. When
formatting the scratch device in NTFS for testing, this behaviour has
to be overridden so that any type of blockdev can be used as a scratch
device.

Signed-off-by: David Timber <[email protected]>
---
 tests/generic/740 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/generic/740 b/tests/generic/740
index 4f8bf099..718d983d 100755
--- a/tests/generic/740
+++ b/tests/generic/740
@@ -72,8 +72,10 @@ do
 		postargs=2000
 		;;
 	ntfs)
-		# "quick" format that doesn't zero the entire device
-		postargs="--quick"
+		# "quick" format that doesn't zero the entire device. Use -F so
+		# that NTFS-3G mkfs formats the volume even if the scratch
+		# blockdev is not a partition.
+		postargs="--quick --force"
 		;;
 	reiser4)
 		preop="echo y |"
-- 
2.54.0