xref: /freebsd/sbin/growfs/growfs.8 (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
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$
39.\"
40.Dd September 8, 2000
41.Dt GROWFS 8
42.Os
43.Sh NAME
44.Nm growfs
45.Nd grow size of an existing ufs file system
46.Sh SYNOPSIS
47.Nm
48.Op Fl Ny
49.Op Fl s Ar size
50.Ar special
51.Sh DESCRIPTION
52.Nm
53extends the
54.Xr newfs 8
55program.
56Before running
57.Nm
58the disk must be labeled to a bigger size using
59.Xr disklabel 8 .
60If you are using volumes you must grow them using
61.Xr vinum 8 .
62.Nm
63extends the size of the file system on the specified special file.
64Currently
65.Nm
66can only grow unmounted file systems.
67Do not try growing a mounted file system, your system may panic and you will
68not be able to use the file system any longer.
69Most of the options you have used with
70.Xr newfs 8
71once can not be changed.
72In fact you can only increase the size of the file system.
73Use
74.Xr tunefs 8
75for other changes.
76.Pp
77The following options are available:
78.Bl -tag -width indent
79.It Fl N
80Cause the new file system parameters to be printed out without actually growing
81the file system.
82.It Fl y
83.Dq Expert mode .
84Normally
85.Nm
86will ask you, if you took a backup of your data before and will do some tests
87if
88.Ar special
89is currently mounted or if there are any active snapshots on the filesystem
90specified.
91This will be suppressed.
92So use this option with great care!
93.It Fl s Ar size
94The
95.Ar size
96of the file system after growing in sectors.
97This value defaults to the size of the raw partition specified in
98.Ar special
99(in other words,
100.Nm
101will grow the file system to the size of the entire partition).
102.El
103.Sh EXAMPLES
104.Pp
105.Dl growfs -s 4194304 /dev/vinum/testvol
106.Pp
107will grow
108.Pa /dev/vinum/testvol
109up to 2GB if there is enough space in
110.Pa /dev/vinum/testvol .
111.Sh BUGS
112In some cases on
113.Fx
1143.x it is possible, that
115.Nm
116did not recognize exactly, if the file system is mounted or not and
117exits with an error message, then use
118.Nm
119.Fl y
120if you are sure, that the file system is not mounted.
121It is also recommended to always use
122.Xr fsck 8
123after growing just to be on the safe side.
124.Pp
125Pay attention, as in certain cases we have to change the location of an file
126system internal structure which had never been moved before.
127Almost everything works perfect with this relocated structure except the
128.Xr fsck 8
129utility.
130There is a patch available for
131.Xr fsck 8 .
132For growing above certain limits it is essential to have some free blocks
133available in the first cylinder group.
134To avoid the relocation of that structure it is currently recommended to use
135.Nm ffsinfo
136.Fl c Ar 0
137on the first cylinder group and check that
138.Em nbfree
139in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP
140.Em cgr0
141has enough blocks.
142As a rule of thumb for default filesystem parameters a block is needed for
143every 2 GB of total filesystem size.
144.Sh SEE ALSO
145.Xr disklabel 8 ,
146.Xr dumpfs 8 ,
147.Xr ffsinfo 8 ,
148.Xr fsck 8 ,
149.Xr newfs 8 ,
150.Xr tunefs 8 ,
151.Xr vinum 8
152.Sh AUTHORS
153.An Christoph Herrmann Aq chm@FreeBSD.org
154.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
155.An The GROWFS team Aq growfs@Tomsoft.COM
156.Sh HISTORY
157The
158.Nm
159command first appeared in
160.Fx 5.0 .
161