>_ linuxcommand.dev
Startseite mkfs
Filesystem

mkfs

Creates a filesystem on a partition or block device.

Syntax
$mkfs -t TYPE DEVICE [OPTIONS]
Examples
Examples
$mkfs -t ext4 /dev/sdb1
Examples
$mkfs.xfs /dev/sdc1
Examples
$mkfs.vfat -F 32 /dev/sdb1
Warnings
DANGER: This command removes existing filesystem metadata on the target device.
Tip: Cross-check the target partition with `lsblk` and `blkid` before running `mkfs`.
Typical use cases
Create new data partition
mkfs -t ext4 /dev/sdb1
Format USB drive
mkfs.vfat -F 32 /dev/sdX1
Note Initializes a new filesystem and replaces existing metadata structures.
Export