xref: /dragonfly/sbin/growfs/growfs.8 (revision 1de703da)
1.\" Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz
2.\" Copyright (c) 1980, 1989, 1993 The Regents of the University of California.
3.\" All rights reserved.
4.\"
5.\" This code is derived from software contributed to Berkeley by
6.\" Christoph Herrmann and Thomas-Henning von Kamptz, Munich and Frankfurt.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgment:
18.\"      This product includes software developed by the University of
19.\"      California, Berkeley and its contributors, as well as Christoph
20.\"      Herrmann and Thomas-Henning von Kamptz.
21.\" 4. Neither the name of the University nor the names of its contributors
22.\"    may be used to endorse or promote products derived from this software
23.\"    without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35.\" SUCH DAMAGE.
36.\"
37.\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
38.\" $FreeBSD: src/sbin/growfs/growfs.8,v 1.6.2.6 2003/01/26 03:30:25 keramida Exp $
39.\" $DragonFly: src/sbin/growfs/growfs.8,v 1.2 2003/06/17 04:27:33 dillon Exp $
40.\"
41.Dd September 8, 2000
42.Dt GROWFS 8
43.Os
44.Sh NAME
45.Nm growfs
46.Nd grow size of an existing ufs file system
47.Sh SYNOPSIS
48.Nm
49.Op Fl Ny
50.Op Fl s Ar size
51.Ar special
52.Sh DESCRIPTION
53The
54.Nm
55utility extends the
56.Xr newfs 8
57program.
58Before starting
59.Nm
60the disk must be labeled to a bigger size using
61.Xr disklabel 8 .
62If you wish to grow a file system beyond the boundary of
63the slice it resides in, you must re-size the slice using
64.Xr fdisk 8
65before running
66.Nm .
67If you are using volumes you must enlarge them by using
68.Xr vinum 8 .
69The
70.Nm
71utility extends the size of the file system on the specified special file.
72Currently
73.Nm
74can only enlarge unmounted file systems.
75Do not try enlarging a mounted file system, your system may panic and you will
76not be able to use the file system any longer.
77Most of the
78.Xr newfs 8
79options cannot be changed by
80.Nm .
81In fact, you can only increase the size of the file system.
82Use
83.Xr tunefs 8
84for other changes.
85.Pp
86The following options are available:
87.Bl -tag -width indent
88.It Fl N
89.Dq Test mode .
90Causes the new file system parameters to be printed out without actually
91enlarging the file system.
92.It Fl y
93.Dq Expert mode .
94Usually
95.Nm
96will ask you if you took a backup of your data before and will do some tests
97whether
98.Ar special
99is currently mounted or whether there are any active snapshots on the file
100system specified.
101This will be suppressed.
102So use this option with great care!
103.It Fl s Ar size
104Determines the
105.Ar size
106of the file system after enlarging in sectors.
107This value defaults to the size of the raw partition specified in
108.Ar special
109(in other words,
110.Nm
111will enlarge the file system to the size of the entire partition).
112.El
113.Sh EXAMPLES
114.Dl growfs -s 4194304 /dev/vinum/testvol
115.Pp
116will enlarge
117.Pa /dev/vinum/testvol
118up to 2GB if there is enough space in
119.Pa /dev/vinum/testvol .
120.Sh BUGS
121The
122.Nm
123utility works starting with
124.Fx
1253.x.
126There may be cases on
127.Fx
1283.x only, when
129.Nm
130does not recognize properly whether or not the file system is mounted and
131exits with an error message.
132Then please use
133.Nm
134.Fl y
135if you are sure that the file system is not mounted.
136It is also recommended to always use
137.Xr fsck 8
138after enlarging (just to be on the safe side).
139.Pp
140For enlarging beyond certain limits, it is essential to have some free blocks
141available in the first cylinder group.
142If that space is not available in the first cylinder group, a critical data
143structure has to be relocated into one of the new available cylinder groups.
144On
145.Fx
1463.x this will cause problems with
147.Xr fsck 8
148afterwards.
149So
150.Xr fsck 8
151needs to be patched if you want to use
152.Nm
153for
154.Fx
1553.x.
156This patch is already integrated in
157.Fx
158starting with
159.Fx 4.4 .
160To avoid an unexpected relocation of that structure it is possible to use
161.Nm ffsinfo
162.Fl c Ar 0
163on the first cylinder group to verify that
164.Em nbfree
165in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP
166.Em cgr0
167has enough blocks.
168As a rule of thumb for default file system parameters one block is needed for
169every 2 GB of total file system size.
170.Pp
171Normally
172.Nm
173writes this critical structure to disk and reads it again later for doing more
174updates.
175This read operation will provide unexpected data when using
176.Fl N .
177Therefore, this part cannot really be simulated and will be skipped in test
178mode.
179.Sh SEE ALSO
180.Xr disklabel 8 ,
181.Xr dumpfs 8 ,
182.Xr fdisk 8 ,
183.Xr ffsinfo 8 ,
184.Xr fsck 8 ,
185.Xr newfs 8 ,
186.Xr tunefs 8 ,
187.Xr vinum 8
188.Sh AUTHORS
189.An Christoph Herrmann Aq chm@FreeBSD.org
190.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
191.An The GROWFS team Aq growfs@Tomsoft.COM
192.Sh HISTORY
193The
194.Nm
195utility first appeared in
196.Fx 4.4 .
197