NetBSD/sbin/resize_lfs/resize_lfs.8

86 lines
2.8 KiB
Groff

.\" $NetBSD: resize_lfs.8,v 1.6 2009/03/11 13:35:21 joerg Exp $
.\"
.\" Copyright (c) 2005 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Konrad E. Schroder <perseant@hhhh.org>.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd September 4, 2006
.Dt RESIZE_LFS 8
.Os
.Sh NAME
.Nm resize_lfs
.Nd resize a mounted log-structured filesystem
.Sh SYNOPSIS
.Nm
.Op Fl v
.Op Fl s Ar new-size
.Ar mounted-file-system
.Sh DESCRIPTION
.Nm
grows or shrinks a mounted log-structured filesystem to the specified size.
.Ar mounted-file-system
is the name of the filesystem to be resized, and
.Ar new-size
is the desired new filesystem size, in sectors.
If
.Ar new-size
is not specified,
.Nm
will default to the current size of the partition containing the filesystem
in question.
.Pp
When growing, the partition must be large enough to contain a filesystem
of the specified size; when shrinking,
.Nm
must first
.Dq clean
the segments that will be invalid when the filesystem is shrunk.
If this cleaning process results in these segments becoming redirtied,
this indicates that the given new size is not large enough to contain the
existing filesystem data, and
.Nm
will return an error.
.Sh EXAMPLES
To resize the file system mounted at
.Pa /home
to 32576 sectors:
.Dl resize_lfs -s 32576 /home
.Sh SEE ALSO
.Xr fsck_lfs 8 ,
.Xr lfs_cleanerd 8 ,
.Xr newfs_lfs 8
.Sh HISTORY
The
.Nm
command first appeared in
.Nx 3.0 .
.Sh AUTHORS
.An Konrad Schroder
.Aq perseant@NetBSD.org
.Sh BUGS
.Nm
should be able to resize an unmounted filesystem as well.