1 .\" $NetBSD: resize_ffs.8,v 1.2 2003/02/23 00:26:02 lukem Exp $
3 .\" As its sole author, I explicitly place this man page in the public
4 .\" domain. Anyone may use it in any way for any purpose (though I would
5 .\" appreciate credit where it is due).
7 .\" /~\ The ASCII der Mouse
8 .\" \ / Ribbon Campaign
9 .\" X Against HTML mouse@rodents.montreal.qc.ca
10 .\" / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
16 .Nd resize an on-disk file system
19 .Ar file-system-raw-device
23 resizes a file system on disk.
24 .Ar file-system-raw-device
25 is the name of the raw disk device where the file system resides;
27 is the desired new file system size, in sectors.
28 (Sectors are almost always 512 bytes, and
30 can both grow and shrink file systems.
31 When growing, the disk device
32 must of course be large enough to contain the new file system;
34 simply extends the file system data structures into the new space.
38 It will not work correctly for file systems with other sector sizes.)
40 has to copy anything that currently resides in the space being shrunk
41 away; there must be enough space free on the file system for this to
45 will complain and exit; when this happens, it attempts to always leave
46 the file system in a consistent state, but it is probably a good idea to
47 check the file system with
51 should still be considered experimental. It still needs to be validated
52 with a rigorous regression test suite.
55 .Em "may leave your file system in an inconsistent state and require a"
56 .Em "restore from backup."
57 It attempts to write in the proper order to avoid problems, but as it is
58 still considered experimental, you should take great care when using it.
62 is applied to a consistent file system, it should always produce a
63 consistent file system; if the file system is not consistent to start
66 may misbehave, anything from dumping core to completely curdling the
70 the file system before and after, just to be safe.
71 .\" Remove this when (if) fsck gets fixed.
73 There is a bug somewhere in fsck; it does not check certain data
75 A past version of this program had a bug that produced corrupted
76 rotation layout summary tables, which would panic the kernel.
77 This bug is believed fixed, and there are currently no
78 known bugs in the program.
79 However, you should be aware that just
80 because fsck is happy with the file system does not mean it is intact.
82 .Ic resize_ffs Cm /dev/rsd1e 29574
90 command first appeared in
94 .Aq mouse@rodents.montreal.qc.ca
96 A big bug-finding kudos goes to John Kohl for finding the rotational
97 layout bug referred to in the
101 Has not been tested and probably won't work on opposite-endian file
104 Can fail to shrink a file system when there actually is enough space,
105 because it does not distinguish between a block allocated as a block
106 and a block fully occupied by two or more frags.
108 occur in practice; except for pathological cases, it can happen only
109 when the new size is extremely close to the minimum possible.
111 Has no intelligence whatever when it comes to allocating blocks to copy
112 data into when shrinking.