2 Formatting a File System
WARNING:
This documentation is a draft and is not meant for production use. Branch: OL10-FSADMIN
The mkfs.
fstype command is used to create a
file system on a specified device or file image.
The mkfs.
fstype command creates a Linux file
system on a device or file image.
sudo mkfs.fstype [-L label][options] device
Many file system types are available to provide variations on the command name, including the most commonly used file systems on Oracle Linux:
-
mkfs.btrfs
- Format a file system using Btrfs. Requires UEK to be installed on the system. Note that if UEK is installed on the system, but the system is running RHCK, you can create a Btrfs file system, but you can't mount it until the system is booted into UEK. See also Oracle Linux 10: Managing the Btrfs File System -
mkfs.xfs
- Format a file system using XFS. See also Oracle Linux 10: Managing the XFS File System -
mkfs.ext4
- Format a file system using Ext4. See also Oracle Linux 10: Managing the Ext File System
The device argument is either the device name or a file image that can contain the file system.
For example:
sudo mkfs.xfs /dev/sdb1
Note:
Themkfs -t
fstype command is a wrapper command for the
mkfs.fstype
commands and is deprecated. It defaults to use
mkfs.ext2
if no file system type is specified.
You can use the -L
option to specify a file system
label for most file system types.
While you don't need to specify options for the mkfs.fstype
commands to work for most common use cases because the default values suffice, you
might use specific options when working with particular hardware or when you intend
to enable specific features within the file system. Many options are available for
each file system and options are specific to each file system type. For more
information, see the mkfs.fstype(8)
manual
pages.