From 232cd21db72621a35cc359c88bb7cf78f5d8819e Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sat, 15 Mar 2025 21:35:07 +0300 Subject: [PATCH] ntfsprogs: make mkntfs create FS on a plain file For testing purposes it is frequently useful to be able to format a plain file as certain file-system and then mount it. All of the standard mkfs* utilities adhere to that, like mkext*, mkexfat, etc. Make sure mkntfs works same way too. Fixes: https://github.com/tuxera/ntfs-3g/issues/145 --- ntfsprogs/mkntfs.8.in | 2 +- ntfsprogs/mkntfs.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ntfsprogs/mkntfs.8.in b/ntfsprogs/mkntfs.8.in index b4f61b66..4c64d756 100644 --- a/ntfsprogs/mkntfs.8.in +++ b/ntfsprogs/mkntfs.8.in @@ -222,7 +222,7 @@ Force .B mkntfs to run, even if the specified .I device -is not a block special device, or appears to be mounted. +appears to be mounted. .SS Output options .TP \fB\-q\fR, \fB\-\-quiet\fR diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index 5c3a367b..0d8241e9 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -3503,11 +3503,6 @@ static BOOL mkntfs_open_partition(ntfs_volume *vol) } if (!S_ISBLK(sbuf.st_mode)) { - ntfs_log_error("%s is not a block device.\n", vol->dev->d_name); - if (!opts.force) { - ntfs_log_error("Refusing to make a filesystem here!\n"); - goto done; - } if (!opts.num_sectors) { if (!sbuf.st_size && !sbuf.st_blocks) { ntfs_log_error("You must specify the number of sectors.\n");