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
26              exceed the machine's memory page size, which on  most  architec‐
27              tures 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
69                        device 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
82                        option 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       -p protocol
92              Specify  the locking protocol to use when no locking protocol is
93              specified at mount time. Valid locking protocols are:
94
95                 lock_dlm
96                        This is the default. It enables DLM-based locking  for
97                        use in shared storage configurations.
98
99                 lock_nolock
100                        This enables single-node locking
101
102       -q     Quiet mode. Do not print anything.
103
104       -r megabytes
105              mkfs.gfs2  will  try  to make resource groups approximately this
106              large.  The minimum resource group size is 32 MB and the maximum
107              is  2048  MB.   A large resource group size may increase perfor‐
108              mance on very large file systems.  If not  specified,  mkfs.gfs2
109              will choose the resource group size based on the size and align‐
110              ment characteristics of the target device.
111
112       -t clustername:lockspace
113              The "lock table" pair used to uniquely identify this  filesystem
114              in  a cluster.  The cluster name segment (maximum 32 characters)
115              must match the name given to your cluster in its  configuration;
116              only members of this cluster are permitted to use this file sys‐
117              tem.  The lockspace segment (maximum 30 characters) is a  unique
118              file  system  name  used  to  distinguish this gfs2 file system.
119              Valid clusternames and lockspaces may only contain  alphanumeric
120              characters, hyphens (-) and underscores (_).
121
122       -V     Print program version information, then exit.
123
124       block-count
125              Use  block-count  as the size of the filesystem instead of using
126              the whole device.  block-count  is  specified  as  a  number  of
127              filesystem blocks.
128

EXAMPLE

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

SEE ALSO

144       gfs2(5), gfs2_jadd(8), gfs2_grow(8)
145
146
147
148                                                                  mkfs.gfs2(8)
Impressum