Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mkfs(1m) [v7 man page]

MKFS(1M)																  MKFS(1M)

NAME
mkfs - construct a file system SYNOPSIS
/etc/mkfs special proto DESCRIPTION
Mkfs constructs a file system by writing on the special file special according to the directions found in the prototype file proto. The prototype file contains tokens separated by spaces or new lines. The first token is the name of a file to be copied onto block zero as the bootstrap program, see bproc(8). The second token is a number specifying the size of the created file system. Typically it will be the number of blocks on the device, perhaps diminished by space for swapping. The next token is the number of i-nodes in the i-list. The next set of tokens comprise the specification for the root file. File specifications consist of tokens giving the mode, the user-id, the group id, and the initial contents of the file. The syntax of the contents field depends on the mode. The mode token for a file is a 6 character string. The first character specifies the type of the file. (The characters -bcd specify regu- lar, block special, character special and directory files respectively.) The second character of the type 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 three digit octal number giving the owner, group, and other read, write, execute permissions, see chmod(1). Two decimal number tokens come after the mode; they specify the user and group ID's of the owner of the file. If the file is a regular file, the next token is a pathname whence the contents and size are copied. If the file is a block or character special file, two decimal number tokens follow which give the major and minor device numbers. If the file is a directory, mkfs makes the entries . and .. and then reads a list of names and (recursively) file specifications for the entries in the directory. The scan is terminated with the token $. If the prototype file cannot be opened and its name consists of a string of digits, mkfs builds a file system with a single empty directory on it. The size of the file system is the value of proto interpreted as a decimal number. The number of i-nodes is calculated as a func- tion of the filsystem size. The boot program is left uninitialized. A sample prototype specification follows: /usr/mdec/uboot 4872 55 d--777 3 1 usr d--777 3 1 sh ---755 3 1 /bin/sh ken d--755 6 1 $ b0 b--644 3 1 0 0 c0 c--644 3 1 0 0 $ $ SEE ALSO
filsys(5), dir(5), bproc(8) BUGS
There should be some way to specify links. MKFS(1M)

Check Out this Related Man Page

MKFS(1) 						      General Commands Manual							   MKFS(1)

NAME
mkfs - make a file system SYNOPSIS
mkfs [-Ldot] [-i inodes] [-b blocks] special prototype OPTIONS
-L Make a listing on standard output -d Use mod time of mkfs binary for all files -o Use a drive other than 0 or 1 (safety precaution) -t Do not test if file system fits on the medium -1 Make a version 1 file system (for backward compatibility) -i Number of i-nodes (files) -b Filesystem size EXAMPLES
mkfs /dev/fd1 proto # Make a file system on /dev/fd1 mkfs -b 360 /dev/fd1 # Make empty 360 block file system mkfs /dev/fd1 360 # Alternate way to specify the size DESCRIPTION
Mkfs builds a file system and copies specified files to it. The prototype file tells which directories and files to copy to it. If the prototype file cannot be opened, and its name is just a string of digits, an empty file system will be made with the specified number of blocks. A sample prototype file follows. The text following the # sign in the example below is comment. In real prototype files, com- ments are not allowed. boot # boot block file (ignored) 360 63 # blocks and i-nodes d--755 1 1 # root directory bin d--755 2 1 # bin dir: mode (755), uid (2), gid (1) sh ---755 2 1 /user/bin/shell # shell has mode rwxr-xr-x mv -u-755 2 1 /user/bin/mv # u = SETUID bit login -ug755 2 1 /user/bin/login# SETUID and SETGID $ # end of /bin dev d--755 2 1 # special files: tty (char), fd0 (block) tty c--777 2 1 4 0 # uid=2, gid=1, major=4, minor=0 fd0 b--644 2 1 2 0 360 # uid, gid, major, minor, blocks $ # end of /dev user d--755 12 1 # user dir: mode (755), uid (12), gid (1) ast d--755 12 1 # /user/ast $ # /user/ast is empty $ # end of /user $ # end of root directory The first entry on each line (except the first 3 and the $ lines, which terminate directories) is the name the file or directory will get on the new file system. Next comes its mode, with the first character being -dbc for regular files, directories, block special files and character special files, respectively. The next two characters are used to specify the SETUID and SETGID bits, as shown above. The last three characters of the mode are the rwx protection bits. Following the mode are the uid and gid. For special files, the major and minor devices are needed. The size in blocks must also be speci- fied for block special files (the MINIX block size is 1K; this can only be changed by changing BLOCK_SIZE and then recompiling the operat- ing system). The maximum size of a file system is 1 Gb for a version 2 file system, and 64 Mb for a version 1 file system. Alas the 8086 fsck runs out of memory on a V2 file system larger than 128 Mb, so for the 8086 version of MINIX you have to limit yourself to file systems of that size. SEE ALSO
mkproto(1), fsck(1), mount(1). MKFS(1)
Man Page