mkfs_lustre分析

mkfs_lustre是用户空间程序,用于磁盘格式化。本文详细分析其命令行选项,包括结构体struct mkfs_opts和struct lustre_disk_data。关键选项涉及挂载类型、server配置、条带数、文件系统名等。在格式化过程中,涉及设备大小、inode配置、日志大小等设定,并通过mke2fs创建文件系统,最后写入serverconfig文件。
摘要由CSDN通过智能技术生成

mkfs_lustre实际上是一个用户空间程序,本质上是构成一个mke2fs命令并对磁盘格式化,然后挂载到临时目录,并书写server配置文件。

让我们先看一下mkfs.lustre的命令行:

[root@people ~]# mkfs.lustre

mkfs.lustre v2.2.51

usage: mkfs.lustre <target types> [options] <device>

         <device>:block device or file (e.g /dev/sda or /tmp/ost1)

         target types:

                   --ost: object storage, mutually exclusive with mdt,mgs

                   --mdt: metadata storage, mutually exclusive with ost

                   --mgs: configuration management service - one per site

         options (in order of popularity):

                   --mgsnode=<nid>[,<...>] : NID(s) of a remote mgs node

                            required for all targets other than the mgs node

                   --fsname=<filesystem_name> : default is 'lustre'

                   --failnode=<nid>[,<...>] : NID(s) of a failover partner

                            cannot be used with --servicenode

                   --servicenode=<nid>[,<...>] : NID(s) of all service partners

                            treat all nodes as equal service node, cannot be used with --failnode

                   --param <key>=<value> : set a permanent parameter

                            e.g. --param sys.timeout=40

                                 --param lov.stripesize=2M

                   --index=#N : target index (i.e. ost index within lov)

                   --comment=<user comment>: arbitrary string (824 bytes)

                   --mountfsoptions=<opts> : permanent mount options

                   --network=<net>[,<...>] : restrict OST/MDT to network(s)

                   --backfstype=<fstype> : backing fs type (ext3, ldiskfs)

                   --device-size=#N(KB) : device size for loop devices

                   --mkfsoptions=<opts> : format options

                   --reformat: overwrite an existing disk

                   --stripe-count-hint=#N : for optimizing MDT inode size

                   --iam-dir: use IAM directory format, not ext3 compatible

                   --dryrun: just report what we would do; don't write to disk

                   --verbose : e.g. show mkfs progress

                   --quiet

结构体类型:

结构体struct mkfs_opts,摘自<mkfs_lustre.c>

类型

描述

struct lustre_disk_data

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值