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