]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/growfs/growfs.8
This commit was generated by cvs2svn to compensate for changes in r94691,
[FreeBSD/FreeBSD.git] / sbin / growfs / growfs.8
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
53 extends the
54 .Xr newfs 8
55 program.
56 Before starting
57 .Nm
58 the disk must be labeled to a bigger size using
59 .Xr disklabel 8 .
60 If you are using volumes you must enlarge them by using
61 .Xr vinum 8 .
62 .Nm
63 extends the size of the file system on the specified special file.
64 Currently
65 .Nm
66 can only enlarge unmounted file systems.
67 Do not try enlarging a mounted file system, your system may panic and you will
68 not be able to use the file system any longer.
69 Most of the
70 .Xr newfs 8
71 options can not be changed by
72 .Nm .
73 In fact, you can only increase the size of the file system.
74 Use
75 .Xr tunefs 8
76 for other changes.
77 .Pp
78 The following options are available:
79 .Bl -tag -width indent
80 .It Fl N
81 .Dq Test mode .
82 Causes the new file system parameters to be printed out without actually
83 enlarging the file system.
84 .It Fl y
85 .Dq Expert mode .
86 Usually
87 .Nm
88 will ask you if you took a backup of your data before and will do some tests
89 whether
90 .Ar special
91 is currently mounted or whether there are any active snapshots on the file
92 system specified.
93 This will be suppressed.
94 So use this option with great care!
95 .It Fl s Ar size
96 Determines the
97 .Ar size
98 of the file system after enlarging in sectors.
99 This value defaults to the size of the raw partition specified in
100 .Ar special
101 (in other words,
102 .Nm
103 will enlarge the file system to the size of the entire partition).
104 .El
105 .Sh EXAMPLES
106 .Dl growfs -s 4194304 /dev/vinum/testvol
107 .Pp
108 will enlarge
109 .Pa /dev/vinum/testvol
110 up to 2GB if there is enough space in
111 .Pa /dev/vinum/testvol .
112 .Sh BUGS
113 .Nm
114 works starting with
115 .Fx
116 3.x.
117 There may be cases on
118 .Fx
119 3.x only, when
120 .Nm
121 does not recognize properly whether or not the file system is mounted and
122 exits with an error message.
123 Then please use
124 .Nm
125 .Fl y
126 if you are sure that the file system is not mounted.
127 It is also recommended to always use
128 .Xr fsck 8
129 after enlarging (just to be on the safe side).
130 .Pp
131 For enlarging beyond certain limits, it is essential to have some free blocks
132 available in the first cylinder group.
133 If that space is not available in the first cylinder group, a critical data
134 structure has to be relocated into one of the new available cylinder groups.
135 On
136 .Fx
137 3.x this will cause problems with
138 .Xr fsck 8
139 afterwards.
140 So
141 .Xr fsck 8
142 needs to be patched if you want to use
143 .Nm
144 for
145 .Fx
146 3.x.
147 This patch is already integrated in
148 .Fx
149 starting with
150 .Fx 4.4 .
151 To avoid an unexpected relocation of that structure it is possible to use
152 .Nm ffsinfo
153 .Fl c Ar 0
154 on the first cylinder group to verify that
155 .Em nbfree
156 in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP
157 .Em cgr0
158 has enough blocks.
159 As a rule of thumb for default file system parameters one block is needed for
160 every 2 GB of total file system size.
161 .Pp
162 Normally
163 .Nm
164 writes this critical structure to disk and reads it again later for doing more
165 updates.
166 This read operation will provide unexpected data when using
167 .Fl N .
168 Therefore, this part can not really be simulated and will be skipped in test
169 mode.
170 .Sh SEE ALSO
171 .Xr disklabel 8 ,
172 .Xr dumpfs 8 ,
173 .Xr ffsinfo 8 ,
174 .Xr fsck 8 ,
175 .Xr newfs 8 ,
176 .Xr tunefs 8 ,
177 .Xr vinum 8
178 .Sh AUTHORS
179 .An Christoph Herrmann Aq chm@FreeBSD.org
180 .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
181 .An The GROWFS team Aq growfs@Tomsoft.COM
182 .Sh HISTORY
183 The
184 .Nm
185 command first appeared in
186 .Fx 4.4 .