Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ newfs(8) — OSF/1 X2.0-8 MIPS

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(1)

disklabel(8)

fsck(8)

tunefs(8)

disktab(4)

fstab(4)

newfs(8)  —  Maintenance

OSF

NAME

newfs, mount_mfs − Constructs a new file system

SYNOPSIS

/usr/sbin/newfs [-T ufs | s5fs] [-N] [newfs-options] special-device [disk-type]

/usr/sbin/mount_mfs [-F mount-flags] [newfs-options] [special-device] mount-node

FLAGS

-T ufs | s5fsSince OSF/1 supports multiple file system types, a new flag, -T is used to choose between the ufs and System V file systems. If -T is not specified, a ufs file system is created by default. 

-NCauses the file system parameters to be printed out without creating the file system. 

DESCRIPTION

The newfs command creates a new file system on the specified special-device of type disk-type.  If the disk has been labeled using disklabel, newfs builds a file system on the specified device, basing its defaults on the information in the disk label. If the disk has not been labeled using disklabel, newfs looks up the specified disk type in the disk description file /etc/disktab to get default information on the specified special device.  Typically the defaults are reasonable, however newfs has numerous options to allow the defaults to be selectively overridden. 

If you invoke the newfs command without options, it displays the file system parameters without creating the file system. 

The mount_mfs command builds a UFS file system in virtual memory and mounts it on the specified mount-node. When the file system is unmounted mount_mfs exits and the contents of the file system are lost. If mount_mfs is sent a signal while running, for example during system shutdown, it attempts to unmount its corresponding file system. The parameters for mount_mfs are nearly the same as those for newfs. The special-device file’s only purpose is to provide a disk label containing a set of configuration parameters for the memory based file system, and if special-device is omitted, the default parameters are used. 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. 

You must be superuser to use these commands. 

The following sections describe the file system dependencies for the ufs file systems (the default) and for System V file systems.  Each section defines the command syntax and the particular options that apply to that specific file system type. 

FILE SYSTEM DEPENDENT newfs - UFS FILE SYSTEMS

SYNOPSIS

newfs [−N] [newfs-options] special-device disk-type

FLAGS

The following newfs-options flags define the general layout policies. 

-b block-sizeThe block size of the file system in bytes. 

-f frag-sizeThe fragment size of the file system in bytes. 

-m %free_space
The percentage of space reserved from normal users; the minimum free space threshold (minfree). The default value is 10%.  See tunefs(8) for more details on how to set this option. 

-o opt_preference
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. If the value of minfree is less than 10%, the default is to optimize for space; if the value of minfree is greater than or equal to 10%, the default is to optimize for time.  See tunefs(8) for more details on how to set this option. 

-a maxcontigThis specifies the maximum number of contiguous blocks that will be laid out before forcing a rotational delay (refer to the −d option).  The default value is 1. See tunefs(8) for more details on how to set this option. 

-d rotdelayThis specifies the expected time (in milliseconds) to service a transfer completion interrupt and initiate a new transfer on the same disk.  The default is 4 milliseconds. See tunefs(8) for more details on how to set this option. 

-e maxbpgThis 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 tunefs(8) for more details on how to set this option. 

-i #bytes/inode
This specifies the density of inodes in the file system. The default is to create an inode for each 2048 bytes of data space. If fewer inodes are desired, a larger number should be used; to create more inodes a smaller number should be given.

-c #cylinders/group
The number of cylinders per cylinder group in a file system. The default value is 16.

-s sizeThe size of the file system in sectors. 

The following options override the standard sizes for the disk geometry.  Their default values are taken from the disk label.  Changing these defaults is useful only when using newfs 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 (on a write-once disk, for example).  Note that changing any of these values from their defaults makes it impossible for fsck to find the alternate superblocks if the standard superblock is lost. 

-r revolutions/minute
The speed of the disk in revolutions per minute.

-S sector-sizeThe size of a sector in bytes (almost never anything but 512). 

-u 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 −p). 

-t #tracks/cylinder
The number of tracks per cylinder available for data allocation by the file system.

-p spare_sectors/track
Spare sectors (bad sector replacements) are physical sectors that occupy space at the end of each track. They are not counted as part of the sectors per track (−u) since they are not available to the file system for data allocation. 

-x spare_sectors/cylinder
Spare sectors (bad sector replacements) are physical sectors that occupy space at the end of the last track in the cylinder. They are deducted from the sectors per track (−u) of the last track of each cylinder since they are not available to the file system for data allocation. 

-l 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: sectors read/sectors passed over. Thus, an interleave of 1/1 implies contiguous layout, while 1/2 implies logical sector 0 (zero) is separated by one sector from logical sector 1.

-k sector0-skew/track
Used to describe perturbations in the media format to compensate for a slow controller. Track skew is the offset of sector 0 (zero) on track N relative to sector 0 (zero) on track N-1 on the same cylinder.

The following option applies only to mount_mfs. 

-F mount flags
Used for providing a decimal numeric value to be passed as mount flags when running as a memory based file system. This option is primarily intended for use when mount_mfs is started by the mount(8) command. 

FILE SYSTEM DEPENDENT newfs - SYSTEM V FILE SYSTEMS

SYNOPSIS

newfs -T s5fs [newfs-options] special-device [disk-type]

FLAGS

The following newfs-options flags are specific to the System V file system:

-b block-sizeThe block size of the filesystem in bytes.  Valid block sizes are 512, 1024 and 2048. The default is 512. 

-s sizeThe size of the file system in number of block-size blocks. 

-C blocks/cyliner
The number of blocks/cylinder.

-G gapThe rotational gap. 

-I inodesThe number of inodes. 

-P proto_name
The name of the prototype file to use for creating the file system.

DESCRIPTION

The newfs program waits 10 seconds before starting to construct the file system. During this 10-second pause the command can be aborted by pressing the <Delete> key. 

The specified special device should either be previously labeled using disklabel(8) or its disk-type must be in /etc/disktab.  If the block-size and/or the size of the file system is specified, the specified values override what is in the disklabel or in /etc/disktab. 

If no prototype file is specified, newfs builds a file system with a single empty directory on it. The boot program block (block zero) is left uninitialized. 

If a prototype file is specified, newfs takes its directions from that file. The prototype file contains tokens separated by spaces or new-lines. A sample prototype specification follows; line numbers have been added to aid in the explanation:

1 proto_file
2 512 4872 110
3 d--777 3 1
4 usr d--777 3 1
5 sh ---755 3 1 /sbin/sh
6 jmp d--755 6 1
7 $
8 b0 b--644 3 1 0 0
9 c0 c--644 3 1 0 0
10 $
11 $

Historically line 1, as shown in the preceding example, is the name of a file to be copied onto block zero as the bootstrap program. Since OSF/1 does not support using the System V file system as a root file system, this file name is ignored by newfs and no data is copied onto block zero of the specified special device. 

Line 2 specifies the block size of the file system in bytes, the size of the file system in number of blocks of the just specified block size and the number of inodes in the file system. 

Lines 3 to 9 tell newfs about files and directories to be included in this file system. Line 3 specifies the root directory.  Lines 4 to 6 and 8 to 9 specify other directories and files.  The $ on line 7 tells newfs to end the branch of the file system it is on, and continue from the next higher directory. 

The $ on lines 10 and 11 end the process, since no additional specifications follow. 

File specifications give the mode, the user ID, the group ID, and the initial contents of the file. Valid syntax for the contents field depends on the first character of the mode. 

The mode for a file is specified by a 6-character string. The first character specifies the type of the file. The character range is -bcd to specify regular, block special, character special and directory files, respectively. The second character of the mode is either u or - to specify set-user-id mode or not. The third is g or - for the set-group-id mode.  The rest of the mode is a 3-digit octal number giving the owner, group, and other read, write, execute permissions. Refer to chmod(1) for additional information. 

Two decimal number tokens come after the mode; they specify the user and group IDs of the owner of the file.  If the file is a regular file, the next token of the specification may be a path name from which the contents and size are copied. If the file is a block or character special file, two decimal numbers follow which give the major and minor device numbers. If the file is a directory, newfs makes the entries . (dot) and .. (dot dot) and then reads a list of names and file specifications recursively for the entries in the directory. As noted previously, the scan is terminated with the token $. 

FILES

/usr/sbin/newfs
Specifies the command path

/etc/disktab
Provides disk geometry and file system partition information

RELATED INFORMATION

Commands: chmod(1), disklabel(8), fsck(8), tunefs(8)

Files: disktab(4), fstab(4)
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026