xref: /netbsd-src/sbin/resize_lfs/resize_lfs.8 (revision 8b0f9554ff8762542c4defc4f70e1eb76fb508fa)
1.\"     $NetBSD: resize_lfs.8,v 1.4 2006/09/04 18:34:42 wiz Exp $
2.\"
3.\" Copyright (c) 2005 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Konrad E. Schroder <perseant@hhhh.org>.
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 acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd September 4, 2006
38.Dt RESIZE_LFS 8
39.Sh NAME
40.Nm resize_lfs
41.Nd resize a mounted log-structured filesystem
42.Sh SYNOPSIS
43.Nm
44.Op Fl v
45.Op Fl s Ar new-size
46.Ar mounted-file-system
47.Sh DESCRIPTION
48.Nm
49grows or shrinks a mounted log-structured filesystem to the specified size.
50.Ar mounted-file-system
51is the name of the filesystem to be resized, and
52.Ar new-size
53is the desired new filesystem size, in sectors.
54If
55.Ar new-size
56is not specified,
57.Nm
58will default to the current size of the partition containing the filesystem
59in question.
60.Pp
61When growing, the partition must be large enough to contain a filesystem
62of the specified size; when shrinking,
63.Nm
64must first
65.Dq clean
66the segments that will be invalid when the filesystem is shrunk.
67If this cleaning process results in these segments becoming redirtied,
68this indicates that the given new size is not large enough to contain the
69existing filesystem data, and
70.Nm
71will return an error.
72.Sh EXAMPLES
73To resize the file system mounted at
74.Pa /home
75to 32576 sectors:
76.Dl resize_lfs -s 32576 /home
77.Sh SEE ALSO
78.Xr fsck_lfs 8 ,
79.Xr lfs_cleanerd 8 ,
80.Xr newfs_lfs 8
81.Sh HISTORY
82The
83.Nm
84command first appeared in
85.Nx 3.0 .
86.Sh AUTHORS
87.An Konrad Schroder
88.Aq perseant@NetBSD.org
89.Sh BUGS
90.Nm
91should be able to resize an unmounted filesystem as well.
92