1.\" $MirOS: src/sbin/growfs/growfs.8,v 1.3 2005/11/23 16:43:54 tg Exp $ 2.\" Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz 3.\" Copyright (c) 1980, 1989, 1993 The Regents of the University of California. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to Berkeley by 7.\" Christoph Herrmann and Thomas-Henning von Kamptz, Munich and Frankfurt. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. All advertising materials mentioning features or use of this software 18.\" must display the following acknowledgment: 19.\" This product includes software developed by the University of 20.\" California, Berkeley and its contributors, as well as Christoph 21.\" Herrmann and Thomas-Henning von Kamptz. 22.\" 4. Neither the name of the University nor the names of its contributors 23.\" may be used to endorse or promote products derived from this software 24.\" without specific prior written permission. 25.\" 26.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36.\" SUCH DAMAGE. 37.\" 38.\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ 39.\" $FreeBSD: src/sbin/growfs/growfs.8,v 1.19 2003/06/17 19:21:43 brueffer Exp $ 40.\" 41.Dd September 8, 2000 42.Dt GROWFS 8 43.Os 44.Sh NAME 45.Nm growfs 46.Nd grow size of an existing ffs file system 47.Sh SYNOPSIS 48.Nm 49.Op Fl Ny 50.Op Fl s Ar size 51.Ar special 52.Sh DESCRIPTION 53The 54.Nm 55utility extends the 56.Xr newfs 8 57program. 58Before starting 59.Nm 60the slice must be labeled to a bigger size using 61.Xr disklabel 8 . 62If you wish to grow a file system beyond the boundary of 63the partition it resides in, you must re-size the partition using 64.Xr fdisk 8 65before running 66.Nm . 67The 68.Nm 69utility extends the size of the file system on the specified special file. 70.Pp 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 80\&. 81In fact, you can only increase the size of the file system. 82Use 83.Xr tunefs 8 84for other changes. 85.Pp 86The following options are available: 87.Bl -tag -width "-s sizeXX" 88.It Fl N 89Test mode. 90Causes the new file system parameters to be printed out without actually 91enlarging the file system. 92.It Fl s Ar size 93Determines the 94.Ar size 95of the file system after enlarging in sectors. 96This value defaults to the size of the raw partition specified in 97.Ar special 98(in other words, 99.Nm 100will enlarge the file system to the size of the entire partition). 101.It Fl y 102Expert mode. 103Usually 104.Nm 105will ask you if you have taken a backup of your data and will test 106whether 107.Ar special 108is currently mounted. 109The 110.Fl y 111flag suppresses this, 112so use this option with great care! 113.El 114.Sh EXAMPLES 115.Dl growfs -s 4194304 /dev/rwd0f 116.Pp 117will enlarge 118.Pa /dev/rwd0f 119up to 2GB if there is enough space in 120.Pa /dev/rwd0f . 121.Sh BUGS 122The 123.Nm 124utility works starting with 125.Fx 1263.x. 127There may be cases on 128.Fx 1293.x only, when 130.Nm 131does not recognize properly whether or not the file system is mounted and 132exits with an error message ("nothing done"). 133Then please use 134.Nm 135.Fl y 136if you are sure that the file system is not mounted. 137The 138.Nm 139utility has not yet been tested on 140.Ox 141at all, and not much on 142.Mx . 143They behave like 144.Fx 1453.x in the respect shown above. 146It is also recommended to always use 147.Xr fsck 8 148before and after enlarging (just to be on the safe side). 149.Pp 150For enlarging beyond certain limits, it is essential to have some free blocks 151available in the first cylinder group. 152If that space is not available in the first cylinder group, a critical data 153structure has to be relocated into one of the new available cylinder groups. 154On 155.Fx 1563.x this will cause problems with 157.Xr fsck 8 158afterwards. 159So 160.Xr fsck 8 161needs to be patched if you want to use 162.Nm 163for 164.Fx 1653.x. 166This patch is already integrated in 167.Fx 168starting with 169.Fx 4.4 . 170To avoid an unexpected relocation of that structure it is possible to use 171.Nm ffsinfo 172.Fl g Ar 0 173on the first cylinder group to verify that 174.Em nbfree 175in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP 176.Em cgr0 177has enough blocks. 178As a rule of thumb for default file system parameters one block is needed for 179every 2 GB of total file system size. 180.Pp 181Normally 182.Nm 183writes this critical structure to disk and reads it again later for doing more 184updates. 185This read operation will provide unexpected data when using 186.Fl N . 187Therefore, this part cannot really be simulated and will be skipped in test 188mode. 189.Sh SEE ALSO 190.Xr disklabel 8 , 191.Xr dumpfs 8 , 192.Xr fdisk 8 , 193.Xr ffsinfo 8 , 194.Xr fsck 8 , 195.Xr newfs 8 , 196.Xr tunefs 8 197.Sh HISTORY 198The 199.Nm 200utility first appeared in 201.Fx 4.4 . 202.Sh AUTHORS 203.An Christoph Herrmann Aq chm@FreeBSD.org 204.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org 205.An The GROWFS team Aq growfs@Tomsoft.COM 206.Sh BUGS 207It is recommended to always use 208.Xr fsck 8 209after enlarging 210.Pq just to be on the safe side . 211