Constructs a prototype file system.
mkproto Special Prototype
The mkproto command is used to construct a prototype for a new file system. It exists solely for Berkeley Software Distribution (BSD) compatibility.
The Special parameter can be a block device name, raw device name, or file system name. The Prototype parameter is the name of the prototype file that specifies the structure and contents of the file system to be created. The mkproto command calls the mkfs command with the Prototype and Special parameters.
The mkproto and mkfs commands require an extended prototype file to create a Journaled File System (JFS). A prototype file is a formatted listing of the contents and structure of a file system. A prototype file describes the file system by a series of tokens separated by spaces and new lines. The main body of a prototype file defines the objects of the file system.
A JFS prototype file consists of
the main body, which can be created by the proto command, preceded by five special
tokens. These five tokens are defined as follows:
The remaining tokens define the contents and structure of the file system. These tokens are grouped into sets, with each set defining one object of the file system. The syntax of each set is as follows:
{ [ Name ] { - | d | b | c | l | L | p } { - | u } { - | g } { - | t } Mode Owner Group { Major Minor | SourceFile | DirectoryListing } } | { $ }
Name | Specifies the name of the object as it is to appear in the new file system. The Name token is required for every object except for the root directory definition. |
{ - | d | b | c | l | L | p } { - | u } { - | g } { - | t } | |
Represents a string of 4 positional characters, where: | |
Mode | Represents a string of 3 octal characters defining the read, write, and execute permissions of the object. The Mode token is required of every object. See the chmod command for more information about permissions. |
Owner | Specifies the UID of the owner of the object. The owner token is required for every object. |
Group | Specifies the GID of the owner of the object. The group token is required for every object. |
Major Minor | Specifies the major and minor device numbers of the object if its type is a block or character special file. If the object is not a block or character special file, these tokens are omitted. |
SourceFile | Applies only to regular file, hard link, and symbolic link objects. For regular files, this token is the path name to the file from which the object file is to be initialized. For both symbolic and hard links, this token is the source of the link. The source of the link is relative to the new file system for hard links. |
DirectoryListing | Defines the contents of the object if it is a directory. The contents of the directory are defined using the token syntax described here. For example, a directory listing can include one or more regular files, one or more block files, and one or more directory listings. The mkfs command creates the directory entries . (dot) and .. (dot dot). Each directory listing is terminated with the special $ token. |
$ | Ends the current directory listing or indicates the end of the prototype file. |
The following prototype specification describes a JFS that does not have a boot program in block 0 and occupies the entire device. The 3rd token is ignored. The 4th and 5th tokens define the fragment size as 1024 bytes and the number of bytes per i-node as 2048. The main body of this prototype defines the file system contents.
<noboot> 0 0 1024 2048 d--- 755 0 0 dir1 d--- 755 0 2 block_dev b--- 644 0 0 880 881 char_dev c--- 644 0 0 990 991 named_pipe p--- 644 0 0 regfile3 ---- 644 0 0 /tmp/proto.examp/dir1/regfile3 regfile4 ---- 644 0 0 /tmp/proto.examp/dir1/regfile4 $ dir2 d--- 755 205 300 regfile6 ---- 644 0 0 /tmp/proto.examp/dir2/regfile6 symlnOutofFS l--- 644 0 0 /tmp/proto.examp/dir2/regfile6 symlnNoExist l--- 644 0 0 /home/foobar symlnInFs l--- 644 0 0 /dir2/regfile6 regfile5 ---- 644 0 0 /tmp/proto.examp/dir2/regfile5 hardlink L--- 644 0 0 /dir2/regfile5 $ dir3 d--- 755 0 0 setgid --g- 755 0 0 /tmp/proto.examp/dir3/setgid setuid -u-- 755 0 0 /tmp/proto.examp/dir3/setuid sticky ---t 755 0 0 /tmp/proto.examp/dir3/sticky $ dir4 d--- 755 0 0 dir5 d--- 755 0 0 dir6 d--- 755 0 0 $ dir7 d--- 755 0 0 $ $ regfile7 ---- 644 0 0 /tmp/proto.examp/dir4/regfile7 $ regfile1 ---- 555 205 1 /tmp/proto.examp/regfile1 regfile2 ---- 744 0 0 /tmp/proto.examp/regfile2 $ $
Three entries for the
dir2 object deserve further examination:
To make a prototype JFS using the prototype file described in the "Example Prototype File Specification" :
<noboot> 0 0 1024 2048
/protofs: dev = /dev/protolv vfs = jfs log = /dev/loglv00 mount = false
mkproto /dev/protolv /tmp/ProtoFile
This command creates a JFS on the protolv logical volume. The size of the JFS is 5 logical partitions, its fragment size is 1024 bytes, and its nbpi ratio is 2048. The structure and contents of the file system are as specified in the prototype file /tmp/ProtoFile.
/usr/sbin/mkproto | Contains the mkproto command. |
The mkfs command, fsck command, fsdb command, proto command.
File Systems Overview for System Management in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices.