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