1mkfs.gfs2(8)                System Manager's Manual               mkfs.gfs2(8)
2
3
4

NAME

6       mkfs.gfs2 - create a gfs2 filesystem
7
8

SYNOPSIS

10       mkfs.gfs2 [options] device [block-count]
11
12

DESCRIPTION

14       mkfs.gfs2 is used to create a gfs2 file system.
15
16

OPTIONS

18       The  default  values of the following options have been chosen for best
19       results.  In most cases, there should be no need  to  choose  different
20       values.  The exceptions to this are the number of journals (-j) and the
21       lock table (-t), as these options will be specific to your cluster.
22
23       -b bytes
24              Set the filesystem block size to bytes which must be a power  of
25              two. The minimum block size is 512 and the block size cannot ex‐
26              ceed the machine's memory page size, which on most architectures
27              is 4096 bytes.  The default block size is 4096 bytes.
28
29       -c megabytes
30              Initial size of each journal's quota change file. The default is
31              1MB.
32
33       -D     Enable debugging output.
34
35       -h     Print out a help message describing the available options,  then
36              exit.
37
38       -J megabytes
39              The  size  of  each journal. The minimum size is 8 megabytes and
40              the maximum is 1024. If this is not specified, a value based  on
41              a sensible proportion of the file system will be chosen.
42
43       -j journals
44              The  number  of  journals for mkfs.gfs2 to create.  At least one
45              journal is  required  for  each  machine  that  will  mount  the
46              filesystem  concurrently.  If this option is not specified, only
47              one journal will be created. This number may be used as an indi‐
48              cator of the number of nodes in the cluster in order to optimize
49              the layout of the filesystem. As such, it is best  to  set  this
50              option  with  the maximum number of mounters in mind than to add
51              more journals later.
52
53       -K     Do not attempt to discard the  block  device  contents.  Issuing
54              discards  to  the  device  allows  some  solid state devices and
55              sparse or thin-provisioned  storage  devices  to  optimise  free
56              space.  Other  devices may emulate this behaviour by zeroing the
57              device contents, which can be a slow process.
58
59       -O     Override. This option prevents mkfs.gfs2 from asking for confir‐
60              mation before writing the filesystem.
61
62       -o     Specify  extended  options. Multiple options can be separated by
63              commas. Valid extended options are:
64
65                 help   Display an extended options help summary, then exit.
66
67                 sunit=bytes
68                        This is used to specify the stripe unit for a RAID de‐
69                        vice  or  striped logical volume.  This option ensures
70                        that resource groups will be stripe unit  aligned  and
71                        overrides  the  stripe  unit value obtained by probing
72                        the device. This value must be a multiple of the  file
73                        system  block  size  and  must  be  specified with the
74                        swidth option.
75
76                 swidth=bytes
77                        This is used to specify the stripe width  for  a  RAID
78                        device or striped logical volume.  This option ensures
79                        that resource groups will be stripe aligned and  over‐
80                        rides  the  stripe width value obtained by probing the
81                        device. This value must be a multiple of the sunit op‐
82                        tion and must also be specified with it.
83
84                 align=[0|1]
85                        Disable  or  enable  the alignment of resource groups.
86                        The default behaviour is to align resource  groups  to
87                        the  stripe width and stripe unit values obtained from
88                        probing the device or specified with  the  swidth  and
89                        sunit extended options.
90
91                 format=<number>
92                        Set the filesystem format version. Testing only.
93
94       -p protocol
95              Specify  the locking protocol to use when no locking protocol is
96              specified at mount time. Valid locking protocols are:
97
98                 lock_dlm
99                        This is the default. It enables DLM-based locking  for
100                        use in shared storage configurations.
101
102                 lock_nolock
103                        This enables single-node locking
104
105       -q     Quiet mode. Do not print anything.
106
107       -r megabytes
108              mkfs.gfs2  will  try  to make resource groups approximately this
109              large.  The minimum resource group size is 32 MB and the maximum
110              is  2048  MB.   A large resource group size may increase perfor‐
111              mance on very large file systems.  If not  specified,  mkfs.gfs2
112              will choose the resource group size based on the size and align‐
113              ment characteristics of the target device.
114
115       -t clustername:lockspace
116              The "lock table" pair used to uniquely identify this  filesystem
117              in  a cluster.  The cluster name segment (maximum 32 characters)
118              must match the name given to your cluster in its  configuration;
119              only members of this cluster are permitted to use this file sys‐
120              tem.  The lockspace segment (maximum 30 characters) is a  unique
121              file  system  name  used  to  distinguish this gfs2 file system.
122              Valid clusternames and lockspaces may only contain  alphanumeric
123              characters, hyphens (-) and underscores (_).
124
125       -V     Print program version information, then exit.
126
127       block-count
128              Use  block-count  as the size of the filesystem instead of using
129              the whole device.  block-count  is  specified  as  a  number  of
130              filesystem blocks.
131

EXAMPLE

133              # mkfs.gfs2 -t mycluster:mygfs2 -p lock_dlm -j 2 /dev/vg0/lv_gfs2
134
135              This will create a gfs2 filesystem on the block device /dev/vg0/lv_gfs2.  It
136              will belong to a cluster named "mycluster" and use the "mygfs2" lock space.  It
137              will use DLM for locking and create journals for a two-node cluster.
138
139              # mkfs.gfs2 -t mycluster:mygfs2 -p lock_nolock -j 3 /dev/vg0/lv_gfs2
140
141              This will create a filesystem on the block device /dev/vg0/lv_gfs2.  It
142              will belong to a cluster named "mycluster" and use the "mygfs2" lockspace, but
143              it will have no cluster locking by default as lock_nolock is used.  It will
144              have journals for a three-node cluster.
145

SEE ALSO

147       gfs2(5), gfs2_jadd(8), gfs2_grow(8)
148
149
150
151                                                                  mkfs.gfs2(8)
Impressum