1growfs(1M) System Administration Commands growfs(1M)
2
3
4
6 growfs - non-destructively expand a UFS file system
7
9 /usr/sbin/growfs [-M mount-point] [newfs-options]
10 [raw-device]
11
12
14 growfs non-destructively expands a mounted or unmounted UNIX file sys‐
15 tem (UFS) to the size of the file system's slice(s).
16
17
18 Typically, disk space is expanded by first adding a slice to a metade‐
19 vice, then running the growfs command. When adding space to a mirror,
20 you expand each submirror before expanding the file system.
21
22
23 growfs will ``write-lock'' (see lockfs(1M)) a mounted file system when
24 expanding. The length of time the file system is write-locked can be
25 shortened by expanding the file system in stages. For instance, to
26 expand a 1 Gbyte file system to 2 Gbytes, the file system can be grown
27 in 16 Mbyte stages using the -s option to specify the total size of the
28 new file system at each stage. The argument for -s is the number of
29 sectors, and must be a multiple of the cylinder size. Note: The file
30 system cannot be grown if a cylinder size of less than 2 is specified.
31 Refer to the newfs(1M) man page for information on the options avail‐
32 able when growing a file system.
33
34
35 growfs displays the same information as mkfs during the expansion of
36 the file system.
37
38
39 If growfs is aborted, recover any lost free space by unmounting the
40 file system and running the fsck command, or run the growfs command
41 again.
42
43
44 Note: If growfs is aborted and the file system is used before fsck is
45 run on it, UFS metadata might be left in an incomplete state, with the
46 result that the file system would be corrupted. In such a circumstance,
47 you would have to restore the file system from backups.
48
50 Root privileges are required for all of the following options.
51
52 -M mount-point The file system to be expanded is mounted on mount-
53 point. File system locking (lockfs) will be used.
54
55
56 newfs-options The options are documented in the newfs man page.
57
58
59 raw-device Specifies the name of a raw metadevice or raw special
60 device, residing in /dev/md/rdsk, or /dev/rdsk,
61 respectively, including the disk slice, where you
62 want the file system to be grown.
63
64
66 Example 1 Expanding nonmetadevice slice for /export file system
67
68
69 The following example expands a nonmetadevice slice for the /export
70 file system. In this example, the existing slice, /dev/dsk/c1t0d0s3, is
71 converted to a metadevice so additional slices can be concatenated.
72
73
74 # metainit -f d8 2 1 c1t0d0s3 1 c2t0d0s3
75 # umount /export
76
77
78
79 Example 2 Associate /export with new metadevice
80
81
82 Edit the /etc/vfstab file to change the entry for /export to the newly
83 defined metadevice, d8.
84
85
86 # mount /export
87 # growfs -M /export /dev/md/rdsk/d8
88
89
90
91
92 The first example starts by running the metainit command with the -f
93 option to force the creation of a new concatenated metadevice d8, which
94 consists of the existing slice /dev/dsk/c1t0d0s3 and a new slice
95 /dev/dsk/c2t0d0s3. Next, the file system on /export must be unmounted.
96 The /etc/vfstab file is edited to change the entry for /export to the
97 newly defined metadevice name, rather than the slice name. After the
98 file system is remounted, the growfs command is run to expand the file
99 system. The file system will span the entire metadevice when growfs
100 completes. The -M option enables the growfs command to expand a mounted
101 file system. During the expansion, write access for /export is sus‐
102 pended until growfs unlocks the file system. Read access is not
103 affected, though access times are not kept when the lock is in effect.
104
105
106 Example 3 Dynamic Expansion of /export file system
107
108
109 The following example picks up from the previous one. Here, the /export
110 file system mounted on metadevice d8 is dynamically expanded.
111
112
113 # metattach d8 c0t1d0s2
114 # growfs -M /export /dev/md/rdsk/d8
115
116
117
118
119 This example begins by using the metattach command to dynamically con‐
120 catenate a new slice, /dev/dsk/c0t1d0s2, to the end of an existing
121 metadevice, d8. Next, the growfs command specifies that the mount-point
122 is /export and that it is to be expanded onto the raw metadevice
123 /dev/md/rdsk/d8. The file system will span the entire metadevice when
124 growfs completes. During the expansion, write access for /export is
125 suspended until growfs unlocks the file system. Read access is not
126 affected, though access times are not kept when the lock is in effect.
127
128
129 Example 4 Expanding mounted file system to existing mirror
130
131
132 The following example expands a mounted file system /files, to an
133 existing mirror, d80, which contains two submirrors, d9 and d10.
134
135
136 # metattach d9 c0t2d0s5
137 # metattach d10 c0t3d0s5
138 # growfs -M /files /dev/md/rdsk/d80
139
140
141
142
143 In this example, the metattach command dynamically concatenates the new
144 slices to each submirror. The metattach command must be run for each
145 submirror. The mirror will automatically grow when the last submirror
146 is dynamically concatenated. The mirror will grow to the size of the
147 smallest submirror. The growfs command then expands the file system.
148 The growfs command specifies that the mount-point is /files and that it
149 is to be expanded onto the raw metadevice /dev/md/rdsk/d80. The file
150 system will span the entire mirror when the growfs command completes.
151 During the expansion, write access for the file system is suspended
152 until growfs unlocks the file system. Read access is not affected,
153 though access times are not kept when the lock is in effect.
154
155
157 The following exit values are returned:
158
159 0 Successful completion.
160
161
162 >0 An error occurred.
163
164
166 See attributes(5) for descriptions of the following attributes:
167
168
169
170
171 ┌─────────────────────────────┬─────────────────────────────┐
172 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
173 ├─────────────────────────────┼─────────────────────────────┤
174 │Availability │SUNWmdu │
175 └─────────────────────────────┴─────────────────────────────┘
176
178 fsck(1M), lockfs(1M), mkfs(1M), metattach(1M), newfs(1M), attributes(5)
179
180
181 Solaris Volume Manager Administration Guide
182
184 Only UFS file systems (either mounted or unmounted) can be expanded
185 using the growfs command. Once a file system is expanded, it cannot be
186 decreased in size. The following conditions prevent you from expanding
187 file systems: When acct is activated and the accounting file is on the
188 target device. When C2 security is activated and the logging file is on
189 the target file system. When there is a local swap file in the target
190 file system. When the file system is root (/), /usr, or swap.
191
192
193
194SunOS 5.11 20 Apr 2009 growfs(1M)