History log of /freebsd-10.0-release/sbin/newfs/newfs.8
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 255977 01-Oct-2013 pluknet

Sweep man pages replacing ad -> ada.

Approved by: re (blackend)
MFC after: 1 week
X-MFC note: stable/9 only


# 249373 11-Apr-2013 joel

Remove contractions.


# 248623 22-Mar-2013 mckusick

The purpose of this change to the FFS layout policy is to reduce the
running time for a full fsck. It also reduces the random access time
for large files and speeds the traversal time for directory tree walks.

The key idea is to reserve a small area in each cylinder group
immediately following the inode blocks for the use of metadata,
specifically indirect blocks and directory contents. The new policy
is to preferentially place metadata in the metadata area and
everything else in the blocks that follow the metadata area.

The size of this area can be set when creating a filesystem using
newfs(8) or changed in an existing filesystem using tunefs(8).
Both utilities use the `-k held-for-metadata-blocks' option to
specify the amount of space to be held for metadata blocks in each
cylinder group. By default, newfs(8) sets this area to half of
minfree (typically 4% of the data area).

This work was inspired by a paper presented at Usenix's FAST '13:
www.usenix.org/conference/fast13/ffsck-fast-file-system-checker

Details of this implementation appears in the April 2013 of ;login:
www.usenix.org/publications/login/april-2013-volume-38-number-2.
A copy of the April 2013 ;login: paper can also be downloaded
from: www.mckusick.com/publications/faster_fsck.pdf.

Reviewed by: kib
Tested by: Peter Holm
MFC after: 4 weeks


# 223430 22-Jun-2011 trasz

Advertise growfs(8) a little better.


# 222423 28-May-2011 mckusick

Update the manual page to reflect the new 32K/4K defaults.

Reminded by: Ivan Voras


# 218951 22-Feb-2011 jh

Xref makefs(8).

PR: 154708
Submitted by: jhs


# 218726 16-Feb-2011 mckusick

Add the -j option to enable soft updates journaling when creating
a new file system.

Reviewed by: Kostik Belousov <kostikbel@gmail.com>


# 216798 29-Dec-2010 kib

Add support for FS_TRIM to user-mode UFS utilities.

Reviewed by: mckusick, pjd, pho
Tested by: pho
MFC after: 1 month


# 212610 14-Sep-2010 gjb

Synchronize newfs(8) manual with code.

PR: 61716
Submitted by: Radim Kolar <hsn at netmag cz>
Patch by: arundel
Approved by: keramida (mentor)
MFC after: 1 week


# 212498 12-Sep-2010 gjb

Rewording and typo fixes in newfs(8).

PR: 150490
Submitted by: Eitan Adler <foreignuser at eitanadler com>
Additional fixes by: Warren Block <wblock at wonkity com>, keramida
Approved by: keramida (mentor)
MFC after: 1 week


# 204936 09-Mar-2010 sobomax

Fix "Empty input line" mdoc warning.

Submitted by: Alexander Best


# 191656 29-Apr-2009 trasz

Slightly improve gjournal documentation.

Reviewed by: pjd


# 185588 03-Dec-2008 luigi

Enable operation of newfs on plain files, which is useful when you
want to prepare disk images for emulators (though 'makefs' in port
can do something similar).

This relies on:
+ minor changes to pass the consistency checks even when working on a file;

+ an additional option, '-p partition' , to specify the disk partition to
initialize;

+ some changes on the I/O routines to deal with partition offsets.

The latter was a bit tricky to implement, see the details in newfs.h:
in newfs, I/O is done through libufs which assumes that the file
descriptor refers to the whole partition. Introducing support for
the offset in libufs would require a non-backward compatible change
in the library, to be dealt with a version bump or with symbol
versioning.

I felt both approaches to be overkill for this specific application,
especially because there might be other changes to libufs that might
become necessary in the near future.

So I used the following trick:
- read access is always done by calling bread() directly, so we just add
the offset in the (few) places that call bread();
- write access is done through bwrite() and sbwrite(), which in turn
calls bwrite(). To avoid rewriting sbwrite(), we supply our own version
of bwrite() here, which takes precedence over the version in libufs.

MFC after: 4 weeks


# 177482 21-Mar-2008 remko

Replace reference from vinum.8 to gvinum.8, it was advised in the PR to
replace this with vinum.4, but that's the kernel interface manual, which
is not appropriate in my understanding. I think that gvinum is a suitable
replacement for this.

PR: docs/121938
Submitted by: "Federico" <federicogalvezdurand at yahoo dot com>
MFC after: 3 days


# 174675 16-Dec-2007 phk

Rename the undocumented -E option to -X.

Implement -E option which will erase the filesystem sectors before
making the new filesystem. Reserved space in front of the superblock
(bootcode) is not erased.

NB: Erasing can take as long time as writing every sector sequentially.

This is relevant for all flash based disks which use wearlevelling.


# 174011 28-Nov-2007 yar

MFp4:

Add a new option to newfs(8), -r, to specify reserved space at the
end of the device. It can be useful, e.g., when the device is to
become a member of a gmirror array later w/o losing the file system
on it.

Document the new option in the manpage.

While I'm here, improve error handling for -s option, which is
syntactically similar to -r; and document the fact that -s0 selects
the default fs size explicitly, which can be useful, e.g., in a
menu-based wrapper around newfs(8) requiring some value be entered
for the fs size.

Also fix a small typo in the help line for -s (missing space).

Idea and initial implementation by: marck
Discussed on: -fs
Critical review by: bde
Tested with: cmp(1)


# 163842 31-Oct-2006 pjd

Add -J flag to both newfs(8) and tunefs(8) which allows to enable gjournal
support.
I left -j flag for UFS journal implementation which we may gain at some
point.

Sponsored by: home.pl


# 140610 22-Jan-2005 ru

Polish previous revision:

- Bump document date.
- Spell "file system" properly.
- Add missing markup bits.


# 140603 21-Jan-2005 wes

Add an option to suppress the creation of the .snap directory in
the new filesystem. This is intended for memory and vnode filesystems
that will never be fsck'ed or dumped.

Obtained from: St. Bernard Software RAPID
MFC after: 2 weeks


# 129327 17-May-2004 ru

Assorted markup, grammar, and spelling fixes.


# 128073 09-Apr-2004 markm

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


# 126254 25-Feb-2004 rwatson

Add a "-l" flag to newfs, which sets the FS_MULTILABEL flag. This
permits users of newfs to set the multilabel flag on UFS1 and UFS2
file systems from inception without using tunefs.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, McAfee Research


# 120998 11-Oct-2003 blackend

s/disklabel/bsdlabel where needed.


# 120065 14-Sep-2003 ceri

Remove an unneccessary comma.


# 119893 08-Sep-2003 ru

mdoc(7): Use the new feature of the .In macro.


# 113760 20-Apr-2003 brueffer

Remove reference to diskpart(8)

PR: 51193
Submitted by: Yonatan@xpert.com


# 113751 20-Apr-2003 rwatson

Throw the switch--change to UFS2 as our default file system format for
FreeBSD 5.1-RELEASE and later:

- newfs(8) will now create UFS2 file systems unless UFS1 is specifically
requested (-O1). To do this, I just twiddled the Oflag default.

- sysinstall(8) will now select UFS2 as the default layout for new
file systems unless specifically requested (use '1' and '2' to change
the file system layout in the disk labeler). To do this, I inverted
the ufs2 flag into a ufs1 flag, since ufs2 is now the default and
ufs1 is the edge case. There's a slight semantic change in the
key behavior: '2' no longer toggles, it changes the selection to UFS2.

This is very similar to a patch David O'Brien sent me at one point, and
that I couldn't find.

Approved by: re (telecon)
Reviewed by: mckusick, phk, bmah


# 111285 22-Feb-2003 ru

mdoc(7) police: markup laundry.


# 111113 19-Feb-2003 jwd

Our first keyword hit for apropos ufs2.


# 110174 01-Feb-2003 gordon

Bring in support for volume labels to the filesystem utilities.

Reviewed by: mckusick


# 102464 26-Aug-2002 trhodes

Fix some 'SYNOPSIS' and 'usage' messages.


# 102231 21-Aug-2002 trhodes

s/filesystem/file system/g as discussed on -developers


# 101800 13-Aug-2002 ru

mdoc(7) police: Consistently name options' arguments in the SYNOPSIS and DESCRIPTION sections..


# 99501 06-Jul-2002 charnier

The .Nm utility


# 98542 21-Jun-2002 mckusick

This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by: Poul-Henning Kamp <phk@freebsd.org>


# 96707 16-May-2002 trhodes

more file system > filesystem


# 95360 24-Apr-2002 phk

Remove the -v option, it is now default behaviour.

Sponsored by: DARPA & NAI Labs


# 92763 20-Mar-2002 phk

Swing the axe and remove some archaic features from newfs which modern
diskdrives do neither need nor want:

-O create a 4.3BSD format filesystem
-d rotational delay between contiguous blocks
-k sector 0 skew, per track
-l hardware sector interleave
-n number of distinguished rotational positions
-p spare sectors per track
-r revolutions/minute
-t tracks/cylinder
-x spare sectors per cylinder

No change in the produced filesystem image unless one or more of
these options were used.

Approved by: mckusick


# 87661 11-Dec-2001 sheldonh

Update the default newfs block and fragment sizes from 8192/1024 to
16384/2048.

Following recent discussions on the -arch mailing list, involving dillon
and mckusick, this change parallels the one made over a decade ago when
the default was bumped up from 4096/512.

This should provide significant performance improvements for most
folks, less significant performance losses for a few folks and
wasted space lost to large fragments for many folks.

For discussion, please see the following thread in the -arch archive:

Subject: Using a larger block size on large filesystems

The discussion ceases to be relevant when the issue of partitioning
schemes is raised.


# 87491 07-Dec-2001 sheldonh

Fix typo: 'fragement' -> 'fragment'


# 86996 27-Nov-2001 sheldonh

Fix the example of suggested default settings. It stated that settings
were only of benefit to large filesystems, which recent research
suggests is not the case, and which the original author of the text
no longer endorses.


# 86987 27-Nov-2001 sheldonh

Correct the example introduced in rev 1.29, which suggested a block:frag
size ratio other than 8:1. Currently, we only recommend an 8:1
ratio, because the impact of others ratios has not been adequately
investigated.

Also, do not recommend the use of the -c option in the example, since
newfs now automatically calculates the best cyl:cylgrp ratio.

This change was discussed with the author of rev 1.29.


# 85013 15-Oct-2001 dougb

Document the optimal block:fragment ratio, per discussion
on -arch and cvs-all.

Reviewed by: dillon


# 84467 04-Oct-2001 roberto

Forced commit to give more details on what the patch does (sorry).

Instead of using 22 as the default cylinders per cylinder group parameter
(the max. value for a 8k/1k FS), compute the maximum value allowed and use
it. It can be overridden by specifying -c of course. This allow for FS built
through the initial installation to have better values.


# 84466 04-Oct-2001 roberto

Following the discussion in -arch and the submission of a patch by bde, here
it is. I added the manpage change.

Submitted by: bde
MFC after: 1 week


# 79754 15-Jul-2001 dd

Remove whitespace at EOL.


# 79530 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


# 79454 09-Jul-2001 dd

mdoc(7) police: remove extraneous .Pp before and/or after .Sh.


# 77446 29-May-2001 dd

Remove all references to MFS.


# 75379 10-Apr-2001 nik

Add information about the new options to newfs and tunefs which set the
expected average file size and number of files per directory. Could do
with some fleshing out.


# 75099 02-Apr-2001 obrien

Document the newfs.c rev 1.33 changing the default c/g from 16 to 22.


# 75098 02-Apr-2001 obrien

Fix patch merge braino.


# 75078 01-Apr-2001 obrien

Allow enabling soft updates (with -U) on a new filesystem.

[I first added this functionality, and thought to check prior art. Seeing
OpenBSD had already done this, I changed my addition to reduce the diffs
between the two and went with their option letter.]
Obtained from: OpenBSD


# 71833 30-Jan-2001 phk

Make mount_mfs annoy users for 15 seconds and point them at mdconfig(8).


# 71107 16-Jan-2001 ru

mdoc(7) police: fixed broken references.


# 71049 15-Jan-2001 eivind

Replace reference to replacing mkfs(8) with a paragraph actually
describing what newfs *does*.


# 70401 27-Dec-2000 ru

Prepare for mdoc(7)NG.


# 70203 19-Dec-2000 imp

o Add an example for a large file system.
o Remove bug about boot blocks hating non-8k file systems. This hasn't been
the case for a long time.

Not Objected to by: hackers, doc


# 68960 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


# 68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


# 57668 01-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


# 56910 30-Jan-2000 kris

Add Xref to camcontrol(8) (replacing previously-removed scsiformat(8)).

Submitted by: joerg


# 56407 22-Jan-2000 mpp

Fix various man pages to stop abusing the .Bx macro to generate
the strings "FreeBSD" and "NetBSD". Use the .Fx or .Nx macro
instead.


# 53167 15-Nov-1999 kris

Remove dead xref to scsiformat(8)

Obtained from: OpenBSD (kind of)


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 44648 10-Mar-1999 grog

Describe the default values for useful options.

Clarify which options are no longer useful.


# 41408 29-Nov-1998 bde

Straightened the terminology straightening in 1.17-1.18. Fixed hard
line breaks in rev.1.16-1.18.


# 41383 28-Nov-1998 rnordier

Refer to "da" rather than "sd" device.


# 39791 29-Sep-1998 grog

Don't require an argument for -v flag
Correct checks for null special file names
Add Usage entry for -v flag
Get terminology straight in man page
Reviewed by: bde


# 39067 11-Sep-1998 grog

Reviewed by: bde (again)

Correct terminology (partitions are in slices, not the other way around)


# 39066 11-Sep-1998 grog

Reviewed by: bde,jkh

Add -v flag to newfs:

-v Specify that the partition does not contain any slices, and that
newfs should treat the whole partition as the file system. This
option is useful for synthetic disks such as ccd and vinum.


# 37664 15-Jul-1998 charnier

Add prototypes. Check malloc() return value. Use err(). Remove unused #includes
Do not \n nor dot terminate syslog()/err() messages. -Wall.


# 35468 26-Apr-1998 phk

Add warning about root-fs blocksize expectations.
PR: 4485
Reviewed by: phk
Submitted by: Kees Jan Koster <kjk1@ukc.ac.uk>


# 31376 24-Nov-1997 obrien

Fix syntax error for the mount_mfs example.
Also update to a more realistic example.


# 25465 04-May-1997 eivind

Fix typo.
PR: Closes PR docs/3488
Submitted by: k-horik@yk.rim.or.jp


# 23682 11-Mar-1997 peter

Merge from Lite2:
- use new getvfsbyname() and mount(2) interface (mount_mfs)
- use new fs include files
- updated inode / cg layout calculations (?)


# 22345 06-Feb-1997 mpp

Replace "mfs" with "mount_mfs" in the NAME section.


# 20913 26-Dec-1996 wosch

Add example for mount_mfs(8).


# 20463 14-Dec-1996 mpp

Update the newfs(8) man page to reflect current
default values for some options better. Closes PR# 1374.


# 13720 29-Jan-1996 mpp

Fix a bunch of spelling errors.


# 13562 22-Jan-1996 mpp

Change the reference to format(8) (which we don't have) to fdformat(1) and
scsiformat(8) (which we do have). Closes PR# 663.


# 6192 05-Feb-1995 phk

Change the defaults for newfs to disregard the geometry in the disklabel.

We pretend we have one head with two megabyte worth of sectors per cylinder.

The code try to access another head in what it belives to the same
physical cylinder, because it belives that it would be faster than
waiting for the next free sector under this head to come around.

Most modern drives doesn't have a "classical" geometry, and thus
we end up fooling ourselves doing the above optimization. With this
change we will fill a cylinder sequentially if we can, and thus get
much more mileage from the track-buffer/cache built into the drives.

As a result a lot of seeks to the next or previous track should be
avoided by this.

(My disk is a lot less noisy actually...)

You can still get the old behaviour, by specifying zero for the
numbers.

This will also solve the problem with newfs barfing at really big
drives.

Obtained from: adult advice from Kirk.


# 3550 12-Oct-1994 phk

Added '-F file' option of mount_mfs. This allows me to make floppy images
without waiting for my floppy-drive all the time :-) Might have other
interesting uses too.


# 3467 09-Oct-1994 dg

Backed out part of the last change that prevents the rpos table from
being output if <= 1 rpos; there is a bug in the kernel which doesn't
quite get along with this. Changed default #rpos to 1, and fixed up
manual page. Converted nrpos to 1 if user specifies 0.


# 3276 01-Oct-1994 dg

Fixed manpage to conform to current reality.

Submitted by: Rod Grimes, with additional sentence by me.


# 1559 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1558,
which included commits to RCS files with non-trunk default branches.


# 1558 26-May-1994 rgrimes

BSD 4.4 Lite sbin Sources

Note: XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.