2016-09-12 08:47:21 +03:00
|
|
|
.\" $NetBSD: resize_ffs.8,v 1.17 2016/09/12 05:47:21 sevan Exp $
|
2003-02-23 03:26:02 +03:00
|
|
|
.\"
|
2003-02-21 07:08:54 +03:00
|
|
|
.\" As its sole author, I explicitly place this man page in the public
|
|
|
|
.\" domain. Anyone may use it in any way for any purpose (though I would
|
|
|
|
.\" appreciate credit where it is due).
|
|
|
|
.\"
|
|
|
|
.\" /~\ The ASCII der Mouse
|
|
|
|
.\" \ / Ribbon Campaign
|
|
|
|
.\" X Against HTML mouse@rodents.montreal.qc.ca
|
|
|
|
.\" / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
|
2003-02-23 03:26:02 +03:00
|
|
|
.\"
|
2015-04-07 01:44:04 +03:00
|
|
|
.Dd April 6, 2015
|
2003-02-21 07:08:54 +03:00
|
|
|
.Dt RESIZE_FFS 8
|
2010-12-20 02:22:46 +03:00
|
|
|
.Os
|
2003-02-21 07:08:54 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm resize_ffs
|
2011-01-05 05:18:15 +03:00
|
|
|
.Nd resize a file system on disk or in a file
|
2003-02-21 07:08:54 +03:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2015-04-07 01:44:04 +03:00
|
|
|
.Op Fl cpvy
|
2010-10-31 01:16:07 +04:00
|
|
|
.Op Fl s Ar size
|
2011-01-05 05:18:15 +03:00
|
|
|
.Ar special
|
2003-02-21 07:08:54 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2011-01-05 05:18:15 +03:00
|
|
|
resizes a file system.
|
|
|
|
.Ar special
|
2011-08-27 20:34:57 +04:00
|
|
|
is the name of the raw disk device or file where the file system resides.
|
2003-02-21 07:08:54 +03:00
|
|
|
.Nm
|
2003-03-10 12:23:23 +03:00
|
|
|
can both grow and shrink file systems.
|
|
|
|
When growing, the disk device
|
|
|
|
must of course be large enough to contain the new file system;
|
2003-02-21 07:08:54 +03:00
|
|
|
.Nm
|
2003-03-10 12:23:23 +03:00
|
|
|
simply extends the file system data structures into the new space.
|
|
|
|
When shrinking,
|
2003-02-21 07:08:54 +03:00
|
|
|
.Nm
|
2003-03-10 12:23:23 +03:00
|
|
|
assumes this.
|
2003-02-21 07:08:54 +03:00
|
|
|
.Nm
|
|
|
|
has to copy anything that currently resides in the space being shrunk
|
2003-03-10 12:23:23 +03:00
|
|
|
away; there must be enough space free on the file system for this to
|
|
|
|
succeed.
|
2016-09-12 08:47:21 +03:00
|
|
|
If there is not,
|
2003-02-21 07:08:54 +03:00
|
|
|
.Nm
|
|
|
|
will complain and exit; when this happens, it attempts to always leave
|
2003-03-10 12:23:23 +03:00
|
|
|
the file system in a consistent state, but it is probably a good idea to
|
|
|
|
check the file system with
|
2003-02-21 07:08:54 +03:00
|
|
|
.Xr fsck 8 .
|
2010-10-31 01:16:07 +04:00
|
|
|
.Pp
|
2010-10-31 14:39:46 +03:00
|
|
|
If no
|
|
|
|
.Fl s
|
|
|
|
option is provided,
|
|
|
|
.Nm
|
|
|
|
will grow the file system to the underlying device size which is
|
|
|
|
determined from
|
2011-01-05 05:18:15 +03:00
|
|
|
.Ar special .
|
2010-10-31 01:16:07 +04:00
|
|
|
.Pp
|
2010-10-31 14:39:46 +03:00
|
|
|
The options are as follows:
|
2010-10-31 01:16:07 +04:00
|
|
|
.Bl -tag -width indent
|
2015-03-29 22:33:55 +03:00
|
|
|
.It Fl c
|
2015-03-29 22:42:15 +03:00
|
|
|
Check to see if the new size would change the file system.
|
|
|
|
No changes will be made to the file system.
|
2015-04-07 01:44:04 +03:00
|
|
|
.It Fl p
|
|
|
|
Display a progress meter during the resize process.
|
2010-10-31 14:39:46 +03:00
|
|
|
.It Fl s
|
|
|
|
Specify the file system size to which the file system should be
|
|
|
|
resized.
|
2011-08-28 21:15:16 +04:00
|
|
|
The size is given as the count of disk sectors, usually 512 bytes.
|
2011-08-29 01:25:11 +04:00
|
|
|
It will not work correctly for file systems with other sector sizes.
|
2011-08-28 21:15:16 +04:00
|
|
|
To see the
|
2011-08-27 20:34:57 +04:00
|
|
|
exact value, have a look at the disk specification or the disklabel.
|
2010-10-31 14:39:46 +03:00
|
|
|
Mostly used to shrink file systems.
|
2015-03-29 22:42:15 +03:00
|
|
|
.It Fl v
|
|
|
|
Be more verbose.
|
2010-10-31 01:16:07 +04:00
|
|
|
.It Fl y
|
2010-10-31 14:39:46 +03:00
|
|
|
Disable sanity questions made by
|
|
|
|
.Nm .
|
2010-10-31 01:16:07 +04:00
|
|
|
.El
|
2003-02-21 07:08:54 +03:00
|
|
|
.Sh WARNING
|
|
|
|
.Em Interrupting
|
|
|
|
.Nm
|
|
|
|
.Em "may leave your file system in an inconsistent state and require a"
|
|
|
|
.Em "restore from backup."
|
|
|
|
It attempts to write in the proper order to avoid problems, but as it is
|
|
|
|
still considered experimental, you should take great care when using it.
|
|
|
|
.Pp
|
|
|
|
When
|
|
|
|
.Nm
|
2003-03-10 12:23:23 +03:00
|
|
|
is applied to a consistent file system, it should always produce a
|
|
|
|
consistent file system; if the file system is not consistent to start
|
2003-02-21 07:08:54 +03:00
|
|
|
with,
|
|
|
|
.Nm
|
|
|
|
may misbehave, anything from dumping core to completely curdling the
|
2003-03-10 12:23:23 +03:00
|
|
|
data.
|
2016-09-12 08:47:21 +03:00
|
|
|
It is probably wise to
|
2003-02-21 07:08:54 +03:00
|
|
|
.Xr fsck 8
|
2003-03-10 12:23:23 +03:00
|
|
|
the file system before and after, just to be safe.
|
2011-01-05 05:18:15 +03:00
|
|
|
You should be aware that just because
|
2010-10-31 14:39:46 +03:00
|
|
|
.Xr fsck 8
|
|
|
|
is happy with the file system does not mean it is intact.
|
2010-10-31 01:16:07 +04:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Nm
|
2010-10-31 14:39:46 +03:00
|
|
|
exits with 0 on success.
|
2010-10-31 01:16:07 +04:00
|
|
|
Any major problems will cause
|
|
|
|
.Nm
|
|
|
|
to exit with the non-zero
|
|
|
|
.Xr exit 3
|
|
|
|
codes, so as to alert any invoking program or script that human
|
|
|
|
intervention is required.
|
2003-02-21 07:08:54 +03:00
|
|
|
.Sh EXAMPLES
|
2010-10-31 01:16:07 +04:00
|
|
|
.Dl resize_ffs Cm /dev/vg00/rlv1
|
2010-10-31 14:39:46 +03:00
|
|
|
.Pp
|
|
|
|
will enlarge the file system on the Logical Volume
|
2010-10-31 01:16:07 +04:00
|
|
|
.Pa /dev/vg00/lv1
|
2010-10-31 14:39:46 +03:00
|
|
|
from Volume Group vg00 to the current device size.
|
2003-02-21 07:08:54 +03:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr fs 5 ,
|
2003-03-10 12:23:23 +03:00
|
|
|
.Xr fsck 8 ,
|
|
|
|
.Xr newfs 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command first appeared in
|
|
|
|
.Nx 2.0 .
|
|
|
|
.Sh AUTHORS
|
|
|
|
.An der Mouse
|
|
|
|
.Aq mouse@rodents.montreal.qc.ca
|
2011-01-05 05:18:15 +03:00
|
|
|
(primary author)
|
|
|
|
.An Jeff Rizzo
|
|
|
|
.Aq riz@NetBSD.org
|
|
|
|
(Byteswapped file system and UFS2 support)
|
2003-02-21 07:08:54 +03:00
|
|
|
.Pp
|
|
|
|
A big bug-finding kudos goes to John Kohl for finding the rotational
|
2003-03-10 12:23:23 +03:00
|
|
|
layout bug referred to in the
|
|
|
|
.Sx WARNING
|
|
|
|
section above.
|
2003-02-21 07:08:54 +03:00
|
|
|
.Sh BUGS
|
2003-03-10 12:23:23 +03:00
|
|
|
Can fail to shrink a file system when there actually is enough space,
|
2003-02-21 07:08:54 +03:00
|
|
|
because it does not distinguish between a block allocated as a block
|
2003-03-10 12:23:23 +03:00
|
|
|
and a block fully occupied by two or more frags.
|
|
|
|
This is unlikely to
|
2003-02-21 07:08:54 +03:00
|
|
|
occur in practice; except for pathological cases, it can happen only
|
|
|
|
when the new size is extremely close to the minimum possible.
|
|
|
|
.Pp
|
|
|
|
Has no intelligence whatever when it comes to allocating blocks to copy
|
|
|
|
data into when shrinking.
|
2010-10-31 01:16:07 +04:00
|
|
|
.Pp
|
2016-09-12 08:47:21 +03:00
|
|
|
Does not currently support shrinking FFSv2 file systems.
|