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
pull/146/head
Konstantin Kharlamov 2025-03-15 21:35:07 +03:00
parent 75dcdc2cf3
commit 232cd21db7
2 changed files with 1 additions and 6 deletions

View File

@ -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

View File

@ -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");