MKFS_UFS(8) | Maintenance Commands and Procedures | MKFS_UFS(8) |
mkfs_ufs - construct a UFS file system
mkfs -F ufs [generic_options] [-o FSType_specific_options] raw_device_file
[size]
The UFS-specific module of mkfs builds a UFS file system with a root directory and a lost+found directory (see fsck(8)).
The UFS-specific mkfs is rarely run directly. Use the newfs(8) command instead.
raw_device_file indicates the disk partition on which to create the new file system. If the -o N, -V, or -m options are specified, the raw_device_file is not actually modified. size specifies the number of disk sectors in the file system, where a disk sector is usually 512 bytes. This argument must follow the raw_device_file argument and is required (even with -o N), unless the -V or -m generic options are specified.
generic_options are supported by the generic mkfs command. See mkfs(8) for a description of these options.
The following generic options are supported:
-m
-V
The following UFS-specific options are supported:
-o
apc=n
This option is not applicable for disks with EFI labels and is ignored.
bsize=n
calcbinsb
calcsb
cgsize=n
The per-cylinder-group meta data must fit in a space no larger than what is available in one logical file system block. If too large a cgsize is requested, it is changed by the minimum amount necessary.
fragsize=n
bsize / fragsize is 1, 2, 4, or 8.
This means that if the logical block size is 4096, legal values for fragsize are 512, 1024, 2048, and 4096. When the logical block size is 8192, legal values are 1024, 2048, 4096, and 8192. The default value is 1024.
For file systems greater than 1 terabyte or for file systems created with the mtb=y option, fragsize is forced to match block size (bsize).
free=n
The default is ((64 Mbytes/partition size) * 100), rounded down to the nearest integer and limited between 1% and 10%, inclusively.
This parameter can be subsequently changed using the tunefs(8) command.
gap=n
maxcontig=n
maxcontig = disk drive maximum transfer size / disk block size
If the disk drive's maximum transfer size cannot be determined, the default value for maxcontig is calculated from kernel parameters as follows:
If maxphys is less than ufs_maxmaxphys, which is typically 1 Mbyte, then maxcontig is set to maxphys. Otherwise, maxcontig is set to ufs_maxmaxphys.
You can set maxcontig to any positive integer value.
The actual value will be the lesser of what has been specified and what the hardware supports.
You can subsequently change this parameter by using tunefs(8).
mtb=y
N
nbpi=n
This value should reflect the expected average size of files in the file system. If fewer inodes are desired, a larger number should be used. To create more inodes, a smaller number should be given. The default is 2048.
The number of inodes can increase if the file system is expanded with the growfs command.
nrpos=n
This option is not applicable for disks with EFI labels and is ignored.
nsect=n
ntrack=n
This option is not applicable for disks with EFI labels and is ignored.
opt=s|t
This parameter can be subsequently changed with the tunefs(8) command.
rps=n
Note that you specify rps for mkfs and rpm for newfs.
This option is not applicable for disks with EFI labels and is ignored.
Alternatively, parameters can be entered as a list of space-separated values (without keywords) whose meaning is positional. In this case, the -o option is omitted and the list follows the size operand. This is the way newfs passes the parameters to mkfs.
The following operands are supported:
raw_device_file
ufs(4FS), dir_ufs(5), attributes(7), fsck(8), mkfs(8), newfs(8), tunefs(8)
The following error message typically occurs with very high density disks. On such disks, the file system structure cannot encode the proper disk layout information. However, such disks have enough onboard intelligence to make up for any layout deficiencies, so there is no actual impact on performance. The warning that performance might be impaired can be safely ignored.
Warning: insufficient space in super block for rotational layout tables with nsect sblock.fs_nsect and ntrak sblock.fs_ntrak. (File system performance may be impaired.)
The following error message occurs when the disk geometry results in a situation where the last truncated cylinder group cannot contain the correct number of data blocks. Some disk space is wasted.
Warning: inode blocks/cyl group (grp) >= data blocks (num) in last cylinder
If there is only one cylinder group and if the above condition holds true, mkfs fails with the following error:
File system creation failed. There is only one cylinder group and that is not even big enough to hold the inodes.
The following error message occurs when the best calculated file system layout is unable to include the last few sectors in the last cylinder group. This is due to the interaction between how much space is used for various pieces of meta data and the total blocks available in a cylinder group. Modifying nbpi and cpg might reduce this number, but it is rarely worth the effort.
Warning: num sector(s) in last cylinder group unallocated
You can use lofiadm to create a file that appears to the mkfs command (for example, mkfs_pcfs or mkfs_ufs) as a raw device. You can then use the mkfs command to create a file system on that device. See lofiadm(8) for examples of creating a UFS and a PC (FAT) file system on a device created by lofiadm.
Both the block and character devices, such as devices in /dev/dsk and /dev/rdsk, must be available prior to running the mkfs command.
March 8, 2006 | OmniOS |