neulab/tldr huggingface dataset:
--generators Invoke unit generators, see systemd.generator(7). Some generators require root privileges. Under a normal user, running with generators enabled will generally result in some warnings.
--root=PATH With cat-files, show config files underneath the specified root path PATH.
--iterations=NUMBER When used with the calendar command, show the specified number of iterations the specified calendar expression will elapse next. Defaults to 1.
--base-time=TIMESTAMP When used with the calendar command, show next iterations relative to the specified point in time. If not specified defaults to the current time.
systemd(1), systemctl(1)
GIT-GRAFT(1)                       Git Extras                       GIT-GRAFT(1)
git-graft - Merge and destroy a given branch
git-graft <src-branch> <dest-branch>
Merge commits from <src-branch> into <dest-branch>
<src-branch>
<dest-branch>
$ git graft new_feature dev
Written by Kenneth Reitz <me@kennethreitz.com>
XDG-MIME(1)                      xdg-mime Manual                     XDG-MIME(1)
xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file types
xdg-mime query {filetype | default} ...
xdg-mime default application mimetype(s)
xdg-mime install [--mode mode] [--novendor] mimetypes-file
xdg-mime uninstall [--mode mode] mimetypes-file
xdg-mime {--help | --manual | --version}
The xdg-mime program can be used to query information about file types and to add descriptions for new file types.
query Returns information related to file types.
The query option is for use inside a desktop session only. It is not recommended to use xdg-mime query as root.
The following queries are supported:
query filetype FILE: Returns the file type of FILE in the form of a MIME type.
query default mimetype: Returns the default application that the desktop environment uses for opening files of type mimetype. The default application is identified by its *.desktop file.
default Ask the desktop environment to make application the default application for opening files of type mimetype. An application can be made the default for several file types by specifying multiple mimetypes.
application is the desktop file id of the application and has the form vendor-name.desktop.  application must already be installed in the desktop menu before it can be made the default handler. The application's desktop file must list support for all the MIME types that it wishes to be the default handler for.
Requests to make an application a default handler may be subject to system policy or approval by the end-user. xdg-mime query can be used to verify whether an application is the actual default handler for a specific file type.
The default option is for use inside a desktop session only. It is not recommended to use xdg-mime default as root.
install Adds the file type descriptions provided in mimetypes-file to the desktop environment.  mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root. For each new file type one or more icons with name type-subtype must be installed with the xdg-icon-resource command in the mimetypes context. For example the filetype application/vnd.oasis.opendocument.text requires an icon named application-vnd.oasis.opendocument.text to be installed (unless the file type recommends another icon name).
uninstall Removes the file type descriptions provided in mimetypes-file and previously added with xdg-mime install from the desktop environment. mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root.
--mode mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode.
The default is to use system mode when called by root and to use user mode when called by a non-root user.
--novendor Normally, xdg-mime checks to ensure that the mimetypes-file to be installed has a proper vendor prefix. This option can be used to disable that check.
A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts.
xdg-mime honours the following environment variables:
XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-mime do more verbose reporting on stderr. Setting a higher value increases the verbosity.
XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system.
5 No permission to read one of the files passed on the command line.
xdg-icon-resource(1), xdg-desktop-menu(1), Shared MIME database specification[1], MIME applications associations specification[2]
xdg-mime query filetype /tmp/foobar.png
Prints the MIME type of the file /tmp/foobar.png, in this case image/png
xdg-mime query default image/png
Prints the .desktop filename of the application which is registered to open PNG files.
xdg-mime install shinythings-shiny.xml
Adds a file type description for "shiny"-files. "shinythings-" is used as the vendor prefix. The file type description could look as follows.
shinythings-shiny.xml:
<?xml version="1.0"?> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <mime-type type="text/x-shiny"> <comment>Shiny new file type</comment> <glob pattern="*.shiny"/> <glob pattern="*.shi"/> </mime-type> </mime-info>
An icon for this new file type must also be installed, for example with:
xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text-x-shiny
1. Shared MIME database specification http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/
2. MIME applications associations specification http://www.freedesktop.org/wiki/Specifications/mime-apps-spec/
SHOWFIGFONTS(6)                   Games Manual                   SHOWFIGFONTS(6)
showfigfonts - prints a list of available figlet fonts
showfigfonts [ -d directory ] [ word ]
Prints a list of available figlet fonts, along with a sample of each font.  If directory is given, lists fonts in that directory; otherwise uses the default font directory.  If word is given, prints that word in each font; otherwise prints the font name.
To use showfigfonts with its default settings, simply type
example% showfigfonts
To print all the fonts in /usr/share/fonts/figlet
example% showfigfonts -d /usr/share/fonts/figlet
To print the word foo using all available fonts
example% showfigfonts foo
showfigfonts was written by Glenn Chappell <ggc@uiuc.edu>
This manual page was written by Jonathon Abbott for the Debian Project.
figlet(6), chkfont(6), figlist(6)
dfc(1)                            USER COMMANDS                           dfc(1)
dfc - report file system space usage information with style
dfc [OPTION(S)] [-c WHEN] [-e FORMAT] [-p FSNAME] [-q SORTBY] [-t FSTYPE] [-u UNIT]
dfc(1) is a tool similar to df(1) except that it is able to show a graph along with the data and is able to use color (color mode is "color-auto" by default but you can change this with "-c" option).
The available size corresponds to the space available from a user point of view and not from root's perspective (ie: use f_bavail instead of f_bfree).
Without any argument, size is displayed in human-readable format.  Be aware that when using human-readable format, there might be some rounding when computing the size. If you want maximum precision, use the "-u" option and choose the unit.
dfc(1) also has a built in feature that makes the output auto adjust based on terminal width. If you want to override this behavior, use the "-f" option.
-a     Show all (do not omit any file system).
-b     Do not show the graph bar.
-c [WHEN] Choose color mode where WHEN is one of the following sub-option:
"always": Color will always be used, no matter what "stdout" is.
"auto": This is default when "-c" is not activated. Color is used only if "stdout" is a terminal. For instance, color will be disabled with this option if you pipe the output of dfc(1) into another command.
"never": Color will never be used.
-d     Show used size.
-e [FORMAT] Allows you to export dfc(1) output to specified FORMAT.  FORMAT is one of the following:
"csv": Output as "comma separated value" file type. Example usage:
dfc -e csv > foo.csv
"html": Output is HTML formated. Example usage:
dfc -e html -Tadiso -c always > index.html
"json": Output is JSON formated. Example usage:
dfc -e json -Tisod > report.json
"tex": Output is TeX formated. Example usage:
dfc -e tex -c always > report.tex
"text": Text output (default).
-f     Override auto-adjust behavior by forcing information to be displayed.  This option can be useful when redirecting dfc(1) output.
-h     Show a short help text.
-i     Show information about inodes.
-l     Only show information about locally mount file systems.
-m     Use SI units (metric) (ie: size is computed using powers of 10 instead of powers of 2).
-M     Do not print "mounted on".
-n     Do not print header.
-o     Show mount options.
-p [FSNAME] Allows you to perform filtering on file system name. FSNAME can be anything.  For instance, if you want to see only file system which name starts with "/dev", you would use the following:
dfc -p /dev
This will output only file systems which names are, for instance, "/dev/sda1", "/dev/root", "/dev", etc.
Multiple selection is supported. In this case, FSNAME needs to be a comma separated list (without spaces). For instance, if you want to filter "/dev" and "tmpfs", you would use the following:
dfc -p /dev,tmpfs
You can also use negative matching to filter the output. To do so, you just need to prepend a "-" to FSNAME. In the following example, dfc(1) will display all file system names except those mentioned:
dfc -p -proc,/dev/sdc,run
-q [SORTBY] Allows you to sort the output based on SORTBY.
SORTBY can take one of those three values: "name", "type", "mount".
When using "name", the output is sorted by file system name.  When using "type", the output is sorted by file system type.  When using "mount", the output is sorted by mount points.
-s     Sum the total usage.
-t [FSTYPE] Allows you to perform filtering on file system type. FSTYPE could take any known file system value. For instance, "ext4", "ufs", "tmpfs", "reiserfs", etc.  You can also use wildcard filtering, just as with the -p option. For instance, if you use the following:
dfc -t ext
This will allow any file system type with name starting with "ext" to pass through the filter, for instance, "ext2", "ext3" and "ext4".
Multiple selection on file system is also possible. In this case, FSTYPE needs to be a comma separated list (without spaces). For instance, if you want to filter "ext4" and "tmpfs", you would use the following:
dfc -t ext4,tmpfs
You can also use negative matching to filter the output. To do so, you just need to prepend a "-" to FSTYPE. In the following example, dfc(1) will display all file system types except those mentioned:
dfc -t -rootfs,tmpfs
-T     Show file system type.
-u [UNIT] Show size using the unit specified. UNIT can take one of the following values:
"h":      Human readable (default when not using "-u" option).
"b":      Show bytes.
"k":      Show size using Kio.
"m":      Show size using Mio.
"g":      Show size using Gio.
"t":      Show size using Tio.
"p":      Show size using Pio.
"e":      Show size using Eio.
"z":      Show size using Zio.
"y":      Show size using Yio.
NOTE: When using "-u" option along with "-m" option, those suboptions are replaced by their SI counterparts.
-v     Print dfc(1) version and exit.
-w     Use a wider bar for the graph.
-W     Wide path name (avoid truncation of file name). May require a larger display.
The configuration file is optional. It allows you to change dfc(1) default colors, values when colors change and graph symbol in text mode and modify colors used in html export.
If you want to use it, place it here:
$XDG_CONFIG_HOME/dfc/dfcrc
If your operating system does not support XDG Base Directory Specification, it should then be placed here:
$HOME/.config/dfc/dfcrc
Or, last choice:
$HOME/.dfcrc
NOTE: The last two choices can be chosen only if your OS does not support XDG Base Directory Specification.
If you find one, please contact the author and explain what you encounter.
Robin Hahling <robin.hahling@gw-computing.net>
Copyright Â© 2012-2017 Robin Hahling
df(1), du(1)
UNLINK(1)                         User Commands                        UNLINK(1)
unlink - call the unlink function to remove the specified file
unlink FILE unlink OPTION
Call the unlink function to remove the specified FILE.
Written by Michael Stone.
unlink(2)
Full documentation <https://www.gnu.org/software/coreutils/unlink> or available locally via: info '(coreutils) unlink invocation'
NUMACTL(8)                Linux Administrator's Manual                NUMACTL(8)
numactl - Control NUMA policy for processes or shared memory
numactl [ --all ] [ --interleave nodes ] [ --preferred node ] [ --membind nodes ] [ --cpunodebind nodes ] [ --physcpubind cpus ] [ --localalloc ] [--] command {arguments ...} numactl --show numactl --hardware numactl [ --huge ] [ --offset offset ] [ --shmmode shmmode ] [ --length length ] [ --strict ] [ --shmid id ] --shm shmkeyfile | --file tmpfsfile [ --touch ] [ --dump ] [ --dump-nodes ] memory policy
numactl runs processes with a specific NUMA scheduling or memory placement policy.  The policy is set for command and inherited by all of its children.  In addition it can set persistent policy for shared memory segments or files.
Use -- before command if using command options that could be confused with numactl options.
nodes may be specified as N,N,N or  N-N or N,N-N or  N-N,N-N and so forth.  Relative nodes may be specifed as +N,N,N or  +N-N or +N,N-N and so forth. The + indicates that the node numbers are relative to the process' set of allowed nodes in its current cpuset.  A !N-N notation indicates the inverse of N-N, in other words all nodes except N-N.  If used with + notation, specify !+N-N. When same is specified the previous nodemask specified on the command line is used.  all means all nodes in the current cpuset.
Instead of a number a node can also be:
netdev:DEV                 The node connected to network device DEV. file:PATH                  The node the block device of PATH. ip:HOST                    The node of the network device of HOST block:PATH                 The node of block device PATH pci:[seg:]bus:dev[:func]   The node of a PCI device.
Note that block resolves the kernel block device names only for udev names in /dev use file:
Policy settings are:
--all, -a Unset default cpuset awareness, so user can use all possible CPUs/nodes for following policy settings.
--interleave=nodes, -i nodes Set a memory interleave policy. Memory will be allocated using round robin on nodes.  When memory cannot be allocated on the current interleave target fall back to other nodes.  Multiple nodes may be specified on --interleave, --membind and --cpunodebind.
--membind=nodes, -m nodes Only allocate memory from nodes.  Allocation will fail when there is not enough memory available on these nodes.  nodes may be specified as noted above.
--cpunodebind=nodes, -N nodes Only execute command on the CPUs of nodes.  Note that nodes may consist of multiple CPUs.  nodes may be specified as noted above.
--physcpubind=cpus, -C cpus Only execute process on cpus.  This accepts cpu numbers as shown in the processor fields of /proc/cpuinfo, or relative cpus as in relative to the current cpuset.  You may specify "all", which means all cpus in the current cpuset.  Physical cpus may be specified as N,N,N or  N-N or N,N-N or  N-N,N-N and so forth. Relative cpus may be specifed as +N,N,N or  +N-N or +N,N-N and so forth. The + indicates that the cpu numbers are relative to the process' set of allowed cpus in its current cpuset.  A !N-N notation indicates the inverse of N-N, in other words all cpus except N-N.  If used with + notation, specify !+N-N.
--localalloc, -l Try to allocate on the current node of the process, but if memory cannot be allocated there fall back to other nodes.
--preferred=node Preferably allocate memory on node, but if memory cannot be allocated there fall back to other nodes.  This option takes only a single node number.  Relative notation may be used.
--show, -s Show NUMA policy settings of the current process.
--hardware, -H Show inventory of available nodes on the system.
Numactl can set up policy for a SYSV shared memory segment or a file in shmfs/hugetlbfs.
This policy is persistent and will be used by all mappings from that shared memory. The order of options matters here.  The specification must at least include either of --shm, --shmid, --file to specify the shared memory segment or file and a memory policy like described above ( --interleave, --localalloc, --preferred, --membind ).
--huge When creating a SYSV shared memory segment use huge pages.  Only valid before --shmid or --shm
--offset Specify offset into the shared memory segment. Default 0.  Valid units are m (for MB), g (for GB), k (for KB), otherwise it specifies bytes.
--strict Give an error when a page in the policied area in the shared memory segment already was faulted in with a conflicting policy. Default is to silently ignore this.
--shmmode shmmode Only valid before --shmid or --shm When creating a shared memory segment set it to numeric mode shmmode.
--length length Apply policy to length range in the shared memory segment or make the segment length long Default is to use the remaining length Required when a shared memory segment is created and specifies the length of the new segment then. Valid units are m (for MB), g (for GB), k (for KB), otherwise it specifies bytes.
--shmid id Create or use an shared memory segment with numeric ID id
--shm shmkeyfile Create or use an shared memory segment, with the ID generated using ftok(3) from shmkeyfile
--file tmpfsfile Set policy for a file in tmpfs or hugetlbfs
--touch Touch pages to enforce policy early. Default is to not touch them, the policy is applied when an applications maps and accesses a page.
--dump Dump policy in the specified range.
--dump-nodes Dump all nodes of the specific range (very verbose!)
Valid node specifiers
all                 All nodes number              Node number number1{,number2}   Node number1 and Node number2 number1-number2     Nodes from number1 to number2 ! nodes             Invert selection of the following specification.
numactl --physcpubind=+0-4,8-12 myapplic arguments Run myapplic on cpus 0-4 and 8-12 of the current cpuset.
numactl --interleave=all bigdatabase arguments Run big database with its memory interleaved on all CPUs.
numactl --cpunodebind=0 --membind=0,1 process Run process on node 0 with memory allocated on node 0 and 1.
numactl --cpunodebind=0 --membind=0,1 -- process -l Run process as above, but with an option (-l) that would be confused with a numactl option.
numactl --cpunodebind=netdev:eth0 --membind=netdev:eth0 network-server Run network-server on the node of network device eth0 with its memory also in the same node.
numactl --preferred=1 numactl --show Set preferred node 1 and show the resulting state.
numactl --interleave=all --shm /tmp/shmkey Interleave all of the sysv shared memory region specified by /tmp/shmkey over all nodes.
Place a tmpfs file on 2 nodes: numactl --membind=2 dd if=/dev/zero of=/dev/shm/A bs=1M count=1024 numactl --membind=3 dd if=/dev/zero of=/dev/shm/A seek=1024 bs=1M count=1024
numactl --localalloc /dev/shm/file Reset the policy for the shared memory file file to the default localalloc policy.
Requires an NUMA policy aware kernel.
Command is not executed using a shell. If you want to use shell metacharacters in the child use sh -c as wrapper.
Setting policy for a hugetlbfs file does currently not work because it cannot be extended by truncate.
Shared memory segments larger than numactl's address space cannot be completely policied. This could be a problem on 32bit architectures. Changing it piece by piece may work.
The old --cpubind which accepts node numbers, not cpu numbers, is deprecated and replaced with the new --cpunodebind and --physcpubind options.
/proc/cpuinfo for the listing of active CPUs. See proc(5) for details.
/sys/devices/system/node/node*/numastat for NUMA memory hit statistics.
Copyright 2002,2004 Andi Kleen, SuSE Labs.  numactl and the demo programs are under the GNU General Public License, v.2
set_mempolicy(2) , get_mempolicy(2) , mbind(2) , sched_setaffinity(2) , sched_getaffinity(2) , proc(5) , ftok(3) , shmat(2) , migratepages(8)
FSTRIM(8)                     System Administration                    FSTRIM(8)
fstrim - discard unused blocks on a mounted filesystem
fstrim [-Aa] [-o offset] [-l length] [-m minimum-size] [-v mountpoint]
fstrim is used on a mounted filesystem to discard (or "trim") blocks which are not in use by the filesystem. This is useful for solid-state drives (SSDs) and thinly-provisioned storage.
By default, fstrim will discard all unused blocks in the filesystem. Options may be used to modify this behavior based on range or size, as explained below.
The mountpoint argument is the pathname of the directory where the filesystem is mounted.
Running fstrim frequently, or even using mount -o discard, might negatively affect the lifetime of poor-quality SSD devices. For most desktop and server systems a sufficient trimming frequency is once a week. Note that not all devices support a queued trim, so each trim command incurs a performance penalty on whatever else might be trying to use the disk at the time.
The offset, length, and minimum-size arguments may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
-A, --fstab Trim all mounted filesystems mentioned in /etc/fstab on devices that support the discard operation. The root filesystem is determined from kernel command line if missing in the file. The other supplied options, like --offset, --length and --minimum, are applied to all these devices. Errors from filesystems that do not support the discard operation, read-only devices and read-only filesystems are silently ignored.
-a, --all Trim all mounted filesystems on devices that support the discard operation. The other supplied options, like --offset, --length and --minimum, are applied to all these devices. Errors from filesystems that do not support the discard operation, read-only devices and read-only filesystems are silently ignored.
-n, --dry-run This option does everything apart from actually call FITRIM ioctl.
-o, --offset offset Byte offset in the filesystem from which to begin searching for free blocks to discard. The default value is zero, starting at the beginning of the filesystem.
-l, --length length The number of bytes (after the starting point) to search for free blocks to discard. If the specified value extends past the end of the filesystem, fstrim will stop at the filesystem size boundary. The default value extends to the end of the filesystem.
-I, --listed-in list Specifies a colon-separated list of files in fstab or kernel mountinfo format. All missing or empty files are silently ignored. The evaluation of the list stops after first non-empty file. For example:
--listed-in /etc/fstab:/proc/self/mountinfo.
-m, --minimum minimum-size Minimum contiguous free range to discard, in bytes. (This value is internally rounded up to a multiple of the filesystem block size.) Free ranges smaller than this will be ignored and fstrim will adjust the minimum if it’s smaller than the device’s minimum, and report that (fstrim_range.minlen) back to userspace. By increasing this value, the fstrim operation will complete more quickly for filesystems with badly fragmented freespace, although not all blocks will be discarded. The default value is zero, discarding every free block.
-v, --verbose Verbose execution. With this option fstrim will output the number of bytes passed from the filesystem down the block stack to the device for potential discard. This number is a maximum discard amount from the storage device’s perspective, because FITRIM ioctl called repeated will keep sending the same sectors for discard repeatedly.
fstrim will report the same potential discard bytes each time, but only sectors which had been written to between the discards would actually be discarded by the storage device. Further, the kernel block layer reserves the right to adjust the discard ranges to fit raid stripe geometry, non-trim capable devices in a LVM setup, etc. These reductions would not be reflected in fstrim_range.len (the --length option).
--quiet-unsupported Suppress error messages if trim operation (ioctl) is unsupported. This option is meant to be used in systemd service file or in cron scripts to hide warnings that are result of known problems, such as NTFS driver reporting Bad file descriptor when device is mounted read-only, or lack of file system support for ioctl FITRIM call. This option also cleans exit status when unsupported filesystem specified on fstrim command line.
64 some filesystem discards have succeeded, some failed
The command fstrim --all returns 0 (all succeeded), 32 (all failed) or 64 (some failed, some succeeded).
Lukas Czerner <lczerner@redhat.com>, Karel Zak <kzak@redhat.com>
blkdiscard(8), mount(8)
The fstrim command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
EXTUNDELETE(1)               General Commands Manual              EXTUNDELETE(1)
extundelete - utility to undelete files from an ext3 or ext4 partition.
extundelete [options] device-file...
extundelete is a utility that can recover deleted files from an ext3 or ext4 partition extundelete uses the information stored in the partition's journal to attempt to recover a file that has been deleted from the partition. There is no guarantee that any particular file will be able to be undeleted, so always try to have a good backup system in place, or at least put one in place after recovering your files!
--version Prints the version number of extundelete.
--help Print a brief usage summary for extundelete.
Partition name Name of the partition that has deleted files, such as /dev/sda3. Could also be the file name of a copy of the partition, such as that made with dd.
--superblock Prints information about the filesystem from the superblock.
--journal --superblock Prints information about the journal from the journal's superblock.
--inode # Prints the information from the inode number of the filesystem given, such as "--inode 2".
--block # Prints the contents of the block, called as "--block 9652".
--restore-file path/to/deleted/file Attempts to restore the file which was deleted at the given filename, called as "--restore-file dirname/filename".
--restore-inode # Used to restore inodes by number, called as "--restore-inode 2569". Also accepts a list of inodes separated by only commas, such as "--restore-inode 2569,5692,6925".
--restore-files filename Restores a list of files. First, construct a list of files in the same style as would be used in the --restore-file option, and save it to the file "filename". Then, this option may be used to attempt to restore those files with a single call to extundelete. This form also reduces redundancy from multiple calls parsing the journal multiple times.
--restore-all Restores all files possible to undelete to their names before deletion, when possible.  Other files are restored to a filename like "file.NNNN".
--restore-directory path/of/directory Restores all files possible to link to specified directory to their names before deletion, when possible.
-j journal_dev Specifies the device that is the external journal of the file system.
-b block_number Specifies the block number of the backup superblock to be used when opening the file system.
-B block_size Specifies the block size of the partition to be used when opening the file system.
--before date Only restore files deleted before the date specified, which should be in the form of the number of seconds since the UNIX epoch.  Use a shell command like $ date -d "Aug 1 9:02" +%s to convert a human-readable date to the proper format. The conversion from the number of seconds to a readable format may be found by using either of the following: $ date -d@1234567890 $ perl -le "print scalar localtime 1234567890"
--after date Only restore files deleted after the date specified, which should be in the form of the number of seconds since the UNIX epoch. See the notes for the --before option for more information.
extundelete was written by Nic Case <number9652@users.sourceforge.net> Copyright (C) 2009, 2012
This manual page was written by Elías Alejandro Año Mendoza <ealmdz@gmail.com>, for the Debian project (and may be used by others).
MDADM(8)                     System Manager's Manual                    MDADM(8)
mdadm - manage MD devices aka Linux Software RAID
mdadm [mode] <raiddevice> [options] <component-devices>
RAID devices are virtual devices created from two or more real block devices.  This allows multiple devices (typically disk drives or partitions thereof) to be combined into a single device to hold (for example) a single filesystem.  Some RAID levels include redundancy and so can survive some degree of device failure.
Linux Software RAID devices are implemented through the md (Multiple Devices) device driver.
Currently, Linux supports LINEAR md devices, RAID0 (striping), RAID1 (mirroring), RAID4, RAID5, RAID6, RAID10, MULTIPATH, FAULTY, and CONTAINER.
MULTIPATH is not a Software RAID mechanism, but does involve multiple devices: each device is a path to one common physical storage device. New installations should not use md/multipath as it is not well supported and has no ongoing development.  Use the Device Mapper based multipath- tools instead.
FAULTY is also not true RAID, and it only involves one device.  It provides a layer over a true device that can be used to inject faults.
CONTAINER is different again.  A CONTAINER is a collection of devices that are managed as a set.  This is similar to the set of devices connected to a hardware RAID controller.  The set of devices may contain a number of different RAID arrays each utilising some (or all) of the blocks from a number of the devices in the set.  For example, two devices in a 5-device set might form a RAID1 using the whole devices.  The remaining three might have a RAID5 over the first half of each device, and a RAID0 over the second half.
With a CONTAINER, there is one set of metadata that describes all of the arrays in the container.  So when mdadm creates a CONTAINER device, the device just represents the metadata.  Other normal arrays (RAID1 etc) can be created inside the container.
mdadm has several major modes of operation:
Assemble Assemble the components of a previously created array into an active array.  Components can be explicitly given or can be searched for.  mdadm checks that the components do form a bona fide array, and can, on request, fiddle superblock information so as to assemble a faulty array.
Build  Build an array that doesn't have per-device metadata (superblocks).  For these sorts of arrays, mdadm cannot differentiate between initial creation and subsequent assembly of an array.  It also cannot perform any checks that appropriate components have been requested.  Because of this, the Build mode should only be used together with a complete understanding of what you are doing.
Create Create a new array with per-device metadata (superblocks). Appropriate metadata is written to each device, and then the array comprising those devices is activated.  A 'resync' process is started to make sure that the array is consistent (e.g. both sides of a mirror contain the same data) but the content of the device is left otherwise untouched.  The array can be used as soon as it has been created.  There is no need to wait for the initial resync to finish.
Follow or Monitor Monitor one or more md devices and act on any state changes.  This is only meaningful for RAID1, 4, 5, 6, 10 or multipath arrays, as only these have interesting state.  RAID0 or Linear never have missing, spare, or failed drives, so there is nothing to monitor.
Grow   Grow (or shrink) an array, or otherwise reshape it in some way. Currently supported growth options including changing the active size of component devices and changing the number of active devices in Linear and RAID levels 0/1/4/5/6, changing the RAID level between 0, 1, 5, and 6, and between 0 and 10, changing the chunk size and layout for RAID 0,4,5,6,10 as well as adding or removing a write-intent bitmap and changing the array's consistency policy.
Incremental Assembly Add a single device to an appropriate array.  If the addition of the device makes the array runnable, the array will be started. This provides a convenient interface to a hot-plug system.  As each device is detected, mdadm has a chance to include it in some array as appropriate.  Optionally, when the --fail flag is passed in we will remove the device from any active array instead of adding it.
If a CONTAINER is passed to mdadm in this mode, then any arrays within that container will be assembled and started.
Manage This is for doing things to specific components of an array such as adding new spares and removing faulty devices.
Misc   This is an 'everything else' mode that supports operations on active arrays, operations on component devices such as erasing old superblocks, and information gathering operations.
Auto-detect This mode does not act on a specific device or array, but rather it requests the Linux Kernel to activate any auto-detected arrays.
Options for selecting a mode are: -A, --assemble Assemble a pre-existing array.
-B, --build Build a legacy array without superblocks.
-C, --create Create a new array.
-F, --follow, --monitor Select Monitor mode.
-G, --grow Change the size or shape of an active array.
-I, --incremental Add/remove a single device to/from an appropriate array, and possibly start the array.
--auto-detect Request that the kernel starts any auto-detected arrays.  This can only work if md is compiled into the kernel — not if it is a module.  Arrays can be auto-detected by the kernel if all the components are in primary MS-DOS partitions with partition type FD, and all use v0.90 metadata.  In-kernel autodetect is not recommended for new installations.  Using mdadm to detect and assemble arrays — possibly in an initrd — is substantially more flexible and should be preferred.
If a device is given before any options, or if the first option is one of --add, --re-add, --add-spare, --fail, --remove, or --replace, then the MANAGE mode is assumed.  Anything other than these will cause the Misc mode to be assumed.
Options that are not mode-specific are: -h, --help Display general help message or, after one of the above options, a mode-specific help message.
--help-options Display more detailed help about command line parsing and some commonly used options.
-V, --version Print version information for mdadm.
-v, --verbose Be more verbose about what is happening.  This can be used twice to be extra-verbose.  The extra verbosity currently only affects --detail --scan and --examine --scan.
-q, --quiet Avoid printing purely informative messages.  With this, mdadm will be silent unless there is something really important to report.
-f, --force Be more forceful about certain operations.  See the various modes for the exact meaning of this option in different contexts.
-c, --config= Specify the config file or directory.  Default is to use /etc/mdadm.conf and /etc/mdadm.conf.d, or if those are missing then /etc/mdadm/mdadm.conf and /etc/mdadm/mdadm.conf.d.  If the config file given is partitions then nothing will be read, but mdadm will act as though the config file contained exactly DEVICE partitions containers and will read /proc/partitions to find a list of devices to scan, and /proc/mdstat to find a list of containers to examine.  If the word none is given for the config file, then mdadm will act as though the config file were empty.
If the name given is of a directory, then mdadm will collect all the files contained in the directory with a name ending in .conf, sort them lexically, and process all of those files as config files.
-s, --scan Scan config file or /proc/mdstat for missing information.  In general, this option gives mdadm permission to get any missing information (like component devices, array devices, array identities, and alert destination) from the configuration file (see previous option); one exception is MISC mode when using --detail or --stop, in which case --scan says to get a list of array devices from /proc/mdstat.
-e, --metadata= Declare the style of RAID metadata (superblock) to be used.  The default is 1.2 for --create, and to guess for other operations. The default can be overridden by setting the metadata value for the CREATE keyword in mdadm.conf.
0, 0.90 Use the original 0.90 format superblock.  This format limits arrays to 28 component devices and limits component devices of levels 1 and greater to 2 terabytes.  It is also possible for there to be confusion about whether the superblock applies to a whole device or just the last partition, if that partition starts on a 64K boundary.
1, 1.0, 1.1, 1.2 default Use the new version-1 format superblock.  This has fewer restrictions.  It can easily be moved between hosts with different endian-ness, and a recovery operation can be checkpointed and restarted.  The different sub-versions store the superblock at different locations on the device, either at the end (for 1.0), at the start (for 1.1) or 4K from the start (for 1.2).  "1" is equivalent to "1.2" (the commonly preferred 1.x format).  "default" is equivalent to "1.2".
ddf    Use the "Industry Standard" DDF (Disk Data Format) format defined by SNIA.  When creating a DDF array a CONTAINER will be created, and normal arrays can be created in that container.
imsm   Use the Intel(R) Matrix Storage Manager metadata format. This creates a CONTAINER which is managed in a similar manner to DDF, and is supported by an option-rom on some platforms:
http://www.intel.com/design/chipsets/matrixstorage_sb.htm
--homehost= This will override any HOMEHOST setting in the config file and provides the identity of the host which should be considered the home for any arrays.
When creating an array, the homehost will be recorded in the metadata.  For version-1 superblocks, it will be prefixed to the array name.  For version-0.90 superblocks, part of the SHA1 hash of the hostname will be stored in the later half of the UUID.
When reporting information about an array, any array which is tagged for the given homehost will be reported as such.
When using Auto-Assemble, only arrays tagged for the given homehost will be allowed to use 'local' names (i.e. not ending in '_' followed by a digit string).  See below under Auto Assembly.
The special name "any" can be used as a wild card.  If an array is created with --homehost=any then the name "any" will be stored in the array and it can be assembled in the same way on any host.  If an array is assembled with this option, then the homehost recorded on the array will be ignored.
--prefer= When mdadm needs to print the name for a device it normally finds the name in /dev which refers to the device and is shortest.  When a path component is given with --prefer mdadm will prefer a longer name if it contains that component.  For example --prefer=by-uuid will prefer a name in a subdirectory of /dev called by-uuid.
This functionality is currently only provided by --detail and --monitor.
--home-cluster= specifies the cluster name for the md device. The md device can be assembled only on the cluster which matches the name specified. If this option is not provided, mdadm tries to detect the cluster name automatically.
For create, build, or grow: -n, --raid-devices= Specify the number of active devices in the array.  This, plus the number of spare devices (see below) must equal the number of component-devices (including "missing" devices) that are listed on the command line for --create.  Setting a value of 1 is probably a mistake and so requires that --force be specified first.  A value of 1 will then be allowed for linear, multipath, RAID0 and RAID1. It is never allowed for RAID4, RAID5 or RAID6. This number can only be changed using --grow for RAID1, RAID4, RAID5 and RAID6 arrays, and only on kernels which provide the necessary support.
-x, --spare-devices= Specify the number of spare (eXtra) devices in the initial array. Spares can also be added and removed later.  The number of component devices listed on the command line must equal the number of RAID devices plus the number of spare devices.
-z, --size= Amount (in Kilobytes) of space to use from each drive in RAID levels 1/4/5/6.  This must be a multiple of the chunk size, and must leave about 128Kb of space at the end of the drive for the RAID superblock.  If this is not specified (as it normally is not) the smallest drive (or partition) sets the size, though if there is a variance among the drives of greater than 1%, a warning is issued.
A suffix of 'K', 'M' or 'G' can be given to indicate Kilobytes, Megabytes or Gigabytes respectively.
Sometimes a replacement drive can be a little smaller than the original drives though this should be minimised by IDEMA standards.  Such a replacement drive will be rejected by md.  To guard against this it can be useful to set the initial size slightly smaller than the smaller device with the aim that it will still be larger than any replacement.
This value can be set with --grow for RAID level 1/4/5/6 though CONTAINER based arrays such as those with IMSM metadata may not be able to support this.  If the array was created with a size smaller than the currently active drives, the extra space can be accessed using --grow.  The size can be given as max which means to choose the largest size that fits on all current drives.
Before reducing the size of the array (with --grow --size=) you should make sure that space isn't needed.  If the device holds a filesystem, you would need to resize the filesystem to use less space.
After reducing the array size you should check that the data stored in the device is still available.  If the device holds a filesystem, then an 'fsck' of the filesystem is a minimum requirement.  If there are problems the array can be made bigger again with no loss with another --grow --size= command.
This value cannot be used when creating a CONTAINER such as with DDF and IMSM metadata, though it perfectly valid when creating an array inside a container.
-Z, --array-size= This is only meaningful with --grow and its effect is not persistent: when the array is stopped and restarted the default array size will be restored.
Setting the array-size causes the array to appear smaller to programs that access the data.  This is particularly needed before reshaping an array so that it will be smaller.  As the reshape is not reversible, but setting the size with --array-size is, it is required that the array size is reduced as appropriate before the number of devices in the array is reduced.
Before reducing the size of the array you should make sure that space isn't needed.  If the device holds a filesystem, you would need to resize the filesystem to use less space.
After reducing the array size you should check that the data stored in the device is still available.  If the device holds a filesystem, then an 'fsck' of the filesystem is a minimum requirement.  If there are problems the array can be made bigger again with no loss with another --grow --array-size= command.
A suffix of 'K', 'M' or 'G' can be given to indicate Kilobytes, Megabytes or Gigabytes respectively.  A value of max restores the apparent size of the array to be whatever the real amount of available space is.
Clustered arrays do not support this parameter yet.
-c, --chunk= Specify chunk size of kilobytes.  The default when creating an array is 512KB.  To ensure compatibility with earlier versions, the default when building an array with no persistent metadata is 64KB.  This is only meaningful for RAID0, RAID4, RAID5, RAID6, and RAID10.
RAID4, RAID5, RAID6, and RAID10 require the chunk size to be a power of 2.  In any case it must be a multiple of 4KB.
--rounding= Specify rounding factor for a Linear array.  The size of each component will be rounded down to a multiple of this size.  This is a synonym for --chunk but highlights the different meaning for Linear as compared to other RAID levels.  The default is 64K if a kernel earlier than 2.6.16 is in use, and is 0K (i.e. no rounding) in later kernels.
-l, --level= Set RAID level.  When used with --create, options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4, raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty, container.  Obviously some of these are synonymous.
When a CONTAINER metadata type is requested, only the container level is permitted, and it does not need to be explicitly given.
When used with --build, only linear, stripe, raid0, 0, raid1, multipath, mp, and faulty are valid.
Can be used with --grow to change the RAID level in some cases. See LEVEL CHANGES below.
-p, --layout= This option configures the fine details of data layout for RAID5, RAID6, and RAID10 arrays, and controls the failure modes for faulty.
The layout of the RAID5 parity block can be one of left-asymmetric, left-symmetric, right-asymmetric, right-symmetric, la, ra, ls, rs.  The default is left-symmetric.
It is also possible to cause RAID5 to use a RAID4-like layout by choosing parity-first, or parity-last.
Finally for RAID5 there are DDF-compatible layouts, ddf-zero-restart, ddf-N-restart, and ddf-N-continue.
These same layouts are available for RAID6.  There are also 4 layouts that will provide an intermediate stage for converting between RAID5 and RAID6.  These provide a layout which is identical to the corresponding RAID5 layout on the first N-1 devices, and has the 'Q' syndrome (the second 'parity' block used by RAID6) on the last device.  These layouts are: left-symmetric-6, right-symmetric-6, left-asymmetric-6, right-asymmetric-6, and parity-first-6.
When setting the failure mode for level faulty, the options are: write-transient, wt, read-transient, rt, write-persistent, wp, read-persistent, rp, write-all, read-fixable, rf, clear, flush, none.
Each failure mode can be followed by a number, which is used as a period between fault generation.  Without a number, the fault is generated once on the first relevant request.  With a number, the fault will be generated after that many requests, and will continue to be generated every time the period elapses.
Multiple failure modes can be current simultaneously by using the --grow option to set subsequent failure modes.
"clear" or "none" will remove any pending or periodic failure modes, and "flush" will clear any persistent faults.
Finally, the layout options for RAID10 are one of 'n', 'o' or 'f' followed by a small number.  The default is 'n2'.  The supported options are:
'n' signals 'near' copies.  Multiple copies of one data block are at similar offsets in different devices.
'o' signals 'offset' copies.  Rather than the chunks being duplicated within a stripe, whole stripes are duplicated but are rotated by one device so duplicate blocks are on different devices.  Thus subsequent copies of a block are in the next drive, and are one chunk further down.
'f' signals 'far' copies (multiple copies have very different offsets).  See md(4) for more detail about 'near', 'offset', and 'far'.
The number is the number of copies of each datablock.  2 is normal, 3 can be useful.  This number can be at most equal to the number of devices in the array.  It does not need to divide evenly into that number (e.g. it is perfectly legal to have an 'n2' layout for an array with an odd number of devices).
When an array is converted between RAID5 and RAID6 an intermediate RAID6 layout is used in which the second parity block (Q) is always on the last device.  To convert a RAID5 to RAID6 and leave it in this new layout (which does not require re-striping) use --layout=preserve.  This will try to avoid any restriping.