xref: /netbsd-src/sbin/resize_lfs/resize_lfs.8 (revision 0e5f0af7e926bb34d9980ba785db22731348f500)
1.\"     $NetBSD: resize_lfs.8,v 1.6 2009/03/11 13:35:21 joerg 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.Os
33.Sh NAME
34.Nm resize_lfs
35.Nd resize a mounted log-structured filesystem
36.Sh SYNOPSIS
37.Nm
38.Op Fl v
39.Op Fl s Ar new-size
40.Ar mounted-file-system
41.Sh DESCRIPTION
42.Nm
43grows or shrinks a mounted log-structured filesystem to the specified size.
44.Ar mounted-file-system
45is the name of the filesystem to be resized, and
46.Ar new-size
47is the desired new filesystem size, in sectors.
48If
49.Ar new-size
50is not specified,
51.Nm
52will default to the current size of the partition containing the filesystem
53in question.
54.Pp
55When growing, the partition must be large enough to contain a filesystem
56of the specified size; when shrinking,
57.Nm
58must first
59.Dq clean
60the segments that will be invalid when the filesystem is shrunk.
61If this cleaning process results in these segments becoming redirtied,
62this indicates that the given new size is not large enough to contain the
63existing filesystem data, and
64.Nm
65will return an error.
66.Sh EXAMPLES
67To resize the file system mounted at
68.Pa /home
69to 32576 sectors:
70.Dl resize_lfs -s 32576 /home
71.Sh SEE ALSO
72.Xr fsck_lfs 8 ,
73.Xr lfs_cleanerd 8 ,
74.Xr newfs_lfs 8
75.Sh HISTORY
76The
77.Nm
78command first appeared in
79.Nx 3.0 .
80.Sh AUTHORS
81.An Konrad Schroder
82.Aq perseant@NetBSD.org
83.Sh BUGS
84.Nm
85should be able to resize an unmounted filesystem as well.
86