diff options
author | sheldonh <sheldonh@FreeBSD.org> | 2001-12-11 16:21:40 +0000 |
---|---|---|
committer | sheldonh <sheldonh@FreeBSD.org> | 2001-12-11 16:21:40 +0000 |
commit | 29d0d309963e8ceb4d68e5963c13a4f5070d3e78 (patch) | |
tree | 90125984a1a1adf2fe49ce6fe3a4751dc707d34c /sbin/newfs | |
parent | 1fef6a00e61c035c56a2a6493f67e443fea2566f (diff) | |
download | FreeBSD-src-29d0d309963e8ceb4d68e5963c13a4f5070d3e78.zip FreeBSD-src-29d0d309963e8ceb4d68e5963c13a4f5070d3e78.tar.gz |
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.
Diffstat (limited to 'sbin/newfs')
-rw-r--r-- | sbin/newfs/newfs.8 | 14 | ||||
-rw-r--r-- | sbin/newfs/newfs.c | 4 |
2 files changed, 11 insertions, 7 deletions
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index c655fb0..aefc95d 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -110,7 +110,7 @@ See for more details on how to set this option. .It Fl b Ar block-size The block size of the file system, in bytes. It must be a power of 2. The -default size is 8192 bytes, and the smallest allowable size is 4096 bytes. +default size is 16384 bytes, and the smallest allowable size is 4096 bytes. The optimal block:fragment ratio is 8:1. Other ratios are possible, but are not recommended, and may produce unpredictable results. @@ -141,7 +141,7 @@ ranging in value between .Ar blocksize Ns /8 and .Ar blocksize . -The default is 1024 bytes. +The default is 2048 bytes. .It Fl g Ar avgfilesize The expected average file size for the file system. .It Fl h Ar avgfpdir @@ -271,15 +271,19 @@ This option is of historical importance only. Modern disks perform their own bad sector allocation. .El .Sh EXAMPLES -.Dl newfs -b 16384 -f 2048 /dev/ad3s1a +.Dl newfs /dev/ad3s1a .Pp Creates a new ufs file system on .Pa ad3s1a . .Nm will use a block size of 16384 bytes, a fragment size of 2048 bytes and the largest possible number of cylinders per group. -These values tend to produce better performance than the defaults -for most applications. +These values tend to produce better performance for most applications +than the historical defaults +(8192 byte block size and 1024 byte fragment size). +This large fragment size +may lead to large amounts of wasted space +on filesystems that contain a large number of small files. .Sh SEE ALSO .Xr fdformat 1 , .Xr disktab 5 , diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index c34fcb6..8764a87 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -98,8 +98,8 @@ void fatal(); * sectorsize <= DESFRAGSIZE <= DESBLKSIZE * DESBLKSIZE / DESFRAGSIZE <= 8 */ -#define DFL_FRAGSIZE 1024 -#define DFL_BLKSIZE 8192 +#define DFL_FRAGSIZE 2048 +#define DFL_BLKSIZE 16384 /* * Cylinder groups may have up to many cylinders. The actual |