xref: /freebsd/sbin/growfs/growfs.8 (revision 27bd6c32bbb49a592a0dfbec5f211a7c2fed31d6)
13d500078SThomas-Henning von Kamptz.\" Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz
23d500078SThomas-Henning von Kamptz.\" Copyright (c) 1980, 1989, 1993 The Regents of the University of California.
33d500078SThomas-Henning von Kamptz.\" All rights reserved.
43d500078SThomas-Henning von Kamptz.\"
53d500078SThomas-Henning von Kamptz.\" This code is derived from software contributed to Berkeley by
63d500078SThomas-Henning von Kamptz.\" Christoph Herrmann and Thomas-Henning von Kamptz, Munich and Frankfurt.
73d500078SThomas-Henning von Kamptz.\"
83d500078SThomas-Henning von Kamptz.\" Redistribution and use in source and binary forms, with or without
93d500078SThomas-Henning von Kamptz.\" modification, are permitted provided that the following conditions
103d500078SThomas-Henning von Kamptz.\" are met:
113d500078SThomas-Henning von Kamptz.\" 1. Redistributions of source code must retain the above copyright
123d500078SThomas-Henning von Kamptz.\"    notice, this list of conditions and the following disclaimer.
133d500078SThomas-Henning von Kamptz.\" 2. Redistributions in binary form must reproduce the above copyright
143d500078SThomas-Henning von Kamptz.\"    notice, this list of conditions and the following disclaimer in the
153d500078SThomas-Henning von Kamptz.\"    documentation and/or other materials provided with the distribution.
163d500078SThomas-Henning von Kamptz.\" 3. All advertising materials mentioning features or use of this software
173d500078SThomas-Henning von Kamptz.\"    must display the following acknowledgment:
183d500078SThomas-Henning von Kamptz.\"      This product includes software developed by the University of
193d500078SThomas-Henning von Kamptz.\"      California, Berkeley and its contributors, as well as Christoph
203d500078SThomas-Henning von Kamptz.\"      Herrmann and Thomas-Henning von Kamptz.
213d500078SThomas-Henning von Kamptz.\" 4. Neither the name of the University nor the names of its contributors
223d500078SThomas-Henning von Kamptz.\"    may be used to endorse or promote products derived from this software
233d500078SThomas-Henning von Kamptz.\"    without specific prior written permission.
243d500078SThomas-Henning von Kamptz.\"
253d500078SThomas-Henning von Kamptz.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
263d500078SThomas-Henning von Kamptz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
273d500078SThomas-Henning von Kamptz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
283d500078SThomas-Henning von Kamptz.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
293d500078SThomas-Henning von Kamptz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
303d500078SThomas-Henning von Kamptz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
313d500078SThomas-Henning von Kamptz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
323d500078SThomas-Henning von Kamptz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
333d500078SThomas-Henning von Kamptz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
343d500078SThomas-Henning von Kamptz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
353d500078SThomas-Henning von Kamptz.\" SUCH DAMAGE.
363d500078SThomas-Henning von Kamptz.\"
374020c5bcSThomas-Henning von Kamptz.\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
383d500078SThomas-Henning von Kamptz.\"
39*27bd6c32SJohn Baldwin.Dd January 23, 2025
403d500078SThomas-Henning von Kamptz.Dt GROWFS 8
41f33c0fddSRuslan Ermilov.Os
423d500078SThomas-Henning von Kamptz.Sh NAME
433d500078SThomas-Henning von Kamptz.Nm growfs
44b2168df8SEdward Tomasz Napierala.Nd expand an existing UFS file system
453d500078SThomas-Henning von Kamptz.Sh SYNOPSIS
46f33c0fddSRuslan Ermilov.Nm
473d500078SThomas-Henning von Kamptz.Op Fl Ny
483d500078SThomas-Henning von Kamptz.Op Fl s Ar size
49e35497f1SEdward Tomasz Napierala.Ar special | filesystem
503d500078SThomas-Henning von Kamptz.Sh DESCRIPTION
51e1205e80SPhilippe CharnierThe
524020c5bcSThomas-Henning von Kamptz.Nm
53e35497f1SEdward Tomasz Napieralautility makes it possible to expand an UFS file system.
54e35497f1SEdward Tomasz NapieralaBefore running
553d500078SThomas-Henning von Kamptz.Nm
56e35497f1SEdward Tomasz Napieralathe partition or slice containing the file system must be extended using
57e35497f1SEdward Tomasz Napierala.Xr gpart 8 .
58e1205e80SPhilippe CharnierThe
594020c5bcSThomas-Henning von Kamptz.Nm
60e1205e80SPhilippe Charnierutility extends the size of the file system on the specified special file.
614020c5bcSThomas-Henning von KamptzThe following options are available:
620d8effbdSAlexander Ziaee.Bl -tag -width "-s size"
633d500078SThomas-Henning von Kamptz.It Fl N
645455cc1aSChristoph Herrmann.Dq Test mode .
655455cc1aSChristoph HerrmannCauses the new file system parameters to be printed out without actually
665455cc1aSChristoph Herrmannenlarging the file system.
673d500078SThomas-Henning von Kamptz.It Fl s Ar size
685455cc1aSChristoph HerrmannDetermines the
694020c5bcSThomas-Henning von Kamptz.Ar size
705455cc1aSChristoph Herrmannof the file system after enlarging in sectors.
71e35497f1SEdward Tomasz Napierala.Ar Size
72e35497f1SEdward Tomasz Napieralais the number of 512 byte sectors unless suffixed with a
73e35497f1SEdward Tomasz Napierala.Cm b , k , m , g ,
74e35497f1SEdward Tomasz Napieralaor
75e35497f1SEdward Tomasz Napierala.Cm t
76e35497f1SEdward Tomasz Napieralawhich
77e35497f1SEdward Tomasz Napieraladenotes byte, kilobyte, megabyte, gigabyte and terabyte respectively.
784020c5bcSThomas-Henning von KamptzThis value defaults to the size of the raw partition specified in
793d500078SThomas-Henning von Kamptz.Ar special
803d500078SThomas-Henning von Kamptz(in other words,
813d500078SThomas-Henning von Kamptz.Nm
825455cc1aSChristoph Herrmannwill enlarge the file system to the size of the entire partition).
830d8effbdSAlexander Ziaee.It Fl y
840d8effbdSAlexander ZiaeeCauses
850d8effbdSAlexander Ziaee.Nm
860d8effbdSAlexander Ziaeeto assume yes
870d8effbdSAlexander Ziaeeas the answer to all operator questions.
883d500078SThomas-Henning von Kamptz.El
8970a0fb43SMina Galić.Sh EXIT STATUS
9070a0fb43SMina GalićExit status is 0 on success, and >= 1 on errors.
9170a0fb43SMina GalićErrors recoverable by user action are indicated by 2.
9270a0fb43SMina GalićOS errors, which are usually not recoverable, are indicated by 3 or greater.
933d500078SThomas-Henning von Kamptz.Sh EXAMPLES
9485941ebdSEdward Tomasz NapieralaExpand root file system to fill up available space:
957550bae5SEdward Tomasz Napierala.Dl growfs /
9685941ebdSEdward Tomasz Napierala.Pp
97e49345faSEdward Tomasz NapieralaRefresh the LUN size, resize the partition to use all available
98e49345faSEdward Tomasz Napieralacapacity, and expand the filesystem accordingly:
99e49345faSEdward Tomasz Napierala.Dl camcontrol reprobe da0
100e49345faSEdward Tomasz Napierala.Dl gpart recover da0
101e49345faSEdward Tomasz Napierala.Dl gpart resize -i 1 da0
102e49345faSEdward Tomasz Napierala.Dl growfs /dev/da0p1
1036087df9eSRuslan Ermilov.Sh SEE ALSO
104b8028f9dSJohn-Mark Gurney.Xr growfs 7 ,
105e49345faSEdward Tomasz Napierala.Xr camcontrol 8 ,
1066087df9eSRuslan Ermilov.Xr fsck 8 ,
107b2168df8SEdward Tomasz Napierala.Xr gpart 8 ,
1086087df9eSRuslan Ermilov.Xr newfs 8 ,
1098857bdbcSEdward Tomasz Napierala.Xr tunefs 8
1106087df9eSRuslan Ermilov.Sh HISTORY
1116087df9eSRuslan ErmilovThe
1126087df9eSRuslan Ermilov.Nm
1136087df9eSRuslan Ermilovutility first appeared in
1146087df9eSRuslan Ermilov.Fx 4.4 .
1152ec1a006SEdward Tomasz NapieralaThe ability to resize mounted file systems was added in
116fbb49182SGleb Smirnoff.Fx 10.0 .
1176087df9eSRuslan Ermilov.Sh AUTHORS
118bd0891ceSBaptiste Daroussin.An Christoph Herrmann Aq Mt chm@FreeBSD.org
119bd0891ceSBaptiste Daroussin.An Thomas-Henning von Kamptz Aq Mt tomsoft@FreeBSD.org
120bd0891ceSBaptiste Daroussin.An The GROWFS team Aq Mt growfs@Tomsoft.COM
121bd0891ceSBaptiste Daroussin.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
1222ec1a006SEdward Tomasz Napierala.Sh CAVEATS
1232ec1a006SEdward Tomasz NapieralaWhen expanding a file system mounted read-write, any writes to that file system
1242ec1a006SEdward Tomasz Napieralawill be temporarily suspended until the expansion is finished.
1253d500078SThomas-Henning von Kamptz.Sh BUGS
1265455cc1aSChristoph HerrmannNormally
1275455cc1aSChristoph Herrmann.Nm
128e35497f1SEdward Tomasz Napieralawrites cylinder group summary to disk and reads it again later for doing more
1295455cc1aSChristoph Herrmannupdates.
13011658916SMark MurrayThis read operation will provide unexpected data when using
1315455cc1aSChristoph Herrmann.Fl N .
13211658916SMark MurrayTherefore, this part cannot really be simulated and will be skipped in test
1335455cc1aSChristoph Herrmannmode.
134