mkfs.lustre(8)

NAME
mkfs.lustre - format a disk for a Lustre service

SYNOPSIS
mkfs.lustre {--ost|--mdt|--mgs} --fsname=<name> [options] device
mkfs.lustre {--ost|--mdt|--mgs} --backfstype=zfs --fsname=<name> [options] <pool_name>/<dataset_name> [<zpool_specification>]

DESCRIPTION
mkfs.lustre is used to format a disk device for use as part of a Lustre filesystem. After formatting, a disk can be mounted with mount -t lustre ... to start the Lustre service defined by this command.

OPTIONS

--ost
    object storage target

--mdt
    metadata storage target

--mgs
    configuration management service, one per site or filesystem. This service can be combined with one --mdt service by specifying both types.

--backfstype=fstype
    Force a particular format for the backing fs (ldiskfs, zfs).
    zpool_specification = [[<vdev_type>] <device> [<device> ...] [<vdev_type>] ...]
    vdev_type = {mirror,raidz,raidz2,raidz3,cache}
    device = { Linux block device } If no vdev_type is given, then the devices are used in a round-robin (striped) manner. See zpool(8) for more details.

--comment=comment
    Set user comment about this disk, ignored by Lustre.

--device-size=KB
    Set device size for loop devices

--dryrun
    Only print what would be done; does not affect the disk

--failnode=nid,...
    Set the NID(s) of a failover partner. This option can be repeated as desired. Cannot be used with --servicenode.

--servicenode=nid,....
    Set the NID(s) of all service partner. This option treats all nodes as equal service nodes. Cannot be used with --failnode.

--fsname=filesystem_name
    The Lustre filesystem this target will be part of. Valid filesystem_names are between 1 and 8 characters long and must only use upper- and lower-case English letters, numbers, and '-', or '_' (regexp [-_a-zA-Z0-9]). All targets in a single filesystem must specify the same filesystem_name, and it must be unique between all filesystems mounted by a single client at one time. Using "lustre" as the filesystem name is discouraged, to avoid future problems if a client needs to mount two such filesystems, and to reduce confusion for administrators/users between "lustre" as the filesystem_name and "lustre" as the literal string that must be used in places for the filesystem_type. The --fsname option is not valid for the MGS, since it may be used for multiple filesystems.

--index=index
    Specify a particular OST or MDT index. Required for all targets other than the MGS, and must be unique for all targets in the same filesystem. Typically sequential values starting from 0 are used. The index parameter may either be a decimal number, or a hexadecimal number starting with '0x'.

--mkfsoptions=opts
    Additional formatting options passed through to the backing filesystem. For example, options for mke2fs or zpool could be set here.

--mountfsoptions=opts
    Set persistent mount options that will be used when mounting Lustre targets. WARNING: unlike earlier versions of mkfs.lustre, this version completely replaces the default mount options with those specified on the command line, issuing a warning on stderr if any of the default mount options are omitted. The defaults for ldiskfs are OST: errors=remount-ro,mballoc,extents; MGS/MDT: errors=remount-ro,user_xattr. DO NOT alter the default mount options unless you know what you are doing.

--backfs-mount-opts=opts
    Use these options for mounting backing fs while mkfs.lustre is working.

--network=net,...
    Network(s) to restrict this OST/MDT to. This option can be repeated as desired.

--mgsnode=nid,...
    Set the NID(s) of the MGS node, required for all targets other than the MGS.

--param key=value
    Set permanent parameter key to value value. This option can be repeated as desired. Typical options might include:
    --param sys.timeout=40
        System obd timeout
    --param lov.stripesize=2M
        Default stripe size
    --param lov.stripecount=2
        Default stripe count
    --param failover.mode=failout
        Return errors instead of waiting for recovery

--quiet
    Print less information.

--reformat
    Reformat an existing Lustre disk as a new target

--replace
    Used to initialize a target with the same --index as a previously used target if the old target was permanently lost for some reason (e.g. multiple disk failure or massive corruption). This avoids having the target try to register as a new target with the MGS.

--stripe-count-hint=stripes
    Specify the expected common number of stripes on a file so that the MDT inode size can be optimized for the typical use case.

--force-nohostid
    Ignore unset hostid for ZFS import protection. To set hostid either set spl_hostid parameter for spl.ko or set /etc/hostid, see zgenhostid(8). To populate the spl_hostid parameter, spl.ko must be (re)loaded after /etc/hostid is created.

--verbose
    Print more information.

-V, --version
    Output build version of the mkfs.lustre utiltiy.

NID
A Lustre network identifier (NID) is used to uniquely identify a Lustre network endpoint by node ID and network type. The format of the NID is: network_id@network_type. If a node has multiple network interfaces, it may have multiple NIDs, which must all be identified so other nodes can choose the NID that is appropriate for their network interfaces. Typically, NIDs are specified in a list delimited by commas (,). However, when failover nodes are specified, the NIDs are delimited by a colon (:) or by repeating a keyword such as --mgsnode= or --servicenode=.

EXAMPLES

mkfs.lustre --fsname=testfs --index=0 --mdt --mgs /dev/sda1
    Combined MGS and MDT for filesystem 'testfs' on node e.g. cfs21

mkfs.lustre --fsname=testfs --index=0 --ost --mgsnode=cfs21@tcp0 /dev/sdb
    OST for filesystem 'testfs' on any node using the above MGS.

mkfs.lustre --fsname=testfs --index=0 --mdt --mgs --servicenode=cfs21@tcp0,cfs21ib@o2ib0 --servicenode=cfs22@tcp0,cfs22ib@o2ib0 /dev/sda1
    Combined MGS and MDT for filesystem 'testfs' on failover pair cfs21 and cfs22.

mkfs.lustre --fsname=testfs --index=1 --ost --mgsnode=cfs21@tcp0,cfs21ib@o2ib0:cfs22@tcp0,cfs22ib@o2ib0 --failnode=cfs24@tcp0,cfs24ib@o2ib0 /dev/sdb
    OST for filesystem 'testfs' using the above MGS and having a failover partner cfs24.

mkfs.lustre --mgs /dev/sda1
    Standalone MGS on e.g. node cfs22

mkfs.lustre --fsname=myfs1 --index=0 --mdt --mgsnode=cfs22@tcp0 /dev/sda2
    MDT for filesystem 'myfs1' on any node, using the above MGS

mkfs.lustre --fsname=testfs --index=0 --mdt --mgs zfspool/mdt1 mirror /dev/sdb /dev/sdc mirror /dev/sdd /dev/sde
    Create zfs pool 'zfspool' on two root vdevs each a mirror of two disks and create mdt/mgs on filesystem 'zfspool/mdt1'.

mkfs.lustre --version
    Output build version of the mkfs.lustre utiltiy e.g. 2.15.52_175_ge7aa83d

AVAILABILITY
mkfs.lustre is part of the lustre(7) filesystem package.

SEE ALSO
lctl(8), lfs(1), lustre(7), mke2fs(8), mount.lustre(8), tunefs.lustre(8), zpool(8)