sbin/newfs_hammer: Add printf for HAMMER version after formatting
[dragonfly.git] / sbin / newfs_hammer / newfs_hammer.8
1 .\" Copyright (c) 2007 The DragonFly Project.  All rights reserved.
2 .\"
3 .\" This code is derived from software contributed to The DragonFly Project
4 .\" by Matthew Dillon <dillon@backplane.com>
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\"
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in
14 .\"    the documentation and/or other materials provided with the
15 .\"    distribution.
16 .\" 3. Neither the name of The DragonFly Project nor the names of its
17 .\"    contributors may be used to endorse or promote products derived
18 .\"    from this software without specific, prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .Dd October 29, 2016
34 .Dt NEWFS_HAMMER 8
35 .Os
36 .Sh NAME
37 .Nm newfs_hammer
38 .Nd construct a new HAMMER file system
39 .Sh SYNOPSIS
40 .Nm
41 .Fl L Ar label
42 .Op Fl \&Efh
43 .Op Fl b Ar bootsize
44 .Op Fl m Ar savesize
45 .Op Fl u Ar undosize
46 .Op Fl C Ar cachesize Ns Op Ns Cm \&: Ns Ar readahead
47 .Op Fl V Ar version
48 .Ar special ...
49 .Sh DESCRIPTION
50 The
51 .Nm
52 utility creates a
53 .Nm HAMMER
54 file system on device(s)
55 .Ar special .
56 If multiple devices are specified a single
57 .Nm HAMMER
58 file system is created
59 which spans all of them.
60 Each
61 .Ar special
62 will constitute a volume which the
63 .Nm HAMMER
64 file system is built on.
65 The first
66 .Ar special
67 specified becomes the
68 .Ar root-volume .
69 .Nm HAMMER
70 file systems are sector-size agnostic, however the
71 .Dx
72 implementation requires the sector size to be no larger than 16KB.
73 .Nm HAMMER
74 file systems start at a relative offset of 0 and may only be created
75 under out-of-band disk labels
76 .Po
77 .Xr disklabel64 5
78 or
79 .Xr gpt 8
80 labels
81 .Pc ,
82 or in
83 .Xr disklabel32 5
84 partitions which do not overlap the label area (have a starting sector
85 greater than 16).
86 .Pp
87 .Nm HAMMER
88 file systems are designed for large storage systems, up to 1 Exabyte, and
89 will not operate efficiently on small storage systems.
90 The minimum recommended file system size is 50GB.
91 .Nm HAMMER
92 must reserve 512MB to 1GB of its storage for reblocking and UNDO/REDO.
93 In addition,
94 .Nm HAMMER
95 file systems operating normally, with full history
96 retention and daily snapshots, do not immediately reclaim space when
97 files are deleted.
98 A regular system maintenance job runs once a day by
99 .Xr periodic 8
100 to handle reclamation.
101 .Pp
102 .Nm HAMMER
103 works best when the machine's normal workload would not otherwise fill
104 the file system up in the course of 60 days of operation.
105 .Pp
106 The options are as follows:
107 .Bl -tag -width indent
108 .It Fl L Ar label
109 All
110 .Nm HAMMER
111 file systems must be named and names should be unique on a
112 per-machine basis, although
113 .Nm
114 does not prevent from making file systems with the same label.
115 .It Fl b Ar bootsize
116 Specify a fixed area in which a boot related kernel and data can be stored.
117 This area is currently unused.
118 The
119 .Ar bootsize
120 is specified in bytes.
121 .It Fl f
122 Force operation.
123 This is needed for the creation of a
124 .Nm HAMMER
125 file system less than 10GB size or
126 with less than 512MB UNDO/REDO FIFO.
127 This should not be used under normal circumstances.
128 .It Fl E
129 Use TRIM to erase the device's data before creating the file system.
130 The underlying device must have the TRIM sysctl enabled.
131 Only devices that support TRIM will have such a sysctl option
132 .Va ( kern.cam.da.X.trim_enabled ) .
133 .It Fl m Ar savesize
134 Specify a fixed area which
135 .Nm HAMMER
136 may use as a memory log.
137 This area is currently unused.
138 The
139 .Ar savesize
140 is specified in bytes.
141 .It Fl u Ar undosize
142 Specify the size of the fixed UNDO/REDO FIFO.
143 The
144 .Ar undosize
145 is specified in bytes.
146 By default 0.1% of the root
147 volume's size is used, with a reasonable minimum and a reasonable cap.
148 The UNDO/REDO FIFO is used to sequence meta-data out to the media for
149 instant crash recovery.
150 .It Fl h
151 Show usage.
152 .It Fl C Ar cachesize Ns Op Ns Cm \&: Ns Ar readahead
153 Refer to the same option in
154 .Xr hammer 8 .
155 .It Fl V Ar version
156 Specify the
157 .Nm HAMMER
158 file system version to format.
159 By default
160 .Nm
161 formats the file system using the highest production version number
162 supported by the
163 .Nm HAMMER
164 VFS by checking the
165 .Va vfs.hammer.supported_version
166 sysctl.
167 If you need to maintain compatibility with an older version of
168 .Nm HAMMER
169 you may specify the version with this option.
170 .El
171 .Pp
172 The
173 .Ar bootsize ,
174 .Ar savesize
175 and
176 .Ar undosize
177 must be given with a suffix of
178 .Cm K , M , G
179 or
180 .Cm T
181 meaning kilobyte, megabyte, gigabyte and terabyte.
182 Lower case can also be used for suffix.
183 .Sh EXIT STATUS
184 .Ex -std
185 .Sh EXAMPLES
186 Create a file system named
187 .Sq HOME
188 on
189 .Pa /dev/ad0s1d :
190 .Bd -literal -offset indent
191 newfs_hammer -L HOME /dev/ad0s1d
192 .Ed
193 .Pp
194 Create a file system named
195 .Sq TEMP
196 on
197 .Pa /dev/ad0s1d
198 and
199 .Pa /dev/ad1s1d :
200 .Bd -literal -offset indent
201 newfs_hammer -L TEMP /dev/ad0s1d /dev/ad1s1d
202 .Ed
203 .Sh SEE ALSO
204 .Xr disklabel32 5 ,
205 .Xr disklabel64 5 ,
206 .Xr HAMMER 5 ,
207 .Xr fdisk 8 ,
208 .Xr gpt 8 ,
209 .Xr hammer 8 ,
210 .Xr mount_hammer 8 ,
211 .Xr newfs 8
212 .Sh HISTORY
213 The
214 .Nm
215 utility first appeared in
216 .Dx 1.11 .
217 .Sh AUTHORS
218 .An Matthew Dillon Aq Mt dillon@backplane.com