2001-06-05 15:22:41 +04:00
|
|
|
.\" $NetBSD: newfs.8,v 1.28 2001/06/05 11:22:51 wiz Exp $
|
1995-03-18 17:54:19 +03:00
|
|
|
.\"
|
1994-06-08 23:27:32 +04:00
|
|
|
.\" Copyright (c) 1983, 1987, 1991, 1993, 1994
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
|
|
|
.\"
|
1997-09-16 18:05:39 +04:00
|
|
|
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
|
1993-03-22 11:04:00 +03:00
|
|
|
.\"
|
1998-05-07 07:40:48 +04:00
|
|
|
.Dd May 6, 1998
|
1993-03-21 12:45:37 +03:00
|
|
|
.Dt NEWFS 8
|
2001-06-05 15:22:41 +04:00
|
|
|
.Os
|
1993-03-21 12:45:37 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm newfs ,
|
1994-07-16 09:18:11 +04:00
|
|
|
.Nm mount_mfs
|
1993-03-21 12:45:37 +03:00
|
|
|
.Nd construct a new file system
|
|
|
|
.Sh SYNOPSIS
|
1999-03-07 14:02:05 +03:00
|
|
|
.Nm ""
|
1998-03-18 20:10:15 +03:00
|
|
|
.Op Fl B Ar byte order
|
1994-06-08 23:27:32 +04:00
|
|
|
.Op Fl NO
|
|
|
|
.Op Fl S Ar sector-size
|
1997-09-16 18:05:39 +04:00
|
|
|
.Op Fl T Ar disktype
|
1996-12-26 07:37:18 +03:00
|
|
|
.Op Fl a Ar maxcontig
|
1994-06-08 23:27:32 +04:00
|
|
|
.Op Fl b Ar block-size
|
|
|
|
.Op Fl c Ar cylinders
|
|
|
|
.Op Fl d Ar rotdelay
|
|
|
|
.Op Fl e Ar maxbpg
|
|
|
|
.Op Fl f Ar frag-size
|
|
|
|
.Op Fl i Ar bytes
|
|
|
|
.Op Fl k Ar skew
|
|
|
|
.Op Fl l Ar interleave
|
|
|
|
.Op Fl m Ar free space
|
1997-09-16 18:05:39 +04:00
|
|
|
.Op Fl n Ar rotational positions
|
1994-06-08 23:27:32 +04:00
|
|
|
.Op Fl o Ar optimization
|
|
|
|
.Op Fl p Ar sectors
|
|
|
|
.Op Fl r Ar revolutions
|
|
|
|
.Op Fl s Ar size
|
|
|
|
.Op Fl t Ar tracks
|
|
|
|
.Op Fl u Ar sectors
|
|
|
|
.Op Fl x Ar sectors
|
1993-03-21 12:45:37 +03:00
|
|
|
.Ar special
|
1993-07-28 04:56:43 +04:00
|
|
|
.Nm mount_mfs
|
1994-06-08 23:27:32 +04:00
|
|
|
.Op Fl N
|
1997-09-16 18:05:39 +04:00
|
|
|
.Op Fl T Ar disktype
|
1996-12-26 07:37:18 +03:00
|
|
|
.Op Fl a Ar maxcontig
|
1994-06-08 23:27:32 +04:00
|
|
|
.Op Fl b Ar block-size
|
|
|
|
.Op Fl c Ar cylinders
|
|
|
|
.Op Fl d Ar rotdelay
|
|
|
|
.Op Fl e Ar maxbpg
|
|
|
|
.Op Fl f Ar frag-size
|
|
|
|
.Op Fl i Ar bytes
|
|
|
|
.Op Fl m Ar free space
|
1997-09-16 18:05:39 +04:00
|
|
|
.Op Fl n Ar rotational positions
|
1994-06-08 23:27:32 +04:00
|
|
|
.Op Fl o Ar options
|
|
|
|
.Op Fl s Ar size
|
1993-03-21 12:45:37 +03:00
|
|
|
.Ar special node
|
|
|
|
.Sh DESCRIPTION
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm
|
1993-03-21 12:45:37 +03:00
|
|
|
replaces the more obtuse
|
1996-12-26 07:37:18 +03:00
|
|
|
mkfs
|
1993-03-21 12:45:37 +03:00
|
|
|
program.
|
1998-04-29 13:49:10 +04:00
|
|
|
Before running
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm
|
1993-03-21 12:45:37 +03:00
|
|
|
or
|
1993-07-28 04:56:43 +04:00
|
|
|
.Nm mount_mfs ,
|
1998-04-29 13:49:10 +04:00
|
|
|
the disk must be labeled using
|
1993-03-21 12:45:37 +03:00
|
|
|
.Xr disklabel 8 .
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm
|
1993-03-21 12:45:37 +03:00
|
|
|
builds a file system on the specified special device
|
|
|
|
basing its defaults on the information in the disk label.
|
|
|
|
Typically the defaults are reasonable, however
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm
|
1993-03-21 12:45:37 +03:00
|
|
|
has numerous options to allow the defaults to be selectively overridden.
|
|
|
|
.Pp
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm mount_mfs
|
1993-03-21 12:45:37 +03:00
|
|
|
is used to build a file system in virtual memory and then mount it
|
|
|
|
on a specified node.
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm mount_mfs
|
1993-03-21 12:45:37 +03:00
|
|
|
exits and the contents of the file system are lost
|
|
|
|
when the file system is unmounted.
|
|
|
|
If
|
1993-07-28 04:56:43 +04:00
|
|
|
.Nm mount_mfs
|
1993-03-21 12:45:37 +03:00
|
|
|
is sent a signal while running,
|
|
|
|
for example during system shutdown,
|
|
|
|
it will attempt to unmount its
|
|
|
|
corresponding file system.
|
|
|
|
The parameters to
|
1993-07-28 04:56:43 +04:00
|
|
|
.Nm mount_mfs
|
1993-03-21 12:45:37 +03:00
|
|
|
are the same as those to
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm "" .
|
1997-09-16 18:05:39 +04:00
|
|
|
If the
|
|
|
|
.Fl T
|
|
|
|
flag is specified (see below), the special file is unused.
|
|
|
|
Otherwise, it is only used to read the disk label which provides
|
1993-03-21 12:45:37 +03:00
|
|
|
a set of configuration parameters for the memory based file system.
|
1998-04-29 13:49:10 +04:00
|
|
|
The special file is typically that of the primary swap area, since
|
|
|
|
that is where the file system will be backed up when free memory
|
|
|
|
gets low and the memory supporting the file system has to be paged.
|
|
|
|
If the keyword ``swap'' is used instead of a special file name,
|
|
|
|
default configuration parameters will be used.
|
|
|
|
(This option is useful when trying to use
|
1994-12-18 09:10:22 +03:00
|
|
|
.Nm mount_mfs
|
1998-04-29 13:49:10 +04:00
|
|
|
on a machine without any disks).
|
1993-03-21 12:45:37 +03:00
|
|
|
.Pp
|
|
|
|
The following options define the general layout policies.
|
|
|
|
.Bl -tag -width Fl
|
1998-03-18 20:10:15 +03:00
|
|
|
.It Fl B
|
2001-03-02 20:57:34 +03:00
|
|
|
Specify the metadata byte order of the filesystem to be created.
|
1998-04-29 13:49:10 +04:00
|
|
|
Valid byte orders are `be' and `le'.
|
|
|
|
If no byte order is specified, the filesystem is created in host
|
|
|
|
byte order.
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl N
|
|
|
|
Causes the file system parameters to be printed out
|
|
|
|
without really creating the file system.
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl O
|
1998-04-29 13:49:10 +04:00
|
|
|
Creates a
|
1998-02-06 08:54:12 +03:00
|
|
|
.Bx 4.3
|
|
|
|
format filesystem.
|
1994-06-08 23:27:32 +04:00
|
|
|
This options is primarily used to build root filesystems
|
|
|
|
that can be understood by older boot ROMs.
|
1997-09-16 18:05:39 +04:00
|
|
|
.It Fl T
|
|
|
|
Uses information for the specified disk from
|
|
|
|
.Pa /etc/disktab
|
|
|
|
instead of trying to get the information from a disklabel.
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl a Ar maxcontig
|
1994-06-08 23:27:32 +04:00
|
|
|
This specifies the maximum number of contiguous blocks that will be
|
|
|
|
laid out before forcing a rotational delay (see the
|
1993-03-21 12:45:37 +03:00
|
|
|
.Fl d
|
1994-06-08 23:27:32 +04:00
|
|
|
option).
|
1994-12-01 21:46:37 +03:00
|
|
|
The default value is 8.
|
1993-03-21 12:45:37 +03:00
|
|
|
See
|
|
|
|
.Xr tunefs 8
|
|
|
|
for more details on how to set this option.
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl b Ar block-size
|
1998-04-29 13:49:10 +04:00
|
|
|
The block size of the file system, in bytes.
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl c Ar #cylinders/group
|
|
|
|
The number of cylinders per cylinder group in a file system.
|
|
|
|
The default value is 16.
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl d Ar rotdelay
|
1994-06-08 23:27:32 +04:00
|
|
|
This specifies the expected time (in milliseconds) to service a transfer
|
|
|
|
completion interrupt and initiate a new transfer on the same disk.
|
1994-12-01 21:46:37 +03:00
|
|
|
The default is 0 milliseconds.
|
1993-03-21 12:45:37 +03:00
|
|
|
See
|
|
|
|
.Xr tunefs 8
|
|
|
|
for more details on how to set this option.
|
1997-09-16 18:05:39 +04:00
|
|
|
.ne 1i
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl e Ar maxbpg
|
|
|
|
This indicates the maximum number of blocks any single file can
|
|
|
|
allocate out of a cylinder group before it is forced to begin
|
|
|
|
allocating blocks from another cylinder group.
|
|
|
|
The default is about one quarter of the total blocks in a cylinder group.
|
|
|
|
See
|
|
|
|
.Xr tunefs 8
|
|
|
|
for more details on how to set this option.
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl f Ar frag-size
|
|
|
|
The fragment size of the file system in bytes.
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl i Ar number of bytes per inode
|
|
|
|
This specifies the density of inodes in the file system.
|
1996-06-06 19:23:47 +04:00
|
|
|
The default is to create an inode for each 4096 bytes of data space.
|
1993-03-21 12:45:37 +03:00
|
|
|
If fewer inodes are desired, a larger number should be used;
|
|
|
|
to create more inodes a smaller number should be given.
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl m Ar free space \&%
|
|
|
|
The percentage of space reserved from normal users; the minimum free
|
|
|
|
space threshold.
|
1996-06-06 19:23:47 +04:00
|
|
|
The default value used is 5%.
|
1994-06-08 23:27:32 +04:00
|
|
|
See
|
|
|
|
.Xr tunefs 8
|
|
|
|
for more details on how to set this option.
|
1997-09-16 18:05:39 +04:00
|
|
|
.It Fl n Ar rotational\ positions
|
|
|
|
Determines how many rotational time slots there are in
|
|
|
|
one revolution of the disk.
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl o Ar optimization\ preference
|
|
|
|
.Pq ``space'' or ``time''
|
|
|
|
The file system can either be instructed to try to minimize the time spent
|
|
|
|
allocating blocks, or to try to minimize the space fragmentation on the disk.
|
1996-06-06 19:23:47 +04:00
|
|
|
If the value of minfree (see above) is less than 5%,
|
1994-06-08 23:27:32 +04:00
|
|
|
the default is to optimize for space;
|
1996-06-06 19:23:47 +04:00
|
|
|
if the value of minfree is greater than or equal to 5%,
|
1994-06-08 23:27:32 +04:00
|
|
|
the default is to optimize for time.
|
|
|
|
See
|
|
|
|
.Xr tunefs 8
|
|
|
|
for more details on how to set this option.
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl s Ar size
|
2000-12-01 15:48:09 +03:00
|
|
|
The size of the file system in sectors. For
|
|
|
|
.Nm mount_mfs
|
|
|
|
an
|
|
|
|
.Sq m
|
|
|
|
suffix will be interpreted as a number of megabytes.
|
1994-06-08 23:27:32 +04:00
|
|
|
.El
|
1993-03-21 12:45:37 +03:00
|
|
|
.Pp
|
1998-04-29 13:49:10 +04:00
|
|
|
The following options override the standard sizes for the disk geometry.
|
1993-03-21 12:45:37 +03:00
|
|
|
Their default values are taken from the disk label.
|
|
|
|
Changing these defaults is useful only when using
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm
|
1994-06-08 23:27:32 +04:00
|
|
|
to build a file system whose raw image will eventually be used on a
|
|
|
|
different type of disk than the one on which it is initially created
|
|
|
|
(for example on a write-once disk).
|
|
|
|
Note that changing any of these values from their defaults will make
|
1998-04-29 13:49:10 +04:00
|
|
|
it impossible for
|
|
|
|
.Xr fsck_ffs 8
|
1997-03-08 16:47:08 +03:00
|
|
|
to find the alternative superblocks if the standard superblock is lost.
|
1994-06-08 23:27:32 +04:00
|
|
|
.Bl -tag -width Fl
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl S Ar sector-size
|
|
|
|
The size of a sector in bytes (almost never anything but 512).
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl k Ar sector \&0 skew , per track
|
|
|
|
Used to describe perturbations in the media format to compensate for
|
|
|
|
a slow controller.
|
|
|
|
Track skew is the offset of sector 0 on track N relative to sector 0
|
|
|
|
on track N-1 on the same cylinder.
|
|
|
|
.It Fl l Ar hardware sector interleave
|
|
|
|
Used to describe perturbations in the media format to compensate for
|
|
|
|
a slow controller.
|
|
|
|
Interleave is physical sector interleave on each track,
|
|
|
|
specified as the denominator of the ratio:
|
|
|
|
.Dl sectors read/sectors passed over
|
|
|
|
Thus an interleave of 1/1 implies contiguous layout, while 1/2 implies
|
|
|
|
logical sector 0 is separated by one sector from logical sector 1.
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl p Ar spare sectors per track
|
1994-06-08 23:27:32 +04:00
|
|
|
Spare sectors (bad sector replacements) are physical sectors that occupy
|
|
|
|
space at the end of each track.
|
1993-03-21 12:45:37 +03:00
|
|
|
They are not counted as part of the sectors/track
|
|
|
|
.Pq Fl u
|
|
|
|
since they are not available to the file system for data allocation.
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl r Ar revolutions/minute
|
|
|
|
The speed of the disk in revolutions per minute.
|
1997-09-16 18:05:39 +04:00
|
|
|
.ne 1i
|
1994-06-08 23:27:32 +04:00
|
|
|
.It Fl t Ar #tracks/cylinder
|
|
|
|
The number of tracks/cylinder available for data allocation by the file
|
|
|
|
system.
|
|
|
|
.It Fl u Ar sectors/track
|
|
|
|
The number of sectors per track available for data allocation by the file
|
|
|
|
system.
|
|
|
|
This does not include sectors reserved at the end of each track for bad
|
|
|
|
block replacement (see the
|
|
|
|
.Fl p
|
1998-04-29 13:49:10 +04:00
|
|
|
option).
|
1993-03-21 12:45:37 +03:00
|
|
|
.It Fl x Ar spare sectors per cylinder
|
1994-06-08 23:27:32 +04:00
|
|
|
Spare sectors (bad sector replacements) are physical sectors that occupy
|
|
|
|
space at the end of the last track in the cylinder.
|
1993-03-21 12:45:37 +03:00
|
|
|
They are deducted from the sectors/track
|
|
|
|
.Pq Fl u
|
1994-06-08 23:27:32 +04:00
|
|
|
of the last track of each cylinder since they are not available to the file
|
|
|
|
system for data allocation.
|
1993-03-21 12:45:37 +03:00
|
|
|
.El
|
1994-06-08 23:27:32 +04:00
|
|
|
.Pp
|
|
|
|
The options to the
|
1993-07-28 04:56:43 +04:00
|
|
|
.Nm mount_mfs
|
1994-06-08 23:27:32 +04:00
|
|
|
command are as described for the
|
1997-09-15 10:23:03 +04:00
|
|
|
.Nm
|
1994-06-08 23:27:32 +04:00
|
|
|
command, except for the
|
|
|
|
.Fl o
|
|
|
|
option.
|
|
|
|
.Pp
|
|
|
|
That option is as follows:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl o
|
|
|
|
Options are specified with a
|
|
|
|
.Fl o
|
|
|
|
flag followed by a comma separated string of options.
|
|
|
|
See the
|
1993-03-21 12:45:37 +03:00
|
|
|
.Xr mount 8
|
1994-06-08 23:27:32 +04:00
|
|
|
man page for possible options and their meanings.
|
1993-03-21 12:45:37 +03:00
|
|
|
.El
|
1999-05-17 00:58:49 +04:00
|
|
|
.Sh NOTES
|
1998-05-07 07:40:48 +04:00
|
|
|
If the file system will be exported over NFS, the
|
|
|
|
.Xr fsirand 8
|
|
|
|
utility should be run after
|
|
|
|
.Nm
|
|
|
|
to improve security.
|
1999-03-17 00:52:34 +03:00
|
|
|
.Pp
|
|
|
|
The owner and group ids of the root node of the new filesystem
|
|
|
|
are set to the effective uid and gid of the user initializing
|
|
|
|
the filesystem.
|
1999-05-17 00:58:49 +04:00
|
|
|
.Pp
|
|
|
|
For the
|
|
|
|
.Nm
|
|
|
|
command to succeed,
|
2001-04-03 15:21:57 +04:00
|
|
|
the disklabel should first be updated such that the fstype field for the
|
|
|
|
partition is set to
|
|
|
|
.Bx 4.2 .
|
1993-03-21 12:45:37 +03:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr disktab 5 ,
|
|
|
|
.Xr fs 5 ,
|
1994-06-08 23:27:32 +04:00
|
|
|
.Xr dumpfs 8 ,
|
1993-03-21 12:45:37 +03:00
|
|
|
.Xr disklabel 8 ,
|
|
|
|
.Xr diskpart 8 ,
|
2001-04-03 15:21:57 +04:00
|
|
|
.\" .Xr format 8 ,
|
1998-05-07 07:40:48 +04:00
|
|
|
.Xr fsck_ffs 8 ,
|
|
|
|
.Xr fsirand 8 ,
|
1994-06-08 23:27:32 +04:00
|
|
|
.Xr mount 8 ,
|
1993-03-21 12:45:37 +03:00
|
|
|
.Xr tunefs 8
|
|
|
|
.Rs
|
|
|
|
.%A M. McKusick
|
|
|
|
.%A W. Joy
|
|
|
|
.%A S. Leffler
|
|
|
|
.%A R. Fabry
|
|
|
|
.%T A Fast File System for UNIX ,
|
|
|
|
.%J ACM Transactions on Computer Systems 2
|
|
|
|
.%V 3
|
|
|
|
.%P pp 181-197
|
|
|
|
.%D August 1984
|
|
|
|
.%O (reprinted in the BSD System Manager's Manual)
|
|
|
|
.Re
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command appeared in
|
|
|
|
.Bx 4.2 .
|