Asciidoc: Review sys-utils man pages,part 1

This commit is contained in:
Mario Blättermann 2021-03-25 20:27:34 +01:00
parent bbeadfdd5b
commit 68860732a7
14 changed files with 223 additions and 241 deletions

View File

@ -29,23 +29,23 @@ The format of the adjtime file is, in ASCII.
Three numbers, separated by blanks:
*drift factor*::
the systematic drift rate in seconds per day (floating point decimal)
the systematic drift rate in seconds per day (floating point decimal)
*last adjust time*::
the resulting number of seconds since 1969 UTC of most recent adjustment or calibration (decimal integer)
the resulting number of seconds since 1969 UTC of most recent adjustment or calibration (decimal integer)
*adjustment status*::
zero (for compatibility with *clock*(8)) as a floating point decimal
zero (for compatibility with *clock*(8)) as a floating point decimal
=== Second line
*last calibration time*::
The resulting number of seconds since 1969 UTC of most recent calibration. Zero if there has been no calibration yet or it is known that any previous calibration is moot (for example, because the Hardware Clock has been found, since that calibration, not to contain a valid time). This is a decimal integer.
The resulting number of seconds since 1969 UTC of most recent calibration. Zero if there has been no calibration yet or it is known that any previous calibration is moot (for example, because the Hardware Clock has been found, since that calibration, not to contain a valid time). This is a decimal integer.
=== Third line
*clock mode*::
Supported values are *UTC* or *LOCAL*. Tells whether the Hardware Clock is set to Coordinated Universal Time or local time. You can always override this value with options on the *hwclock*(8) command line.
Supported values are *UTC* or *LOCAL*. Tells whether the Hardware Clock is set to Coordinated Universal Time or local time. You can always override this value with options on the *hwclock*(8) command line.
== FILES

View File

@ -12,7 +12,7 @@ blkdiscard - discard sectors on a device
== SYNOPSIS
*blkdiscard* _options_ [*-o* _offset_] *-l* [_length_] _device_
*blkdiscard* [options] [*-o* _offset_] [*-l* _length_] _device_
== DESCRIPTION
@ -29,31 +29,31 @@ The _device_ argument is the pathname of the block device.
The _offset_ and _length_ 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.
*-f*, *--force*::
Disable all checking. Since v2.36 the block device is open in exclusive mode (O_EXCL) by default to avoid collision with mounted filesystem or another kernel subsystem. The *--force* option disables the exclusive access mode.
Disable all checking. Since v2.36 the block device is open in exclusive mode (O_EXCL) by default to avoid collision with mounted filesystem or another kernel subsystem. The *--force* option disables the exclusive access mode.
*-o*, *--offset* _offset_::
Byte offset into the device from which to start discarding. The provided value must be aligned to the device sector size. The default value is zero.
Byte offset into the device from which to start discarding. The provided value must be aligned to the device sector size. The default value is zero.
*-l*, *--length* _length_::
The number of bytes to discard (counting from the starting point). The provided value must be aligned to the device sector size. If the specified value extends past the end of the device, *blkdiscard* will stop at the device size boundary. The default value extends to the end of the device.
The number of bytes to discard (counting from the starting point). The provided value must be aligned to the device sector size. If the specified value extends past the end of the device, *blkdiscard* will stop at the device size boundary. The default value extends to the end of the device.
*-p*, *--step* _length_::
The number of bytes to discard within one iteration. The default is to discard all by one ioctl call.
The number of bytes to discard within one iteration. The default is to discard all by one ioctl call.
*-s*, *--secure*::
Perform a secure discard. A secure discard is the same as a regular discard except that all copies of the discarded blocks that were possibly created by garbage collection must also be erased. This requires support from the device.
Perform a secure discard. A secure discard is the same as a regular discard except that all copies of the discarded blocks that were possibly created by garbage collection must also be erased. This requires support from the device.
*-z*, *--zeroout*::
Zero-fill rather than discard.
Zero-fill rather than discard.
*-v*, *--verbose*::
Display the aligned values of _offset_ and _length_. If the *--step* option is specified, it prints the discard progress every second.
Display the aligned values of _offset_ and _length_. If the *--step* option is specified, it prints the discard progress every second.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== AUTHORS

View File

@ -28,7 +28,7 @@ The command *blkzone report* is used to report device zone information.
By default, the command will report all zones from the start of the block device. Options may be used to modify this behavior, changing the starting zone or the size of the report, as explained below.
.Report output
Report output:
[cols=",",]
|===
|start |Zone start sector
@ -41,7 +41,7 @@ By default, the command will report all zones from the start of the block device
|type |Zone type
|===
.Zone conditions
Zone conditions:
[cols=",",]
|===
|cl |Closed
@ -84,29 +84,29 @@ By default, the reset, open, close and finish commands will operate from the zon
The _offset_ and _length_ option 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. Additionally, the 0x prefix can be used to specify _offset_ and _length_ in hex.
*-o*, *--offset* _sector_::
The starting zone specified as a sector offset. The provided offset in sector units (512 bytes) should match the start of a zone. The default value is zero.
The starting zone specified as a sector offset. The provided offset in sector units (512 bytes) should match the start of a zone. The default value is zero.
*-l*, *--length* _sectors_::
The maximum number of sectors the command should operate on. The default value is the number of sectors remaining after _offset_. This option cannot be used together with the option *--count*.
The maximum number of sectors the command should operate on. The default value is the number of sectors remaining after _offset_. This option cannot be used together with the option *--count*.
*-c*, *--count* _count_::
The maximum number of zones the command should operate on. The default value is the number of zones starting from _offset_. This option cannot be used together with the option *--length*.
The maximum number of zones the command should operate on. The default value is the number of zones starting from _offset_. This option cannot be used together with the option *--length*.
*-f*, *--force*::
Enforce commands to change zone status on block devices used by the system.
Enforce commands to change zone status on block devices used by the system.
*-v*, *--verbose*::
Display the number of zones returned in the report or the range of sectors reset.
Display the number of zones returned in the report or the range of sectors reset.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== AUTHORS
mailto:shaun@tancheff.com[Shaun Tancheff] +
mailto:shaun@tancheff.com[Shaun Tancheff],
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO

View File

@ -27,47 +27,47 @@ Some options have a _cpu-list_ argument. Use this argument to specify a comma-se
== OPTIONS
*-c*, *--configure* _cpu-list_::
Configure the specified CPUs. Configuring a CPU means that the hypervisor takes a CPU from the CPU pool and assigns it to the virtual hardware on which your kernel runs.
Configure the specified CPUs. Configuring a CPU means that the hypervisor takes a CPU from the CPU pool and assigns it to the virtual hardware on which your kernel runs.
*-d*, *--disable* _cpu-list_::
Disable the specified CPUs. Disabling a CPU means that the kernel sets it offline.
Disable the specified CPUs. Disabling a CPU means that the kernel sets it offline.
*-e*, *--enable* _cpu-list_::
Enable the specified CPUs. Enabling a CPU means that the kernel sets it online. A CPU must be configured, see *-c*, before it can be enabled.
Enable the specified CPUs. Enabling a CPU means that the kernel sets it online. A CPU must be configured, see *-c*, before it can be enabled.
*-g*, *--deconfigure* _cpu-list_::
Deconfigure the specified CPUs. Deconfiguring a CPU means that the hypervisor removes the CPU from the virtual hardware on which the Linux instance runs and returns it to the CPU pool. A CPU must be offline, see *-d*, before it can be deconfigured.
Deconfigure the specified CPUs. Deconfiguring a CPU means that the hypervisor removes the CPU from the virtual hardware on which the Linux instance runs and returns it to the CPU pool. A CPU must be offline, see *-d*, before it can be deconfigured.
*-p*, *--dispatch* _mode_::
Set the CPU dispatching _mode_ (polarization). This option has an effect only if your hardware architecture and hypervisor support CPU polarization. Available _modes_ are:
Set the CPU dispatching _mode_ (polarization). This option has an effect only if your hardware architecture and hypervisor support CPU polarization. Available _modes_ are:
*horizontal*;;
The workload is spread across all available CPUs.
*horizontal*;;
The workload is spread across all available CPUs.
*vertical*;;
The workload is concentrated on few CPUs.
*vertical*;;
The workload is concentrated on few CPUs.
*-r*, *--rescan*::
Trigger a rescan of CPUs. After a rescan, the Linux kernel recognizes the new CPUs. Use this option on systems that do not automatically detect newly attached CPUs.
Trigger a rescan of CPUs. After a rescan, the Linux kernel recognizes the new CPUs. Use this option on systems that do not automatically detect newly attached CPUs.
*-V*, *--version*::
Display version information and exit.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== EXIT STATUS
*chcpu* has the following exit status values:
*0*::
success
success
*1*::
failure
failure
*64*::
partial success
partial success
== AUTHORS

View File

@ -18,17 +18,13 @@ chmem - configure memory
The chmem command sets a particular size or range of memory online or offline.
-::
Specify _SIZE_ as <size>[m|M|g|G]. With m or M, <size> specifies the memory size in MiB (1024 x 1024 bytes). With g or G, <size> specifies the memory size in GiB (1024 x 1024 x 1024 bytes). The default unit is MiB.
* Specify _SIZE_ as <size>[m|M|g|G]. With m or M, <size> specifies the memory size in MiB (1024 x 1024 bytes). With g or G, <size> specifies the memory size in GiB (1024 x 1024 x 1024 bytes). The default unit is MiB.
-::
Specify _RANGE_ in the form 0x<start>-0x<end> as shown in the output of the *lsmem*(1) command. <start> is the hexadecimal address of the first byte and <end> is the hexadecimal address of the last byte in the memory range.
* Specify _RANGE_ in the form 0x<start>-0x<end> as shown in the output of the *lsmem*(1) command. <start> is the hexadecimal address of the first byte and <end> is the hexadecimal address of the last byte in the memory range.
-::
Specify _BLOCKRANGE_ in the form <first>-<last> or <block> as shown in the output of the *lsmem*(1) command. <first> is the number of the first memory block and <last> is the number of the last memory block in the memory range. Alternatively a single block can be specified. _BLOCKRANGE_ requires the *--blocks* option.
* Specify _BLOCKRANGE_ in the form <first>-<last> or <block> as shown in the output of the *lsmem*(1) command. <first> is the number of the first memory block and <last> is the number of the last memory block in the memory range. Alternatively a single block can be specified. _BLOCKRANGE_ requires the *--blocks* option.
-::
Specify _ZONE_ as the name of a memory zone, as shown in the output of the *lsmem -o +ZONES* command. The output shows one or more valid memory zones for each memory range. If multiple zones are shown, then the memory range currently belongs to the first zone. By default, *chmem* will set memory online to the zone Movable, if this is among the valid zones. This default can be changed by specifying the *--zone* option with another valid zone. For memory ballooning, it is recommended to select the zone Movable for memory online and offline, if possible. Memory in this zone is much more likely to be able to be offlined again, but it cannot be used for arbitrary kernel allocations, only for migratable pages (e.g., anonymous and page cache pages). Use the *--help* option to see all available zones.
* Specify _ZONE_ as the name of a memory zone, as shown in the output of the *lsmem -o +ZONES* command. The output shows one or more valid memory zones for each memory range. If multiple zones are shown, then the memory range currently belongs to the first zone. By default, *chmem* will set memory online to the zone Movable, if this is among the valid zones. This default can be changed by specifying the *--zone* option with another valid zone. For memory ballooning, it is recommended to select the zone Movable for memory online and offline, if possible. Memory in this zone is much more likely to be able to be offlined again, but it cannot be used for arbitrary kernel allocations, only for migratable pages (e.g., anonymous and page cache pages). Use the *--help* option to see all available zones.
_SIZE_ and _RANGE_ must be aligned to the Linux memory block size, as shown in the output of the *lsmem*(1) command.
@ -39,52 +35,52 @@ When setting memory online *chmem* starts with the lowest memory block numbers.
== OPTIONS
*-b*, *--blocks*::
Use a _BLOCKRANGE_ parameter instead of _RANGE_ or _SIZE_ for the *--enable* and *--disable* options.
Use a _BLOCKRANGE_ parameter instead of _RANGE_ or _SIZE_ for the *--enable* and *--disable* options.
*-d*, *--disable*::
Set the specified _RANGE_, _SIZE_, or _BLOCKRANGE_ of memory offline.
Set the specified _RANGE_, _SIZE_, or _BLOCKRANGE_ of memory offline.
*-e*, *--enable*::
Set the specified _RANGE_, _SIZE_, or _BLOCKRANGE_ of memory online.
Set the specified _RANGE_, _SIZE_, or _BLOCKRANGE_ of memory online.
*-z*, *--zone*::
Select the memory _ZONE_ where to set the specified _RANGE_, _SIZE_, or _BLOCKRANGE_ of memory online or offline. By default, memory will be set online to the zone Movable, if possible.
Select the memory _ZONE_ where to set the specified _RANGE_, _SIZE_, or _BLOCKRANGE_ of memory online or offline. By default, memory will be set online to the zone Movable, if possible.
*-h*, *--help*::
Print a short help text, then exit.
Print a short help text, then exit.
*-v*, *--verbose*::
Verbose mode. Causes *chmem* to print debugging messages about it's progress.
Verbose mode. Causes *chmem* to print debugging messages about it's progress.
*-V*, *--version*::
Print the version number, then exit.
Print the version number, then exit.
== EXIT STATUS
*chmem* has the following exit status values:
*0*::
success
success
*1*::
failure
failure
*64*::
partial success
partial success
== EXAMPLE
*chmem --enable 1024*::
This command requests 1024 MiB of memory to be set online.
This command requests 1024 MiB of memory to be set online.
*chmem -e 2g*::
This command requests 2 GiB of memory to be set online.
This command requests 2 GiB of memory to be set online.
*chmem --disable 0x00000000e4000000-0x00000000f3ffffff*::
This command requests the memory range starting with 0x00000000e4000000 and ending with 0x00000000f3ffffff to be set offline.
This command requests the memory range starting with 0x00000000e4000000 and ending with 0x00000000f3ffffff to be set offline.
*chmem -b -d 10*::
This command requests the memory block number 10 to be set offline.
This command requests the memory block number 10 to be set offline.
== SEE ALSO

View File

@ -23,16 +23,16 @@ The *choom* command displays and adjusts Out-Of-Memory killer score setting.
== OPTIONS
*-p*, *--pid* _pid_::
Specifies process ID.
Specifies process ID.
*-n*, *--adjust* _value_::
Specify the adjust score value.
Specify the adjust score value.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
== NOTES

View File

@ -23,10 +23,10 @@ ctrlaltdel - set the function of the Ctrl-Alt-Del combination
Based on examination of the _linux/kernel/reboot.c_ code, it is clear that there are two supported functions that the <Ctrl-Alt-Del> sequence can perform.
*hard*::
Immediately reboot the computer without calling *sync*(2) and without any other preparation. This is the default.
Immediately reboot the computer without calling *sync*(2) and without any other preparation. This is the default.
*soft*::
Make the kernel send the SIGINT (interrupt) signal to the *init* process (this is always the process with PID 1). If this option is used, the *init*(8) program must support this feature. Since there are now several *init*(8) programs in the Linux community, please consult the documentation for the version that you are currently using.
Make the kernel send the *SIGINT* (interrupt) signal to the *init* process (this is always the process with PID 1). If this option is used, the *init*(8) program must support this feature. Since there are now several *init*(8) programs in the Linux community, please consult the documentation for the version that you are currently using.
When the command is run without any argument, it will display the current setting.
@ -35,10 +35,10 @@ The function of *ctrlaltdel* is usually set in the _/etc/rc.local_ file.
== OPTIONS
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== FILES

View File

@ -39,110 +39,110 @@ The default action is to display all messages from the kernel ring buffer.
The *--clear*, *--read-clear*, *--console-on*, *--console-off*, and *--console-level* options are mutually exclusive.
*-C*, *--clear*::
Clear the ring buffer.
Clear the ring buffer.
*-c*, *--read-clear*::
Clear the ring buffer after first printing its contents.
Clear the ring buffer after first printing its contents.
*-D*, *--console-off*::
Disable the printing of messages to the console.
Disable the printing of messages to the console.
*-d*, *--show-delta*::
Display the timestamp and the time delta spent between messages. If used together with *--notime* then only the time delta without the timestamp is printed.
Display the timestamp and the time delta spent between messages. If used together with *--notime* then only the time delta without the timestamp is printed.
*-E*, *--console-on*::
Enable printing messages to the console.
Enable printing messages to the console.
*-e*, *--reltime*::
Display the local time and the delta in human-readable format. Be aware that conversion to the local time could be inaccurate (see *-T* for more details).
Display the local time and the delta in human-readable format. Be aware that conversion to the local time could be inaccurate (see *-T* for more details).
*-F*, *--file* _file_::
Read the syslog messages from the given _file_. Note that *-F* does not support messages in kmsg format. The old syslog format is supported only.
Read the syslog messages from the given _file_. Note that *-F* does not support messages in kmsg format. The old syslog format is supported only.
*-f*, *--facility* _list_::
Restrict output to the given (comma-separated) _list_ of facilities. For example: +
{nbsp} +
*dmesg --facility=daemon* +
{nbsp} +
will print messages from system daemons only. For all supported facilities see the *--help* output.
Restrict output to the given (comma-separated) _list_ of facilities. For example:
+
*dmesg --facility=daemon*
+
will print messages from system daemons only. For all supported facilities see the *--help* output.
*-H*, *--human*::
Enable human-readable output. See also *--color*, *--reltime* and *--nopager*.
Enable human-readable output. See also *--color*, *--reltime* and *--nopager*.
*-k*, *--kernel*::
Print kernel messages.
Print kernel messages.
*-L*, *--color*[=_when_]::
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section below.
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section below.
*-l*, *--level* _list_::
Restrict output to the given (comma-separated) _list_ of levels. For example: +
{nbsp} +
*dmesg --level=err,warn* +
{nbsp} +
will print error and warning messages only. For all supported levels see the *--help* output.
Restrict output to the given (comma-separated) _list_ of levels. For example:
+
*dmesg --level=err,warn*
+
will print error and warning messages only. For all supported levels see the *--help* output.
*-n*, *--console-level* _level_::
Set the _level_ at which printing of messages is done to the console. The _level_ is a level number or abbreviation of the level name. For all supported levels see the *--help* output. +
{nbsp} +
For example, *-n 1* or *-n emerg* prevents all messages, except emergency (panic) messages, from appearing on the console. All levels of messages are still written to _/proc/kmsg_, so *syslogd*(8) can still be used to control exactly where kernel messages appear. When the *-n* option is used, *dmesg* will _not_ print or clear the kernel ring buffer.
Set the _level_ at which printing of messages is done to the console. The _level_ is a level number or abbreviation of the level name. For all supported levels see the *--help* output.
+
For example, *-n 1* or *-n emerg* prevents all messages, except emergency (panic) messages, from appearing on the console. All levels of messages are still written to _/proc/kmsg_, so *syslogd*(8) can still be used to control exactly where kernel messages appear. When the *-n* option is used, *dmesg* will _not_ print or clear the kernel ring buffer.
*--noescape*::
The unprintable and potentially unsafe characters (e.g., broken multi-byte sequences, terminal controlling chars, etc.) are escaped in format x<hex> for security reason by default. This option disables this feature at all. It's usable for example for debugging purpose together with *--raw*. Be careful and don't use it by default.
The unprintable and potentially unsafe characters (e.g., broken multi-byte sequences, terminal controlling chars, etc.) are escaped in format \x<hex> for security reason by default. This option disables this feature at all. It's usable for example for debugging purpose together with *--raw*. Be careful and don't use it by default.
*-P*, *--nopager*::
Do not pipe output into a pager. A pager is enabled by default for *--human* output.
Do not pipe output into a pager. A pager is enabled by default for *--human* output.
*-p*, *--force-prefix*::
Add facility, level or timestamp information to each line of a multi-line message.
Add facility, level or timestamp information to each line of a multi-line message.
*-r*, *--raw*::
Print the raw message buffer, i.e., do not strip the log-level prefixes, but all unprintable characters are still escaped (see also *--noescape*). +
{nbsp} +
Note that the real raw format depends on the method how *dmesg* reads kernel messages. The _/dev/kmsg_ device uses a different format than *syslog*(2). For backward compatibility, *dmesg* returns data always in the *syslog*(2) format. It is possible to read the real raw data from _/dev/kmsg_ by, for example, the command 'dd if=/dev/kmsg iflag=nonblock'.
Print the raw message buffer, i.e., do not strip the log-level prefixes, but all unprintable characters are still escaped (see also *--noescape*).
+
Note that the real raw format depends on the method how *dmesg* reads kernel messages. The _/dev/kmsg_ device uses a different format than *syslog*(2). For backward compatibility, *dmesg* returns data always in the *syslog*(2) format. It is possible to read the real raw data from _/dev/kmsg_ by, for example, the command 'dd if=/dev/kmsg iflag=nonblock'.
*-S*, *--syslog*::
Force *dmesg* to use the *syslog*(2) kernel interface to read kernel messages. The default is to use _/dev/kmsg_ rather than *syslog*(2) since kernel 3.5.0.
Force *dmesg* to use the *syslog*(2) kernel interface to read kernel messages. The default is to use _/dev/kmsg_ rather than *syslog*(2) since kernel 3.5.0.
*-s*, *--buffer-size* _size_::
Use a buffer of _size_ to query the kernel ring buffer. This is 16392 by default. (The default kernel syslog buffer size was 4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.) If you have set the kernel buffer to be larger than the default, then this option can be used to view the entire buffer.
Use a buffer of _size_ to query the kernel ring buffer. This is 16392 by default. (The default kernel syslog buffer size was 4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.) If you have set the kernel buffer to be larger than the default, then this option can be used to view the entire buffer.
*-T*, *--ctime*::
Print human-readable timestamps. +
{nbsp} +
*Be aware that the timestamp could be inaccurate!* The *time* source used for the logs is *not updated after* system *SUSPEND*/*RESUME*. Timestamps are adjusted according to current delta between boottime and monotonic clocks, this works only for messages printed after last resume.
Print human-readable timestamps.
+
*Be aware that the timestamp could be inaccurate!* The *time* source used for the logs is *not updated after* system *SUSPEND*/*RESUME*. Timestamps are adjusted according to current delta between boottime and monotonic clocks, this works only for messages printed after last resume.
*--since* _time_::
Display record since the specified time. The time is possible to specify in absolute way as well as by relative notation (e.g. '1 hour ago'). Be aware that the timestamp could be inaccurate and see *--ctime* for more details.
Display record since the specified time. The time is possible to specify in absolute way as well as by relative notation (e.g. '1 hour ago'). Be aware that the timestamp could be inaccurate and see *--ctime* for more details.
*--until* _time_::
Display record until the specified time. The time is possible to specify in absolute way as well as by relative notation (e.g. '1 hour ago'). Be aware that the timestamp could be inaccurate and see *--ctime* for more details.
Display record until the specified time. The time is possible to specify in absolute way as well as by relative notation (e.g. '1 hour ago'). Be aware that the timestamp could be inaccurate and see *--ctime* for more details.
*-t*, *--notime*::
Do not print kernel's timestamps.
Do not print kernel's timestamps.
*--time-format* _format_::
Print timestamps using the given _format_, which can be *ctime*, *reltime*, *delta* or *iso*. The first three formats are aliases of the time-format-specific options. The *iso* format is a *dmesg* implementation of the ISO-8601 timestamp format. The purpose of this format is to make the comparing of timestamps between two systems, and any other parsing, easy. The definition of the *iso* timestamp is: YYYY-MM-DD<T>HH:MM:SS,<microseconds><-+><timezone offset from UTC>. +
{nbsp} +
The *iso* format has the same issue as *ctime*: the time may be inaccurate when a system is suspended and resumed.
Print timestamps using the given _format_, which can be *ctime*, *reltime*, *delta* or *iso*. The first three formats are aliases of the time-format-specific options. The *iso* format is a *dmesg* implementation of the ISO-8601 timestamp format. The purpose of this format is to make the comparing of timestamps between two systems, and any other parsing, easy. The definition of the *iso* timestamp is: YYYY-MM-DD<T>HH:MM:SS,<microseconds><-+><timezone offset from UTC>.
+
The *iso* format has the same issue as *ctime*: the time may be inaccurate when a system is suspended and resumed.
*-u*, *--userspace*;;
Print userspace messages.
Print userspace messages.
*-w*, *--follow*;;
Wait for new messages. This feature is supported only on systems with a readable _/dev/kmsg_ (since kernel 3.5.0).
Wait for new messages. This feature is supported only on systems with a readable _/dev/kmsg_ (since kernel 3.5.0).
*-W*, *--follow-new*;;
Wait and print only new messages.
Wait and print only new messages.
*-x*, *--decode*;;
Decode facility and level (priority) numbers to human-readable prefixes.
Decode facility and level (priority) numbers to human-readable prefixes.
*-V*, *--version*;;
Display version information and exit.
Display version information and exit.
*-h*, *--help*;;
Display help text and exit.
Display help text and exit.
== COLORS
@ -151,28 +151,28 @@ Implicit coloring can be disabled by an empty file _/etc/terminal-colors.d/dmesg
The logical color names supported by *dmesg* are:
*subsys*::
The message sub-system prefix (e.g., "ACPI:").
The message sub-system prefix (e.g., "ACPI:").
*time*::
The message timestamp.
The message timestamp.
*timebreak*::
The message timestamp in short ctime format in *--reltime* or *--human* output.
The message timestamp in short ctime format in *--reltime* or *--human* output.
*alert*::
The text of the message with the alert log priority.
The text of the message with the alert log priority.
*crit*::
The text of the message with the critical log priority.
The text of the message with the critical log priority.
*err*::
The text of the message with the error log priority.
The text of the message with the error log priority.
*warn*::
The text of the message with the warning log priority.
The text of the message with the warning log priority.
*segfault*::
The text of the message that inform about segmentation fault.
The text of the message that inform about segmentation fault.
== EXIT STATUS

View File

@ -35,64 +35,64 @@ If the device or a device partition is currently mounted, it is unmounted before
== OPTIONS
*-a*, **--auto on**|*off*::
This option controls the auto-eject mode, supported by some devices. When enabled, the drive automatically ejects when the device is closed.
This option controls the auto-eject mode, supported by some devices. When enabled, the drive automatically ejects when the device is closed.
*-c*, *--changerslot* _slot_::
With this option a CD slot can be selected from an ATAPI/IDE CD-ROM changer. The CD-ROM drive cannot be in use (mounted data CD or playing a music CD) for a change request to work. Please also note that the first slot of the changer is referred to as 0, not 1.
With this option a CD slot can be selected from an ATAPI/IDE CD-ROM changer. The CD-ROM drive cannot be in use (mounted data CD or playing a music CD) for a change request to work. Please also note that the first slot of the changer is referred to as 0, not 1.
*-d*, *--default*::
List the default device name.
List the default device name.
*-F*, *--force*::
Force eject, don't check device type, don't open device with exclusive lock. The successful result may be false positive on non hot-pluggable devices.
Force eject, don't check device type, don't open device with exclusive lock. The successful result may be false positive on non hot-pluggable devices.
*-f*, *--floppy*::
This option specifies that the drive should be ejected using a removable floppy disk eject command.
This option specifies that the drive should be ejected using a removable floppy disk eject command.
*-h*, *--help*::
Display help text and exit.
*-h*, *--help*::
Display help text and exit.
*-i*, **--manualeject on**|*off*::
This option controls locking of the hardware eject button. When enabled, the drive will not be ejected when the button is pressed. This is useful when you are carrying a laptop in a bag or case and don't want it to eject if the button is inadvertently pressed.
This option controls locking of the hardware eject button. When enabled, the drive will not be ejected when the button is pressed. This is useful when you are carrying a laptop in a bag or case and don't want it to eject if the button is inadvertently pressed.
*-M*, *--no-partitions-unmount*::
The option tells eject to not try to unmount other partitions on partitioned devices. If another partition is still mounted, the program will not attempt to eject the media. It will attempt to unmount only the device or mountpoint given on the command line.
The option tells eject to not try to unmount other partitions on partitioned devices. If another partition is still mounted, the program will not attempt to eject the media. It will attempt to unmount only the device or mountpoint given on the command line.
*-m*, *--no-unmount*::
The option tells eject to not try to unmount at all. If this option is not specified than *eject* opens the device with *O_EXCL* flag to be sure that the device is not used (since v2.35).
The option tells eject to not try to unmount at all. If this option is not specified than *eject* opens the device with *O_EXCL* flag to be sure that the device is not used (since v2.35).
*-n*, *--noop*::
With this option the selected device is displayed but no action is performed.
With this option the selected device is displayed but no action is performed.
*-p*, *--proc*::
This option allows you to use _/proc/mounts_ instead _/etc/mtab_. It also passes the *-n* option to *umount*(8).
This option allows you to use _/proc/mounts_ instead _/etc/mtab_. It also passes the *-n* option to *umount*(8).
*-q*, *--tape*::
This option specifies that the drive should be ejected using a tape drive offline command.
This option specifies that the drive should be ejected using a tape drive offline command.
*-r*, *--cdrom*::
This option specifies that the drive should be ejected using a CDROM eject command.
This option specifies that the drive should be ejected using a CDROM eject command.
*-s*, *--scsi*::
This option specifies that the drive should be ejected using SCSI commands.
This option specifies that the drive should be ejected using SCSI commands.
*-T*, *--traytoggle*::
With this option the drive is given a CD-ROM tray close command if it's opened, and a CD-ROM tray eject command if it's closed. Not all devices support this command, because it uses the above CD-ROM tray close command.
With this option the drive is given a CD-ROM tray close command if it's opened, and a CD-ROM tray eject command if it's closed. Not all devices support this command, because it uses the above CD-ROM tray close command.
*-t*, *--trayclose*::
With this option the drive is given a CD-ROM tray close command. Not all devices support this command.
With this option the drive is given a CD-ROM tray close command. Not all devices support this command.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-v*, *--verbose*::
Run in verbose mode; more information is displayed about what the command is doing.
Run in verbose mode; more information is displayed about what the command is doing.
*-X*, *--listspeed*::
With this option the CD-ROM drive will be probed to detect the available speeds. The output is a list of speeds which can be used as an argument of the *-x* option. This only works with Linux 2.6.13 or higher, on previous versions solely the maximum speed will be reported. Also note that some drives may not correctly report the speed and therefore this option does not work with them.
With this option the CD-ROM drive will be probed to detect the available speeds. The output is a list of speeds which can be used as an argument of the *-x* option. This only works with Linux 2.6.13 or higher, on previous versions solely the maximum speed will be reported. Also note that some drives may not correctly report the speed and therefore this option does not work with them.
*-x*, *--cdspeed* _speed_::
With this option the drive is given a CD-ROM select speed command. The _speed_ argument is a number indicating the desired speed (e.g., 8 for 8X speed), or 0 for maximum data rate. Not all devices support this command and you can only specify speeds that the drive is capable of. Every time the media is changed this option is cleared. This option can be used alone, or with the *-t* and *-c* options.
With this option the drive is given a CD-ROM select speed command. The _speed_ argument is a number indicating the desired speed (e.g., 8 for 8X speed), or 0 for maximum data rate. Not all devices support this command and you can only specify speeds that the drive is capable of. Every time the media is changed this option is cleared. This option can be used alone, or with the *-t* and *-c* options.
== EXIT STATUS
@ -116,7 +116,7 @@ You need appropriate privileges to access the device files. Running as root is r
== AUTHORS
mailto:tranter@pobox.com[Jeff Tranter] - original author. mailto:kzak@redhat.com[Karel Zak] and mailto:mluscon@redhat.com[Michal Luscon] - util-linux version.
mailto:tranter@pobox.com[Jeff Tranter] - original author, mailto:kzak@redhat.com[Karel Zak] and mailto:mluscon@redhat.com[Michal Luscon] - util-linux version.
== SEE ALSO

View File

@ -31,60 +31,60 @@ The _length_ and _offset_ arguments may be followed by the multiplicative suffix
The options *--collapse-range*, *--dig-holes*, *--punch-hole*, and *--zero-range* are mutually exclusive.
*-c*, *--collapse-range*::
Removes a byte range from a file, without leaving a hole. The byte range to be collapsed starts at _offset_ and continues for _length_ bytes. At the completion of the operation, the contents of the file starting at the location __offset__+_length_ will be appended at the location _offset_, and the file will be _length_ bytes smaller. The option *--keep-size* may not be specified for the collapse-range operation. +
{nbsp} +
Available since Linux 3.15 for ext4 (only for extent-based files) and XFS. +
{nbsp} +
A filesystem may place limitations on the granularity of the operation, in order to ensure efficient implementation. Typically, offset and len must be a multiple of the filesystem logical block size, which varies according to the filesystem type and configuration. If a filesystem has such a requirement, the operation will fail with the error EINVAL if this requirement is violated.
Removes a byte range from a file, without leaving a hole. The byte range to be collapsed starts at _offset_ and continues for _length_ bytes. At the completion of the operation, the contents of the file starting at the location __offset__+_length_ will be appended at the location _offset_, and the file will be _length_ bytes smaller. The option *--keep-size* may not be specified for the collapse-range operation.
+
Available since Linux 3.15 for ext4 (only for extent-based files) and XFS.
+
A filesystem may place limitations on the granularity of the operation, in order to ensure efficient implementation. Typically, offset and len must be a multiple of the filesystem logical block size, which varies according to the filesystem type and configuration. If a filesystem has such a requirement, the operation will fail with the error EINVAL if this requirement is violated.
*-d*, *--dig-holes*::
Detect and dig holes. This makes the file sparse in-place, without using extra disk space. The minimum size of the hole depends on filesystem I/O block size (usually 4096 bytes). Also, when using this option, *--keep-size* is implied. If no range is specified by *--offset* and *--length*, then the entire file is analyzed for holes. +
{nbsp} +
You can think of this option as doing a "*cp --sparse*" and then renaming the destination file to the original, without the need for extra disk space. +
{nbsp} +
See *--punch-hole* for a list of supported filesystems.
Detect and dig holes. This makes the file sparse in-place, without using extra disk space. The minimum size of the hole depends on filesystem I/O block size (usually 4096 bytes). Also, when using this option, *--keep-size* is implied. If no range is specified by *--offset* and *--length*, then the entire file is analyzed for holes.
+
You can think of this option as doing a "*cp --sparse*" and then renaming the destination file to the original, without the need for extra disk space.
+
See *--punch-hole* for a list of supported filesystems.
*-i*, *--insert-range*::
Insert a hole of _length_ bytes from _offset_, shifting existing data.
Insert a hole of _length_ bytes from _offset_, shifting existing data.
*-l*, *--length* _length_::
Specifies the length of the range, in bytes.
Specifies the length of the range, in bytes.
*-n*, *--keep-size*::
Do not modify the apparent length of the file. This may effectively allocate blocks past EOF, which can be removed with a truncate.
Do not modify the apparent length of the file. This may effectively allocate blocks past EOF, which can be removed with a truncate.
*-o*, *--offset* _offset_::
Specifies the beginning offset of the range, in bytes.
Specifies the beginning offset of the range, in bytes.
*-p*, *--punch-hole*::
Deallocates space (i.e., creates a hole) in the byte range starting at _offset_ and continuing for _length_ bytes. Within the specified range, partial filesystem blocks are zeroed, and whole filesystem blocks are removed from the file. After a successful call, subsequent reads from this range will return zeroes. This option may not be specified at the same time as the *--zero-range* option. Also, when using this option, *--keep-size* is implied. +
{nbsp} +
Supported for XFS (since Linux 2.6.38), ext4 (since Linux 3.0), Btrfs (since Linux 3.7), tmpfs (since Linux 3.5) and gfs2 (since Linux 4.16).
Deallocates space (i.e., creates a hole) in the byte range starting at _offset_ and continuing for _length_ bytes. Within the specified range, partial filesystem blocks are zeroed, and whole filesystem blocks are removed from the file. After a successful call, subsequent reads from this range will return zeroes. This option may not be specified at the same time as the *--zero-range* option. Also, when using this option, *--keep-size* is implied.
+
Supported for XFS (since Linux 2.6.38), ext4 (since Linux 3.0), Btrfs (since Linux 3.7), tmpfs (since Linux 3.5) and gfs2 (since Linux 4.16).
*-v*, *--verbose*::
Enable verbose mode.
Enable verbose mode.
*-x*, *--posix*::
Enable POSIX operation mode. In that mode allocation operation always completes, but it may take longer time when fast allocation is not supported by the underlying filesystem.
Enable POSIX operation mode. In that mode allocation operation always completes, but it may take longer time when fast allocation is not supported by the underlying filesystem.
*-z*, *--zero-range*::
Zeroes space in the byte range starting at _offset_ and continuing for _length_ bytes. Within the specified range, blocks are preallocated for the regions that span the holes in the file. After a successful call, subsequent reads from this range will return zeroes. +
{nbsp} +
Zeroing is done within the filesystem preferably by converting the range into unwritten extents. This approach means that the specified range will not be physically zeroed out on the device (except for partial blocks at the either end of the range), and I/O is (otherwise) required only to update metadata. +
{nbsp} +
Option *--keep-size* can be specified to prevent file length modification. +
{nbsp} +
Available since Linux 3.14 for ext4 (only for extent-based files) and XFS.
Zeroes space in the byte range starting at _offset_ and continuing for _length_ bytes. Within the specified range, blocks are preallocated for the regions that span the holes in the file. After a successful call, subsequent reads from this range will return zeroes.
+
Zeroing is done within the filesystem preferably by converting the range into unwritten extents. This approach means that the specified range will not be physically zeroed out on the device (except for partial blocks at the either end of the range), and I/O is (otherwise) required only to update metadata.
+
Option *--keep-size* can be specified to prevent file length modification.
+
Available since Linux 3.14 for ext4 (only for extent-based files) and XFS.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== AUTHORS
mailto:sandeen@redhat.com[Eric Sandeen] +
mailto:sandeen@redhat.com[Eric Sandeen],
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO

View File

@ -53,40 +53,40 @@ The third form uses an open file by its file descriptor _number_. See the exampl
== OPTIONS
*-c*, *--command* _command_::
Pass a single _command_, without arguments, to the shell with *-c*.
Pass a single _command_, without arguments, to the shell with *-c*.
*-E*, *--conflict-exit-code* _number_::
The exit status used when the *-n* option is in use, and the conflicting lock exists, or the *-w* option is in use, and the timeout is reached. The default value is *1*. The _number_ has to be in the range of 0 to 255.
The exit status used when the *-n* option is in use, and the conflicting lock exists, or the *-w* option is in use, and the timeout is reached. The default value is *1*. The _number_ has to be in the range of 0 to 255.
*-F*, *--no-fork*::
Do not fork before executing _command_. Upon execution the flock process is replaced by _command_ which continues to hold the lock. This option is incompatible with *--close* as there would otherwise be nothing left to hold the lock.
Do not fork before executing _command_. Upon execution the flock process is replaced by _command_ which continues to hold the lock. This option is incompatible with *--close* as there would otherwise be nothing left to hold the lock.
*-e*, *-x*, *--exclusive*::
Obtain an exclusive lock, sometimes called a write lock. This is the default.
Obtain an exclusive lock, sometimes called a write lock. This is the default.
*-n*, *--nb*, *--nonblock*::
Fail rather than wait if the lock cannot be immediately acquired. See the *-E* option for the exit status used.
Fail rather than wait if the lock cannot be immediately acquired. See the *-E* option for the exit status used.
*-o*, *--close*::
Close the file descriptor on which the lock is held before executing _command_. This is useful if _command_ spawns a child process which should not be holding the lock.
Close the file descriptor on which the lock is held before executing _command_. This is useful if _command_ spawns a child process which should not be holding the lock.
*-s*, *--shared*::
Obtain a shared lock, sometimes called a read lock.
Obtain a shared lock, sometimes called a read lock.
*-u*, *--unlock*::
Drop a lock. This is usually not required, since a lock is automatically dropped when the file is closed. However, it may be required in special cases, for example if the enclosed command group may have forked a background process which should not be holding the lock.
Drop a lock. This is usually not required, since a lock is automatically dropped when the file is closed. However, it may be required in special cases, for example if the enclosed command group may have forked a background process which should not be holding the lock.
*-w*, *--wait*, *--timeout* _seconds_::
Fail if the lock cannot be acquired within _seconds_. Decimal fractional values are allowed. See the *-E* option for the exit status used. The zero number of _seconds_ is interpreted as *--nonblock*.
Fail if the lock cannot be acquired within _seconds_. Decimal fractional values are allowed. See the *-E* option for the exit status used. The zero number of _seconds_ is interpreted as *--nonblock*.
*--verbose*::
Report how long it took to acquire the lock, or why the lock could not be obtained.
Report how long it took to acquire the lock, or why the lock could not be obtained.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== EXIT STATUS
@ -99,22 +99,22 @@ When using the _command_ variant, and executing the child worked, then the exit
Note that "shell> " in examples is a command line prompt.
shell1> flock /tmp -c cat; shell2> flock -w .007 /tmp -c echo; /bin/echo $?::
Set exclusive lock to directory /tmp and the second command will fail.
Set exclusive lock to directory /tmp and the second command will fail.
shell1> flock -s /tmp -c cat; shell2> flock -s -w .007 /tmp -c echo; /bin/echo $?::
Set shared lock to directory /tmp and the second command will not fail. Notice that attempting to get exclusive lock with second command would fail.
Set shared lock to directory /tmp and the second command will not fail. Notice that attempting to get exclusive lock with second command would fail.
shell> flock -x local-lock-file echo 'a b c'::
Grab the exclusive lock "local-lock-file" before running echo with 'a b c'.
Grab the exclusive lock "local-lock-file" before running echo with 'a b c'.
(; flock -n 9 || exit 1; # ... commands executed under lock ...; ) 9>/var/lock/mylockfile::
The form is convenient inside shell scripts. The mode used to open the file doesn't matter to *flock*; using _>_ or _>>_ allows the lockfile to be created if it does not already exist, however, write permission is required. Using _<_ requires that the file already exists but only read permission is required.
The form is convenient inside shell scripts. The mode used to open the file doesn't matter to *flock*; using _>_ or _>>_ allows the lockfile to be created if it does not already exist, however, write permission is required. Using _<_ requires that the file already exists but only read permission is required.
[ $\{FLOCKER} != $0 ] && exec env FLOCKER="$0 flock -en $0 $0 $@ || :::
This is useful boilerplate code for shell scripts. Put it at the top of the shell script you want to lock and it'll automatically lock itself on the first run. If the env var *$FLOCKER* is not set to the shell script that is being run, then execute *flock* and grab an exclusive non-blocking lock (using the script itself as the lock file) before re-execing itself with the right arguments. It also sets the FLOCKER env var to the right value so it doesn't run again.
This is useful boilerplate code for shell scripts. Put it at the top of the shell script you want to lock and it'll automatically lock itself on the first run. If the env var *$FLOCKER* is not set to the shell script that is being run, then execute *flock* and grab an exclusive non-blocking lock (using the script itself as the lock file) before re-execing itself with the right arguments. It also sets the FLOCKER env var to the right value so it doesn't run again.
shell> exec 4<>/var/lock/mylockfile; shell> flock -n 4::
This form is convenient for locking a file without spawning a subprocess. The shell opens the lock file for reading and writing as file descriptor 4, then flock is used to lock the descriptor.
This form is convenient for locking a file without spawning a subprocess. The shell opens the lock file for reading and writing as file descriptor 4, then flock is used to lock the descriptor.
== AUTHORS

View File

@ -29,18 +29,18 @@ Note that access-time updates are also suspended if the filesystem is mounted wi
== OPTIONS
*-f*, *--freeze*::
This option requests the specified a filesystem to be frozen from new modifications. When this is selected, all ongoing transactions in the filesystem are allowed to complete, new write system calls are halted, other calls which modify the filesystem are halted, and all dirty data, metadata, and log information are written to disk. Any process attempting to write to the frozen filesystem will block waiting for the filesystem to be unfrozen. +
{nbsp} +
Note that even after freezing, the on-disk filesystem can contain information on files that are still in the process of unlinking. These files will not be unlinked until the filesystem is unfrozen or a clean mount of the snapshot is complete.
This option requests the specified a filesystem to be frozen from new modifications. When this is selected, all ongoing transactions in the filesystem are allowed to complete, new write system calls are halted, other calls which modify the filesystem are halted, and all dirty data, metadata, and log information are written to disk. Any process attempting to write to the frozen filesystem will block waiting for the filesystem to be unfrozen.
+
Note that even after freezing, the on-disk filesystem can contain information on files that are still in the process of unlinking. These files will not be unlinked until the filesystem is unfrozen or a clean mount of the snapshot is complete.
*-u*, *--unfreeze*::
This option is used to un-freeze the filesystem and allow operations to continue. Any filesystem modifications that were blocked by the freeze are unblocked and allowed to complete.
This option is used to un-freeze the filesystem and allow operations to continue. Any filesystem modifications that were blocked by the freeze are unblocked and allowed to complete.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== FILESYSTEM SUPPORT

View File

@ -62,7 +62,6 @@ LABEL=t-home2 /home ext4 defaults,auto_da_alloc 0 2
=== The first field (_fs_spec_).
____
This field describes the block special device, remote filesystem or filesystem image for loop device to be mounted or swap file or swap partition to be enabled.
For ordinary mounts, it will hold (a link to) a block special device node (as created by *mknod*(2)) for the device to be mounted, like _/dev/cdrom_ or _/dev/sdb7_. For NFS mounts, this field is _<host>:<dir>_, e.g., _knuth.aeb.nl:/_. For filesystems with no storage, any string can be used, and will show up in *df*(1) output, for example. Typical usage is _proc_ for *procfs*; _mem_, _none_, or _tmpfs_ for *tmpfs*. Other special filesystems, like *udev* and *sysfs*, are typically not listed in *fstab*.
@ -74,17 +73,13 @@ It's also possible to use *PARTUUID=* and *PARTLABEL=*. These partitions identif
See *mount*(8), *blkid*(8) or *lsblk*(8) for more details about device identifiers.
Note that *mount*(8) uses UUIDs as strings. The string representation of the UUID should be based on lower case characters. But when specifying the volume ID of FAT or NTFS file systems upper case characters are used (e.g UUID="A40D-85E7" or UUID="61DB7756DB7779B3").
____
=== The second field (_fs_file_).
____
This field describes the mount point (target) for the filesystem. For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces or tabs these can be escaped as `\040' and '\011' respectively.
____
=== The third field (_fs_vfstype_).
____
This field describes the type of the filesystem. Linux supports many filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs, hfsplus, tmpfs, sysfs, proc, iso9660, udf, squashfs, nfs, cifs, and many more. For more details, see mount8.
An entry _swap_ denotes a file or partition to be used for swapping, cf. *swapon*(8). An entry _none_ is useful for bind or move mounts.
@ -92,11 +87,9 @@ An entry _swap_ denotes a file or partition to be used for swapping, cf. *swapon
More than one type may be specified in a comma-separated list.
*mount*(8) and *umount*(8) support filesystem _subtypes_. The subtype is defined by '.subtype' suffix. For example 'fuse.sshfs'. It's recommended to use subtype notation rather than add any prefix to the first fstab field (for example 'sshfs#example.com' is deprecated).
____
=== The fourth field (_fs_mntops_).
____
This field describes the mount options associated with the filesystem.
It is formatted as a comma-separated list of options. It contains at least the type of mount (*ro* or *rw*), plus any additional options appropriate to the filesystem type (including performance-tuning options). For details, see *mount*(8) or *swapon*(8).
@ -104,34 +97,29 @@ It is formatted as a comma-separated list of options. It contains at least the t
Basic filesystem-independent options are:
*defaults*::
use default options: rw, suid, dev, exec, auto, nouser, and async.
use default options: rw, suid, dev, exec, auto, nouser, and async.
*noauto*::
do not mount when *mount -a* is given (e.g., at boot time)
do not mount when *mount -a* is given (e.g., at boot time)
*user*::
allow a user to mount
allow a user to mount
*owner*::
allow device owner to mount
allow device owner to mount
*comment*::
or *x-<name>* for use by fstab-maintaining programs
or *x-<name>* for use by fstab-maintaining programs
*nofail*::
do not report errors for this device if it does not exist.
____
do not report errors for this device if it does not exist.
=== The fifth field (_fs_freq_).
____
This field is used by *dump*(8) to determine which filesystems need to be dumped. Defaults to zero (don't dump) if not present.
____
=== The sixth field (_fs_passno_).
____
This field is used by *fsck*(8) to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a _fs_passno_ of 1. Other filesystems should have a _fs_passno_ of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. Defaults to zero (don't check the filesystem) if not present.
____
== FILES
_/etc/fstab_ +
_/etc/fstab_,
_<fstab.h>_
== NOTES

View File

@ -29,59 +29,57 @@ Running *fstrim* frequently, or even using *mount -o discard*, might negatively
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.
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.
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.
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.
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.
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*.
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.
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. +
{nbsp} +
*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).
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.
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.
*-V*, *--version*::
Display version information and exit.
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
Display help text and exit.
== EXIT STATUS
0::
success
success
1::
failure
failure
32::
all failed
all failed
64::
some filesystem discards have succeeded, some failed
some filesystem discards have succeeded, some failed
The command *fstrim --all* returns 0 (all succeeded), 32 (all failed) or 64 (some failed, some succeeded).
== AUTHORS
mailto:lczerner@redhat.com[Lukas Czerner] +
mailto:lczerner@redhat.com[Lukas Czerner],
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO