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