Skip to content

mkfs.ntfs refuses to create FS in a file #145

@Hi-Angel

Description

@Hi-Angel

It's important for testing purposes to be able to format a file as an FS. For example, I was just helping someone on Q&A site, and I don't have a spare disk to format as an NTFS to test something.

Formatting a file as an FS works with all other mkfs.*es but not with mkfs.ntfs for some reason. For example, truncate -s 200M disk-file && mkfs.ext4 ./disk-file works no problem.

Steps to reproduce

  1. truncate -s 200M disk-file
  2. mkfs.ntfs ./disk-file

Expected

Command should succeed

Actual

It fails with:

./disk-file is not a block device.
Refusing to make a filesystem here!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions