newfs - construct a UFS file system
newfs [-NSBTv] [mkfs-options] raw-device
newfs is a "friendly" front-end to the mkfs(1M) program for making UFS file systems on disk partitions. newfs calculates the appropriate parameters to use and calls mkfs.
If run interactively (that is, standard input is a tty), newfs prompts for confirmation before making the file system.
If the -N option is not specified and the inodes of the device are not randomized, newfs calls fsirand(1M).
You must be super-user or have appropriate write privileges to use this command, except when creating a UFS file system on a diskette. See EXAMPLES.
Keep the following limitations in mind when creating a multiterabyte UFS file system:
The following options are supported:
-N
-S
-B
-T
-v
mkfs-options
-a apc
This option is not applicable for disks with EFI labels and is ignored.
-b bsize
-c cgsize
mkfs can override this value. See mkfs_ufs(1M) for details.
This option is not applicable for disks with EFI labels and is ignored.
-C maxcontig
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(1M).
-d gap
-f fragsize
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 -T option, fragsize is forced to match block size (bsize).
-i nbpi
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 for nbpi is as follows:
Disk size Density Less than 1GB 2048 Less than 2GB 4096 Less than 3GB 6144 3GB to 1 Tbyte 8192 Greater than 1 Tbyte or created with -T 1048576
The number of inodes can increase if the file system is expanded with the growfs command.
-m free
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(1M) command.
-n nrpos
This option is not applicable for disks with EFI labels and is ignored.
-o space|time
This parameter can subsequently be changed with the tunefs(1M) command.
-r rpm
Note that you specify rpm for newfs and rps for mkfs.
This option is not applicable for disks with EFI labels and is ignored.
-s size
-t ntrack
This option is not applicable for disks with EFI labels and is ignored.
The following operands are supported:
raw-device
See largefile(5) for the description of the behavior of newfs when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
Example 1 Displaying the Parameters for the Raw Special Device
The following example verbosely displays the parameters for the raw special device, c0t0d0s6. It does not actually create a new file system:
example# newfs -Nv /dev/rdsk/c0t0d0s6 mkfs -F ufs -o N /dev/rdsk/c0t0d0s6 1112940 54 15 8192 1024 16 10 60 2048 t 0 -1 8 /dev/rdsk/c0t0d0s6: 1112940 sectors in 1374 cylinders of 15 tracks, 54 sectors 569.8MB in 86 cyl groups (16 c/g, 6.64MB/g, 3072 i/g) super-block backups (for fsck -b #) at: 32, 13056, 26080, 39104, 52128, 65152, 78176, 91200, 104224, ...
Example 2 Creating a UFS File System
The following example creates a UFS file system on a diskette that is managed by a volume manager that makes use of the mount point /vol.
example% newfs /vol/dev/aliases/floppy0 newfs: construct a new file system /vol/dev/aliases/floppy0: (y/n)? y /vol/dev/aliases/floppy0: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 640, 1184, 1792, 2336, ...
Example 3 Creating a UFS File System That Will Eventually Be Grown to a Multiterabyte UFS File System
The following example creates a UFS file system that will eventually be grown to a multiterabyte UFS file system.
This command creates a 800-Gbyte file system on the volume, /dev/md/rdsk/d99.
# newfs -T /dev/md/rdsk/d99 newfs: construct a new file system /dev/md/rdsk/d99: (y/n)? y /dev/md/rdsk/d99: 1677754368 sectors in 45512 cylinders of 144 tracks, 256 sectors 819216.0MB in 1821 cyl groups (25 c/g, 450.00MB/g, 448 i/g) ...
Then, if you increase the volume size for this file system, you can use the growfs command to expand the file system. The file system is grown to 1.2 terabytes in this example:
# growfs -v /dev/md/rdsk/d99 /usr/lib/fs/ufs/mkfs -G /dev/md/rdsk/d99 2516631552 /dev/md/rdsk/d99: 2516631552 sectors in 68268 cylinders of 144 tracks, 256 sectors 1228824.0MB in 2731 cyl groups (25 c/g, 450.00MB/g, 448 i/g)...
The following exit values are returned:
0
1, 10
Other exit values may be returned by mkfs(1M), which is called by newfs.
See attributes(5) for descriptions of the following attributes:
|
fsck(1M), fsck_ufs(1M), fsirand(1M), mkfs(1M), mkfs_ufs(1M), tunefs(1M), attributes(5), largefile(5), ufs(7FS)
newfs: No such file or directory
special: cannot open
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |