man: resurect growfs manpage
[unleashed.git] / share / man / man1m / growfs.1m
blob249e63c14b145eea0c0e9d93ba3fafe63c933eff
1 '\" te
2 .\" Copyright (c) 2009, Sun Microsystems, Inc.
3 .\"  All Rights Reserved
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH GROWFS 1M "Apr 20, 2009"
8 .SH NAME
9 growfs \- non-destructively expand a UFS file system
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/sbin/growfs\fR [\fB-M\fR \fImount-point\fR] [\fInewfs-options\fR]
14      [\fIraw-device\fR]
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 \fBgrowfs\fR non-destructively expands a mounted or unmounted UNIX file system
21 (UFS) to the size of the file system's slice(s).
22 .sp
23 .LP
24 Typically, disk space is expanded by first adding a slice to a metadevice, then
25 running the \fBgrowfs\fR command. When adding space to a mirror, you expand
26 each submirror before expanding the file system.
27 .sp
28 .LP
29 \fBgrowfs\fR will ``write-lock'' (see \fBlockfs\fR(1M)) a mounted file system
30 when expanding. The length of time the file system is write-locked can be
31 shortened by expanding the file system in stages. For instance, to expand a 1
32 Gbyte file system to 2 Gbytes, the file system can be grown in 16 Mbyte stages
33 using the \fB-s\fR option to specify the total size of the new file system at
34 each stage. The argument for \fB-s\fR is the number of sectors, and must be a
35 multiple of the cylinder size. Note: The file system cannot be grown if a
36 cylinder size of less than 2 is specified. Refer to the \fBnewfs\fR(1M) man
37 page for information on the options available when growing a file system.
38 .sp
39 .LP
40 \fBgrowfs\fR displays the same information as \fBmkfs\fR during the expansion
41 of the file system.
42 .sp
43 .LP
44 If \fBgrowfs\fR is aborted, recover any lost free space by unmounting the file
45 system and running the \fBfsck\fR command, or run the \fBgrowfs\fR command
46 again.
47 .sp
48 .LP
49 \fBNote:\fR If \fBgrowfs\fR is aborted and the file system is used before
50 \fBfsck\fR is run on it, UFS metadata might be left in an incomplete state,
51 with the result that the file system would be corrupted. In such a
52 circumstance, you would have to restore the file system from backups.
53 .SH OPTIONS
54 .sp
55 .LP
56 Root privileges are required for all of the following options.
57 .sp
58 .ne 2
59 .na
60 \fB\fB-M\fR \fImount-point\fR\fR
61 .ad
62 .RS 18n
63 The file system to be expanded is mounted on \fImount-point\fR. File system
64 locking (\fBlockfs\fR) will be used.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fInewfs-options\fR\fR
71 .ad
72 .RS 18n
73 The options are documented in the \fBnewfs\fR man page.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fIraw-device\fR\fR
80 .ad
81 .RS 18n
82 Specifies the name of a raw metadevice or raw special device, residing in
83 \fB/dev/md/rdsk\fR, or \fB/dev/rdsk\fR, respectively, including the disk slice,
84 where you want the file system to be grown.
85 .RE
87 .SH EXAMPLES
88 .LP
89 \fBExample 1 \fRExpanding nonmetadevice slice for \fB/export\fR file system
90 .sp
91 .LP
92 The following example expands a nonmetadevice slice for the \fB/export\fR file
93 system. In this example, the existing slice, \fB/dev/dsk/c1t0d0s3\fR, is
94 converted to a metadevice so additional slices can be concatenated.
96 .sp
97 .in +2
98 .nf
99 # metainit -f d8 2 1 c1t0d0s3 1 c2t0d0s3
100 # umount /export
102 .in -2
106 \fBExample 2 \fRAssociate \fB/export\fR with new metadevice
109 Edit the \fB/etc/vfstab\fR file to change the entry for \fB/export\fR to the
110 newly defined metadevice, \fBd8\fR.
113 .in +2
115 # mount /export
116 # growfs -M /export /dev/md/rdsk/d8
118 .in -2
123 The first example starts by running the \fBmetainit\fR command with the
124 \fB-f\fR option to force the creation of a new concatenated metadevice
125 \fBd8\fR, which consists of the existing slice \fB/dev/dsk/c1t0d0s3\fR and a
126 new slice \fB/dev/dsk/c2t0d0s3\fR. Next, the file system on \fB/export\fR must
127 be unmounted. The \fB/etc/vfstab\fR file is edited to change the entry for
128 \fB/export\fR to the newly defined metadevice name, rather than the slice name.
129 After the file system is remounted, the \fBgrowfs\fR command is run to expand
130 the file system. The file system will span the entire metadevice when
131 \fBgrowfs\fR completes. The \fB-M\fR option enables the \fBgrowfs\fR command to
132 expand a mounted file system. During the expansion, write access for
133 \fB/export\fR is suspended until \fBgrowfs\fR unlocks the file system. Read
134 access is not affected, though access times are not kept when the lock is in
135 effect.
138 \fBExample 3 \fRDynamic Expansion of \fB/export\fR file system
141 The following example picks up from the previous one. Here, the \fB/export\fR
142 file system mounted on metadevice \fBd8\fR is dynamically expanded.
145 .in +2
147 # metattach d8 c0t1d0s2
148 # growfs -M /export /dev/md/rdsk/d8
150 .in -2
155 This example begins by using the \fBmetattach\fR command to dynamically
156 concatenate a new slice, \fB/dev/dsk/c0t1d0s2\fR, to the end of an existing
157 metadevice, \fBd8\fR. Next, the \fBgrowfs\fR command specifies that the
158 mount-point is \fB/export\fR and that it is to be expanded onto the raw
159 metadevice \fB/dev/md/rdsk/d8\fR. The file system will span the entire
160 metadevice when \fBgrowfs\fR completes. During the expansion, write access for
161 \fB/export\fR is suspended until \fBgrowfs\fR unlocks the file system. Read
162 access is not affected, though access times are not kept when the lock is in
163 effect.
166 \fBExample 4 \fRExpanding mounted file system to existing mirror
169 The following example expands a mounted file system \fB/files\fR, to an
170 existing mirror, \fBd80\fR, which contains two submirrors, \fBd9\fR and
171 \fBd10\fR.
174 .in +2
176 # metattach d9 c0t2d0s5
177 # metattach d10 c0t3d0s5
178 # growfs -M /files /dev/md/rdsk/d80
180 .in -2
185 In this example, the \fBmetattach\fR command dynamically concatenates the new
186 slices to each submirror. The \fBmetattach\fR command must be run for each
187 submirror. The mirror will automatically grow when the last submirror is
188 dynamically concatenated. The mirror will grow to the size of the smallest
189 submirror. The \fBgrowfs\fR command then expands the file system. The
190 \fBgrowfs\fR command specifies that the mount-point is \fB/files\fR and that it
191 is to be expanded onto the raw metadevice \fB/dev/md/rdsk/d80\fR. The file
192 system will span the entire mirror when the \fBgrowfs\fR command completes.
193 During the expansion, write access for the file system is suspended until
194 \fBgrowfs\fR unlocks the file system. Read access is not affected, though
195 access times are not kept when the lock is in effect.
197 .SH EXIT STATUS
200 The following exit values are returned:
202 .ne 2
204 \fB\fB0\fR\fR
206 .RS 6n
207 Successful completion.
211 .ne 2
213 \fB\fB>0\fR\fR
215 .RS 6n
216 An error occurred.
219 .SH SEE ALSO
222 \fBfsck\fR(1M), \fBlockfs\fR(1M), \fBmkfs\fR(1M), \fBmetattach\fR(1M),
223 \fBnewfs\fR(1M), \fBattributes\fR(5)
226 \fISolaris Volume Manager Administration Guide\fR
227 .SH LIMITATIONS
230 Only UFS file systems (either mounted or unmounted) can be expanded using the
231 \fBgrowfs\fR command. Once a file system is expanded, it cannot be decreased in
232 size. The following conditions prevent you from expanding file systems: When
233 \fBacct\fR is activated and the accounting file is on the target device. When
234 C2 security is activated and the logging file is on the target file system.
235 When there is a local \fBswap\fR file in the target file system. When the file
236 system is root (\fB/\fR), \fB/usr\fR, or \fBswap\fR.