LinuxCommandLibrary

mkfs.ntfs

Create an NTFS filesystem on a partition

TLDR

Create a NTFS filesystem inside partition Y on device X

$ mkfs.ntfs [/dev/sdXY]
copy

Create filesystem with a volume-label
$ mkfs.ntfs [[-L|--label]] [volume_label] [/dev/sdXY]
copy

Create filesystem with specific UUID
$ mkfs.ntfs [[-U|--with-uuid]] [UUID] [/dev/sdXY]
copy

SYNOPSIS

mkfs.ntfs [options] device

PARAMETERS

device
    The device to format. This is usually a partition (e.g., /dev/sda1) or a full disk (e.g., /dev/sda).

-f
    Quick format, does not check for bad sectors.

-F
    Force formatting even if the device appears to be mounted or in use.

-L label
    Set the volume label for the NTFS filesystem.

-Q
    Do not execute the command; instead, display what it would do.

-s sector-size
    Specify the sector size in bytes. Common values are 512, 1024, 2048, and 4096.

-v
    Verbose mode: display more information during the formatting process.

-c cluster-size
    Specify the cluster size in bytes. Common values are 4096.

DESCRIPTION

mkfs.ntfs is a command-line utility in Linux used to create an NTFS (New Technology File System) filesystem on a specified partition or disk. NTFS is the standard filesystem used by Windows operating systems, and mkfs.ntfs allows Linux systems to format partitions for compatibility with Windows. The command essentially prepares the specified device for storing files in the NTFS format by writing the necessary metadata structures, such as the Master File Table (MFT), boot sector, and other system files. Formatting a partition will destroy all existing data on it, so it's critical to ensure the correct device is selected before running mkfs.ntfs. Using mkfs.ntfs can be useful for creating dual-boot systems, sharing data between Linux and Windows, or using external storage devices seamlessly on both platforms. Note that while mkfs.ntfs creates the filesystem, mounting and fully utilizing NTFS partitions on Linux often requires the ntfs-3g driver for read-write access.

CAVEATS

Formatting a partition with mkfs.ntfs will erase all existing data on the partition. Ensure you have backed up any important data before proceeding. While mkfs.ntfs creates the filesystem, the ntfs-3g driver is generally required for full read/write access to NTFS partitions on Linux.

EXIT STATUS

mkfs.ntfs returns 0 on success and non-zero on failure.

SEE ALSO

ntfs-3g(8), mount(8), fdisk(8)

Copied to clipboard