Category Archives: Linux Man Pages - Page 2

MKDIRHIER

MKDIRHIER(1) MKDIRHIER(1)

NAME
mkdirhier – makes a directory hierarchy

SYNOPSIS
mkdirhier directory …

DESCRIPTION
The mkdirhier command creates the specified directories. Unlike mkdir
if any of the parent directories of the specified directory do not
exist, it creates them as well.

SEE ALSO
mkdir(1)

X Version 11 imake 1.0.2 MKDIRHIER(1)

Technorati Tags: ,

MODINFO

MODINFO(8) MODINFO(8)

NAME
modinfo – program to show information about a Linux Kernel module

SYNOPSIS
modinfo [ -0 ] [ -F field ] [ -k kernel ] [ modulename|filename … ]

modinfo -V

modinfo -h

DESCRIPTION
modinfo extracts information from the Linux Kernel modules given on the
command line. If the module name is not a filename, then the /lib/mod-
ules/version directory is searched, as done by modprobe(8).

modinfo by default lists each attribute of the module in form fieldname
: value, for easy reading. The filename is listed the same way
(although it’s not really an attribute).

This version of modinfo can understand modules of any Linux Kernel
architecture.

OPTIONS
-V –version
Print the modinfo version. Note BACKWARDS COMPATIBILITY below:
you might be printing the version of modinfo.old.

-F –field
Only print this field value, one per line. This is most useful
for scripts. Field names are case-insenitive. Common fields
(which may not be in every module) include author, description,
license, param, depends, and alias. There are often multiple
param, alias and depends fields. The special field filename
lists the filename of the module.

-k kernel
Provide information about a kernel other than the running one.
This is particularly useful for distributions needing to extract
information from a newly installed (but not yet running) set of
kernel modules. For example, you wish to find which firmware
files are needed by various modules in a new kernel for which
you must make an initrd image prior to booting.

-0 –null
Use the ASCII zero character to separate field values, instead
of a new line. This is useful for scripts, since a new line can
theoretically appear inside a field.

-a -d -l -p -n
These are shortcuts for author, description, license. param and
filename respectively, to ease the transition from the old modu-
tils modinfo.

BACKWARDS COMPATIBILITY
This version of modinfo is for kernel modules 2.5.48 and above. If it
detects a kernel with support for old-style modules, it will attempt to
run modprobe.old in its place, so it is completely transparent to the
user.

Note that the output of this version of modinfo is simpler and more
regular than the older version: scripts attempting to use the default
output may get confused with complex fields.

You can force the new modinfo to always be used, by setting the
NEW_MODINFO environment variable.

COPYRIGHT
This manual page Copyright 2003, Rusty Russell, IBM Corporation.

SEE ALSO
modprobe(8), modinfo.old(8)

22 August 2008 MODINFO(8)

Technorati Tags: ,

MKFS

MKFS(8) MKFS(8)

NAME
mkfs – build a Linux file system

SYNOPSIS
mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [ blocks ]

DESCRIPTION
mkfs is used to build a Linux file system on a device, usually a hard
disk partition. filesys is either the device name (e.g. /dev/hda1,
/dev/sdb2). blocks is the number of blocks to be used for the file
system.

The exit code returned by mkfs is 0 on success and 1 on failure.

In actuality, mkfs is simply a front-end for the various file system
builders (mkfs.fstype) available under Linux. The file system-specific
builder is searched for in a number of directories like perhaps /sbin,
/sbin/fs, /sbin/fs.d, /etc/fs, /etc (the precise list is defined at
compile time but at least contains /sbin and /sbin/fs), and finally in
the directories listed in the PATH environment variable. Please see
the file system-specific builder manual pages for further details.

OPTIONS
-V Produce verbose output, including all file system-specific com-
mands that are executed. Specifying this option more than once
inhibits execution of any file system-specific commands. This
is really only useful for testing.

-t fstype
Specifies the type of file system to be built. If not speci-
fied, the default file system type (currently ext2) is used.

fs-options
File system-specific options to be passed to the real file sys-
tem builder. Although not guaranteed, the following options are
supported by most file system builders.

-c Check the device for bad blocks before building the file system.

-l filename
Read the bad blocks list from filename

-v Produce verbose output.

BUGS
All generic options must precede and not be combined with file system-
specific options. Some file system-specific programs do not support
the -v (verbose) option, nor return meaningful exit codes. Also, some
file system-specific programs do not automatically detect the device
size and require the blocks parameter to be specified.

AUTHORS
David Engel (david@ods.com)
Fred N. van Kempen (waltje@uwalt.nl.mugnet.org)
Ron Sommeling (sommel@sci.kun.nl)
The manual page was shamelessly adapted from Remy Card’s version for
the ext2 file system.

SEE ALSO
fs(5), badblocks(8), fsck(8), mkdosfs(8), mke2fs(8), mkfs.bfs(8),
mkfs.ext2(8), mkfs.ext3(8), mkfs.minix(8), mkfs.msdos(8), mkfs.vfat(8),
mkfs.xfs(8), mkfs.xiafs(8)

AVAILABILITY
The mkfs command is part of the util-linux-ng package and is available
from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

Version 1.9 Jun 1995 MKFS(8)

Technorati Tags: ,

MKNOD

MKNOD(1) User Commands MKNOD(1)

NAME
mknod – make block or character special files

SYNOPSIS
mknod [OPTION]… NAME TYPE [MAJOR MINOR]

DESCRIPTION
Create the special file NAME of the given TYPE.

-Z, –context=CTX
set the SELinux security context of NAME to CTX

Mandatory arguments to long options are mandatory for short options
too.

-m, –mode=MODE
set file permission bits to MODE, not a=rw – umask

–help display this help and exit

–version
output version information and exit

Both MAJOR and MINOR must be specified when TYPE is b, c, or u, and
they must be omitted when TYPE is p. If MAJOR or MINOR begins with 0x
or 0X, it is interpreted as hexadecimal; otherwise, if it begins with
0, as octal; otherwise, as decimal. TYPE may be:

b create a block (buffered) special file

c, u create a character (unbuffered) special file

p create a FIFO

NOTE: your shell may have its own version of mknod, which usually
supersedes the version described here. Please refer to your shell’s
documentation for details about the options it supports.

AUTHOR
Written by David MacKenzie.

REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.

COPYRIGHT
Copyright © 2008 Free Software Foundation, Inc. License GPLv3+: GNU
GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
mknod(2)

The full documentation for mknod is maintained as a Texinfo manual. If
the info and mknod programs are properly installed at your site, the
command

info coreutils ‘mknod invocation’

should give you access to the complete manual.

GNU coreutils 6.12 May 2008 MKNOD(1)

Technorati Tags: ,

MKSWAP

MKSWAP(8) Linux Programmer’s Manual MKSWAP(8)

NAME
mkswap – set up a Linux swap area

SYNOPSIS
mkswap [-c] [-vN] [-f] [-p PSZ] [-L label] [-U uuid] device [size]

DESCRIPTION
mkswap sets up a Linux swap area on a device or in a file.

(After creating the swap area, you need the swapon command to start
using it. Usually swap areas are listed in /etc/fstab so that they can
be taken into use at boot time by a swapon -a command in some boot
script.)

The device argument will usually be a disk partition (something like
/dev/hda4 or /dev/sdb7) but can also be a file. The Linux kernel does
not look at partition Id’s, but many installation scripts will assume
that partitions of hex type 82 (LINUX_SWAP) are meant to be swap parti-
tions. (Warning: Solaris also uses this type. Be careful not to kill
your Solaris partitions.)

The size parameter is superfluous but retained for backwards compati-
bility. (It specifies the desired size of the swap area in 1024-byte
blocks. mkswap will use the entire partition or file if it is omitted.
Specifying it is unwise – a typo may destroy your disk.)

The PSZ parameter specifies the page size to use. It is almost always
unnecessary (even unwise) to specify it, but certain old libc versions
lie about the page size, so it is possible that mkswap gets it wrong.
The symptom is that a subsequent swapon fails because no swap signature
is found. Typical values for PSZ are 4096 or 8192.

Linux knows about two styles of swap areas, old style and new style.
The last 10 bytes of the first page of the swap area distinguishes
them: old style has `SWAP_SPACE’, new style has `SWAPSPACE2′ as signa-
ture.

In the old style, the rest of this first page was a bit map, with a 1
bit for each usable page of the swap area. Since the first page holds
this bit map, the first bit is 0. Also, the last 10 bytes hold the
signature. So, if the page size is S, an old style swap area can
describe at most 8*(S-10)-1 pages used for swapping. With S=4096 (as
on i386), the useful area is at most 133890048 bytes (almost 128 MiB),
and the rest is wasted. On an alpha and sparc64, with S=8192, the use-
ful area is at most 535560992 bytes (almost 512 MiB).

The old setup wastes most of this bitmap page, because zero bits denote
bad blocks or blocks past the end of the swap space, and a simple inte-
ger suffices to indicate the size of the swap space, while the bad
blocks, if any, can simply be listed. Nobody wants to use a swap space
with hundreds of bad blocks. (I would not even use a swap space with 1
bad block.) In the new style swap area this is precisely what is done.

The maximum useful size of a swap area depends on the architecture and
the kernel version. It is roughly 2GiB on i386, PPC, m68k, ARM, 1GiB
on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on sparc64. For ker-
nels after 2.3.3 there is no such limitation.

Note that before 2.1.117 the kernel allocated one byte for each page,
while it now allocates two bytes, so that taking a swap area of 2 GiB
in use might require 2 MiB of kernel memory.

Presently, Linux allows 32 swap areas (this was 8 before Linux 2.4.10).
The areas in use can be seen in the file /proc/swaps (since 2.1.25).

mkswap refuses areas smaller than 10 pages.

If you don’t know the page size that your machine uses, you may be able
to look it up with “cat /proc/cpuinfo” (or you may not – the contents
of this file depend on architecture and kernel version).

To setup a swap file, it is necessary to create that file before ini-
tializing it with mkswap , e.g. using a command like

# dd if=/dev/zero of=swapfile bs=1024 count=65536

Note that a swap file must not contain any holes (so, using cp(1) to
create the file is not acceptable).

OPTIONS
-c Check the device (if it is a block device) for bad blocks before
creating the swap area. If any are found, the count is printed.

-f Force – go ahead even if the command is stupid. This allows the
creation of a swap area larger than the file or partition it
resides on. On SPARC, force creation of the swap area. Without
this option mkswap will refuse to create a v0 swap on a device
with a valid SPARC superblock, as that probably means one is
going to erase the partition table.

-p PSZ Specify the page size to use.

-L label
Specify a label, to allow swapon by label. (Only for new style
swap areas.)

-v0 Create an old style swap area.

-v1 Create a new style swap area.

If no -v option is given, mkswap will default to new style, but use old
style if the current kernel is older than 2.1.117 (and also if
PAGE_SIZE is less than 2048). The new style header does not touch the
first block, so may be preferable, in case you have a boot loader or
disk label there. If you need to use both 2.0 and 2.2 kernels, use the
-v0 option when creating the swapspace.

Version 0 (-v0) swap space format is no longer supported in 2.5+ ker-
nels.

-U uuid
Specify the uuid to use. The default is to generate UUIDs.

SEE ALSO
fdisk(8), swapon(8)

AVAILABILITY
The mkswap command is part of the util-linux-ng package and is avail-
able from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

Linux 2.2.4 25 March 1999 MKSWAP(8)

Technorati Tags: ,