xref: /freebsd/sbin/growfs/growfs.8 (revision 86f478757a0c145309c1c7744bb8d123cfef7750)
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.Dl growfs -s 4194304 /dev/vinum/testvol
105.Pp
106will grow
107.Pa /dev/vinum/testvol
108up to 2GB if there is enough space in
109.Pa /dev/vinum/testvol .
110.Sh BUGS
111In some cases on
112.Fx
1133.x it is possible, that
114.Nm
115did not recognize exactly, if the file system is mounted or not and
116exits with an error message, then use
117.Nm
118.Fl y
119if you are sure, that the file system is not mounted.
120It is also recommended to always use
121.Xr fsck 8
122after growing just to be on the safe side.
123.Pp
124Pay attention, as in certain cases we have to change the location of an file
125system internal structure which had never been moved before.
126Almost everything works perfect with this relocated structure except the
127.Xr fsck 8
128utility.
129There is a patch available for
130.Xr fsck 8 .
131For growing above certain limits it is essential to have some free blocks
132available in the first cylinder group.
133To avoid the relocation of that structure it is currently recommended to use
134.Nm ffsinfo
135.Fl c Ar 0
136on the first cylinder group and check that
137.Em nbfree
138in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP
139.Em cgr0
140has enough blocks.
141As a rule of thumb for default filesystem parameters a block is needed for
142every 2 GB of total filesystem size.
143.Sh SEE ALSO
144.Xr disklabel 8 ,
145.Xr dumpfs 8 ,
146.Xr ffsinfo 8 ,
147.Xr fsck 8 ,
148.Xr newfs 8 ,
149.Xr tunefs 8 ,
150.Xr vinum 8
151.Sh AUTHORS
152.An Christoph Herrmann Aq chm@FreeBSD.org
153.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
154.An The GROWFS team Aq growfs@Tomsoft.COM
155.Sh HISTORY
156The
157.Nm
158command first appeared in
159.Fx 4.4 .
160