Asciidoc: Import sys-utils man pages, part 3

This commit is contained in:
Mario Blättermann 2021-03-13 22:33:34 +01:00
parent a09649ca89
commit b9d2ddfbb1
10 changed files with 1202 additions and 0 deletions

104
sys-utils/setarch.8.adoc Normal file
View File

@ -0,0 +1,104 @@
= setarch(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: setarch
== NAME
setarch - change reported architecture in new program environment and/or set personality flags
== SYNOPSIS
*setarch* [_arch_] [_options_] (_program_ [_argument_...]]
*setarch* *--list*|*-h*|*-V*
*arch* [_options_] [_program_ [_argument_...]]
== DESCRIPTION
*setarch* modifies execution domains and process personality flags.
The execution domains currently only affects the output of *uname -m*. For example, on an AMD64 system, running *setarch i386* _program_ will cause _program_ to see i686 instead of _x86_64_ as the machine type. It can also be used to set various personality options. The default _program_ is */bin/sh*.
Since version 2.33 the _arch_ command line argument is optional and *setarch* may be used to change personality flags (ADDR_LIMIT_*, SHORT_INODE, etc) without modification of the execution domain.
== OPTIONS
*--list*::
List the architectures that *setarch* knows about. Whether *setarch* can actually set each of these architectures depends on the running kernel.
*--uname-2.6*::
Causes the _program_ to see a kernel version number beginning with 2.6. Turns on *UNAME26*.
*-v*, *--verbose*::
Be verbose.
*-3*, *--3gb*::
Specifies _program_ should use a maximum of 3GB of address space. Supported on x86. Turns on *ADDR_LIMIT_3GB*.
*--4gb*::
This option has no effect. It is retained for backward compatibility only, and may be removed in future releases.
*-B*, *--32bit*::
Limit the address space to 32 bits to emulate hardware. Supported on ARM and Alpha. Turns on *ADDR_LIMIT_32BIT*.
*-F*, *--fdpic-funcptrs*::
Treat user-space function pointers to signal handlers as pointers to address descriptors. This option has no effect on architectures that do not support *FDPIC* ELF binaries. In kernel v4.14 support is limited to ARM, Blackfin, Fujitsu FR-V, and SuperH CPU architectures.
*-I*, *--short-inode*::
Obsolete bug emulation flag. Turns on *SHORT_INODE*.
*-L*, *--addr-compat-layout*::
Provide legacy virtual address space layout. Use when the _program_ binary does not have *PT_GNU_STACK* ELF header. Turns on *ADDR_COMPAT_LAYOUT*.
*-R*, *--addr-no-randomize*::
Disables randomization of the virtual address space. Turns on *ADDR_NO_RANDOMIZE*.
*-S*, *--whole-seconds*::
Obsolete bug emulation flag. Turns on *WHOLE_SECONDS*.
*-T*, *--sticky-timeouts*::
This makes *select*(2), *pselect*(2), and *ppoll*(2) system calls preserve the timeout value instead of modifying it to reflect the amount of time not slept when interrupted by a signal handler. Use when _program_ depends on this behavior. For more details see the timeout description in *select*(2) manual page. Turns on *STICKY_TIMEOUTS*.
*-X*, *--read-implies-exec*::
If this is set then *mmap*(3p) *PROT_READ* will also add the *PROT_EXEC* bit - as expected by legacy x86 binaries. Notice that the ELF loader will automatically set this bit when it encounters a legacy binary. Turns on *READ_IMPLIES_EXEC*.
*-Z*, *--mmap-page-zero*::
SVr4 bug emulation that will set *mmap*(3p) page zero as read-only. Use when _program_ depends on this behavior, and the source code is not available to be fixed. Turns on *MMAP_PAGE_ZERO*.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== EXAMPLE
....
setarch --addr-no-randomize mytestprog
setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm
setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm
setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm
....
== AUTHORS
mailto:sopwith@redhat.com[Elliot Lee] +
mailto:jnovy@redhat.com[Jindrich Novy] +
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*personality*(2),
*select*(2)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

121
sys-utils/setpriv.1.adoc Normal file
View File

@ -0,0 +1,121 @@
= setpriv(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: setpriv
== NAME
setpriv - run a program with different Linux privilege settings
== SYNOPSIS
*setpriv* [_options_] _program_ [_arguments_]
== DESCRIPTION
Sets or queries various Linux privilege settings that are inherited across *execve*(2).
In comparison to *su*(1) and *runuser*(1), *setpriv* neither uses PAM, nor does it prompt for a password. It is a simple, non-set-user-ID wrapper around *execve*(2), and can be used to drop privileges in the same way as *setuidgid*(8) from *daemontools*, *chpst*(8) from *runit*, or similar tools shipped by other service managers.
== OPTIONS
*--clear-groups*::
Clear supplementary groups.
*-d*, *--dump*::
Dump the current privilege state. This option can be specified more than once to show extra, mostly useless, information. Incompatible with all other options.
*--groups* _group_...::
Set supplementary groups. The argument is a comma-separated list of GIDs or names.
*--inh-caps* (*+*|*-*)_cap_...::
*--ambient-caps* (*+*|*-*)_cap_...::
*--bounding-set* (*+*|*-*)_cap_...::
Set the inheritable capabilities, ambient capabilities or the capability bounding set. See *capabilities*(7). The argument is a comma-separated list of **+**__cap__ and **-**__cap__ entries, which add or remove an entry respectively. _cap_ can either be a human-readable name as seen in *capabilities*(7) without the _cap__ prefix or of the format *cap_N*, where _N_ is the internal capability index used by Linux. *+all* and *-all* can be used to add or remove all caps. +
The set of capabilities starts out as the current inheritable set for *--inh-caps*, the current ambient set for *--ambient-caps* and the current bounding set for *--bounding-set*. +
Note the following restrictions (detailed in *capabilities*(7)) regarding modifications to these capability sets: +
* A capability can be added to the inheritable set only if it is currently present in the bounding set.
* A capability can be added to the ambient set only if it is currently present in both the permitted and inheritable sets.
* Notwithstanding the syntax offered by *setpriv*, the kernel does not permit capabilities to be added to the bounding set. +
If you drop a capability from the bounding set without also dropping it from the inheritable set, you are likely to become confused. Do not do that.
*--keep-groups*::
Preserve supplementary groups. Only useful in conjunction with *--rgid*, *--egid*, or *--regid*.
*--init-groups*::
Initialize supplementary groups using initgroups3. Only useful in conjunction with *--ruid* or *--reuid*.
*--list-caps*::
List all known capabilities. This option must be specified alone.
*--no-new-privs*::
Set the _no_new_privs_ bit. With this bit set, *execve*(2) will not grant new privileges. For example, the set-user-ID and set-group-ID bits as well as file capabilities will be disabled. (Executing binaries with these bits set will still work, but they will not gain privileges. Certain LSMs, especially AppArmor, may result in failures to execute certain programs.) This bit is inherited by child processes and cannot be unset. See *prctl*(2) and _Documentation/prctl/no_new_privs.txt_ in the Linux kernel source. +
The _no_new_privs_ bit is supported since Linux 3.5.
*--rgid* _gid_, *--egid* _gid_, *--regid* _gid_::
Set the real, effective, or both GIDs. The _gid_ argument can be given as a textual group name. +
For safety, you must specify one of *--clear-groups*, *--groups*, *--keep-groups*, or *--init-groups* if you set any primary _gid_.
*--ruid* _uid_, *--euid* _uid_, *--reuid* _uid_::
Set the real, effective, or both UIDs. The _uid_ argument can be given as a textual login name. +
Setting a _uid_ or _gid_ does not change capabilities, although the exec call at the end might change capabilities. This means that, if you are root, you probably want to do something like: +
*setpriv --reuid=1000 --regid=1000 --inh-caps=-all*
*--securebits* (**+**|*-*)__securebit__...::
Set or clear securebits. The argument is a comma-separated list. The valid securebits are _noroot_, _noroot_locked_, _no_setuid_fixup_, _no_setuid_fixup_locked_, and _keep_caps_locked_. _keep_caps_ is cleared by *execve*(2) and is therefore not allowed.
**--pdeathsig keep**|**clear**|*<signal>*::
Keep, clear or set the parent death signal. Some LSMs, most notably SELinux and AppArmor, clear the signal when the process' credentials change. Using *--pdeathsig keep* will restore the parent death signal after changing credentials to remedy that situation.
*--selinux-label* _label_::
Request a particular SELinux transition (using a transition on exec, not dyntrans). This will fail and cause *setpriv* to abort if SELinux is not in use, and the transition may be ignored or cause *execve*(2) to fail at SELinux's whim. (In particular, this is unlikely to work in conjunction with _no_new_privs_.) This is similar to *runcon*(1).
*--apparmor-profile* _profile_::
Request a particular AppArmor profile (using a transition on exec). This will fail and cause *setpriv* to abort if AppArmor is not in use, and the transition may be ignored or cause *execve*(2) to fail at AppArmor's whim.
*--reset-env*::
Clears all the environment variables except *TERM*; initializes the environment variables *HOME*, *SHELL*, *USER*, *LOGNAME* according to the user's passwd entry; sets *PATH* to _/usr/local/bin:/bin:/usr/bin_ for a regular user and to _/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin_ for root. +
The environment variable *PATH* may be different on systems where _/bin_ and _/sbin_ are merged into _/usr_. The environment variable *SHELL* defaults to */bin/sh* if none is given in the user's passwd entry.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== NOTES
If applying any specified option fails, _program_ will not be run and *setpriv* will return with exit status 127.
Be careful with this tool -- it may have unexpected security consequences. For example, setting _no_new_privs_ and then execing a program that is SELinux-confined (as this tool would do) may prevent the SELinux restrictions from taking effect.
== EXAMPLES
If you're looking for behavior similar to *su*(1)/*runuser*(1), or *sudo*(8) (without the *-g* option), try something like:
*setpriv --reuid=1000 --regid=1000 --init-groups*
If you want to mimic daemontools' *setuid*(8), try:
*setpriv --reuid=1000 --regid=1000 --clear-groups*
== AUTHORS
mailto:luto@amacapital.net[Andy Lutomirski]
== SEE ALSO
*runuser*(1),
*su*(1),
*prctl*(2),
*capabilities*(7)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

53
sys-utils/setsid.1.adoc Normal file
View File

@ -0,0 +1,53 @@
// Rick Sladkey <jrs@world.std.com>
// In the public domain.
= setsid(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: setsid
== NAME
setsid - run a program in a new session
== SYNOPSIS
*setsid* [_options_] _program_ [_arguments_]
== DESCRIPTION
*setsid* runs a program in a new session. The command calls *fork*(2) if already a process group leader. Otherwise, it executes a program in the current process. This default behavior is possible to override by the *--fork* option.
== OPTIONS
*-c*, *--ctty*::
Set the controlling terminal to the current one.
*-f*, *--fork*::
Always create a new process.
*-w*, *--wait*::
Wait for the execution of the program to end, and return the exit status of this program as the exit status of *setsid*.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== AUTHORS
mailto:jrs@world.std.com[Rick Sladkey]
== SEE ALSO
*setsid*(2)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

173
sys-utils/swapon.8.adoc Normal file
View File

@ -0,0 +1,173 @@
= swapon(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: swapon
== NAME
swapon, swapoff - enable/disable devices and files for paging and swapping
== SYNOPSIS
*swapon* [_options_] [_specialfile_...]
*swapoff* [*-va*] [_specialfile_...]
== DESCRIPTION
*swapon* is used to specify devices on which paging and swapping are to take place.
The device or file used is given by the _specialfile_ parameter. It may be of the form *-L* _label_ or *-U* _uuid_ to indicate a device by label or uuid.
Calls to *swapon* normally occur in the system boot scripts making all swap devices available, so that the paging and swapping activity is interleaved across several devices and files.
*swapoff* disables swapping on the specified devices and files. When the *-a* flag is given, swapping is disabled on all known swap devices and files (as found in _/proc/swaps_ or _/etc/fstab_).
== OPTIONS
*-a*, *--all*::
All devices marked as "swap" in _/etc/fstab_ are made available, except for those with the "noauto" option. Devices that are already being used as swap are silently skipped.
*-d*, *--discard*[**=**__policy__]::
Enable swap discards, if the swap backing device supports the discard or trim operation. This may improve performance on some Solid State Devices, but often it does not. The option allows one to select between two available swap discard policies:
*--discard=once*::: to perform a single-time discard operation for the whole swap area at swapon; or +
*--discard=pages*::: to asynchronously discard freed swap pages before they are available for reuse. +
If no policy is selected, the default behavior is to enable both discard types. The _/etc/fstab_ mount options *discard*, *discard=once*, or *discard=pages* may also be used to enable discard flags.
*-e*, *--ifexists*::
Silently skip devices that do not exist. The _/etc/fstab_ mount option *nofail* may also be used to skip non-existing device.
*-f*, *--fixpgsz*::
Reinitialize (exec mkswap) the swap space if its page size does not match that of the current running kernel. *mkswap*(8) initializes the whole device and does not check for bad blocks.
*-h*, *--help*::
Display help text and exit.
*-L* _label_::
Use the partition that has the specified _label_. (For this, access to _/proc/partitions_ is needed.)
*-o*, *--options* _opts_::
Specify swap options by an fstab-compatible comma-separated string. For example: +
*swapon -o pri=1,discard=pages,nofail /dev/sda2* +
The _opts_ string is evaluated last and overrides all other command line options.
*-p*, *--priority* _priority_::
Specify the priority of the swap device. _priority_ is a value between -1 and 32767. Higher numbers indicate higher priority. See *swapon*(2) for a full description of swap priorities. Add **pri=**__value__ to the option field of _/etc/fstab_ for use with *swapon -a*. When no priority is defined, it defaults to -1.
*-s*, *--summary*::
Display swap usage summary by device. Equivalent to *cat /proc/swaps*. This output format is DEPRECATED in favour of *--show* that provides better control on output data.
*--show*[**=**__column__...]::
Display a definable table of swap areas. See the *--help* output for a list of available columns.
*--output-all*::
Output all available columns.
*--noheadings*::
Do not print headings when displaying *--show* output.
*--raw*::
Display *--show* output without aligning table columns.
*--bytes*::
Display swap size in bytes in *--show* output instead of in user-friendly units.
*-U* _uuid_::
Use the partition that has the specified _uuid_.
*-v*, *--verbose*::
Be verbose.
*-V*, *--version*::
Display version information and exit.
== EXIT STATUS
*swapoff* has the following exit status values since v2.36:
*0*::
success
*2*::
system has insufficient memory to stop swapping (OOM)
*4*::
swapoff syscall failed for another reason
*8*::
non-swapoff syscall system error (out of memory, ...)
*16*::
usage or syntax error
*32*::
all swapoff failed on *--all*
*64*::
some swapoff succeeded on *--all* +
The command *swapoff --all* returns 0 (all succeeded), 32 (all failed), or 64 (some failed, some succeeded). +
The old versions before v2.36 has no documented exit status, 0 means success in all versions.
== ENVIRONMENT
LIBMOUNT_DEBUG=all::
enables libmount debug output.
LIBBLKID_DEBUG=all::
enables libblkid debug output.
== FILES
_/dev/sd??_ standard paging devices +
_/etc/fstab_ ascii filesystem description table
== NOTES
=== Files with holes
The swap file implementation in the kernel expects to be able to write to the file directly, without the assistance of the filesystem. This is a problem on files with holes or on copy-on-write files on filesystems like Btrfs.
Commands like *cp*(1) or *truncate*(1) create files with holes. These files will be rejected by *swapon*.
Preallocated files created by *fallocate*(1) may be interpreted as files with holes too depending of the filesystem. Preallocated swap files are supported on XFS since Linux 4.18.
The most portable solution to create a swap file is to use *dd*(1) and _/dev/zero_.
=== Btrfs
Swap files on Btrfs are supported since Linux 5.0 on files with nocow attribute. See the *btrfs*(5) manual page for more details.
=== NFS
Swap over *NFS* may not work.
=== Suspend
*swapon* automatically detects and rewrites a swap space signature with old software suspend data (e.g., S1SUSPEND, S2SUSPEND, ...). The problem is that if we don't do it, then we get data corruption the next time an attempt at unsuspending is made.
== HISTORY
The *swapon* command appeared in 4.0BSD.
== SEE ALSO
*swapoff*(2),
*swapon*(2),
*fstab*(5),
*init*(8),
*fallocate*(1),
*mkswap*(8),
*mount*(8),
*rc*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,63 @@
= switch_root(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: switch_root
== NAME
switch_root - switch to another filesystem as the root of the mount tree
== SYNOPSIS
*switch_root* [*-hV*]
*switch_root* _newroot init_ [_arg_...]
== DESCRIPTION
*switch_root* moves already mounted _/proc_, _/dev_, _/sys_ and _/run_ to _newroot_ and makes _newroot_ the new root filesystem and starts _init_ process.
*WARNING: switch_root removes recursively all files and directories on the current root filesystem.*
== OPTIONS
*-h, --help*::
Display help text and exit.
*-V, --version*::
Display version information and exit.
== EXIT STATUS
*switch_root* returns 0 on success and 1 on failure.
== NOTES
*switch_root* will fail to function if _newroot_ is not the root of a mount. If you want to switch root into a directory that does not meet this requirement then you can first use a bind-mounting trick to turn any directory into a mount point:
....
mount --bind $DIR $DIR
....
== AUTHORS
mailto:pjones@redhat.com[Peter Jones] +
mailto:katzj@redhat.com[Jeremy Katz] +
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*chroot*(2),
*init*(8),
*mkinitrd*(8),
*mount*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

72
sys-utils/tunelp.8.adoc Normal file
View File

@ -0,0 +1,72 @@
= tunelp(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: tunelp
== NAME
tunelp - set various parameters for the lp device
== SYNOPSIS
*tunelp* [_options_] _device_
== DESCRIPTION
*tunelp* sets several parameters for the /dev/lp__?__ devices, for better performance (or for any performance at all, if your printer won't work without it...) Without parameters, it tells whether the device is using interrupts, and if so, which one. With parameters, it sets the device characteristics accordingly.
== OPTIONS
*-i*, *--irq* _argument_::
specifies the IRQ to use for the parallel port in question. If this is set to something non-zero, *-t* and *-c* have no effect. If your port does not use interrupts, this option will make printing stop. The command *tunelp -i 0* restores non-interrupt driven (polling) action, and your printer should work again. If your parallel port does support interrupts, interrupt-driven printing should be somewhat faster and efficient, and will probably be desirable. +
NOTE: This option will have no effect with kernel 2.1.131 or later since the irq is handled by the parport driver. You can change the parport irq for example via _/proc/parport/*/irq_. Read _/usr/src/linux/Documentation/admin-guide/parport.rst_ for more details on parport.
*-t*, *--time* _milliseconds_::
is the amount of time in jiffies that the driver waits if the printer doesn't take a character for the number of tries dictated by the *-c* parameter. 10 is the default value. If you want fastest possible printing, and don't care about system load, you may set this to 0. If you don't care how fast your printer goes, or are printing text on a slow printer with a buffer, then 500 (5 seconds) should be fine, and will give you very low system load. This value generally should be lower for printing graphics than text, by a factor of approximately 10, for best performance.
*-c*, *--chars* _characters_::
is the number of times to try to output a character to the printer before sleeping for *-t* _TIME_. It is the number of times around a loop that tries to send a character to the printer. 120 appears to be a good value for most printers in polling mode. 1000 is the default, because there are some printers that become jerky otherwise, but you _must_ set this to `1' to handle the maximal CPU efficiency if you are using interrupts. If you have a very fast printer, a value of 10 might make more sense even if in polling mode. If you have a _really_ old printer, you can increase this further. +
Setting *-t* _TIME_ to 0 is equivalent to setting *-c* _CHARS_ to infinity.
*-w*, *--wait* _milliseconds_::
is the number of usec we wait while playing with the strobe signal. While most printers appear to be able to deal with an extremely short strobe, some printers demand a longer one. Increasing this from the default 1 may make it possible to print with those printers. This may also make it possible to use longer cables. It's also possible to decrease this value to 0 if your printer is fast enough or your machine is slow enough.
*-a*, *--abort* _<on|off>_::
This is whether to abort on printer error - the default is not to. If you are sitting at your computer, you probably want to be able to see an error and fix it, and have the printer go on printing. On the other hand, if you aren't, you might rather that your printer spooler find out that the printer isn't ready, quit trying, and send you mail about it. The choice is yours.
*-o*, *--check-status* _<on|off>_::
This option is much like *-a*. It makes any *open*(2) of this device check to see that the device is on-line and not reporting any out of paper or other errors. This is the correct setting for most versions of *lpd*.
*-C*, *--careful* _<on|off>_::
This option adds extra ("careful") error checking. When this option is on, the printer driver will ensure that the printer is on-line and not reporting any out of paper or other errors before sending data. This is particularly useful for printers that normally appear to accept data when turned off. +
*NOTE*: This option is obsolete because it's the default in 2.1.131 kernel or later.
*-s*, *--status*::
This option returns the current printer status, both as a decimal number from 0..255, and as a list of active flags. When this option is specified, *-q* off, turning off the display of the current IRQ, is implied.
*-r*, *--reset*::
This option resets the port. It requires a Linux kernel version of 1.1.80 or later.
*-q*, *--print-irq* _<on|off>_::
This option sets printing the display of the current IRQ setting.
== FILES
_/dev/lp?_ +
_/proc/parport/*/*_
== NOTES
*-o*, *-C*, and *-s* all require a Linux kernel version of 1.1.76 or later.
*-C* requires a Linux version prior to 2.1.131.
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

186
sys-utils/umount.8.adoc Normal file
View File

@ -0,0 +1,186 @@
////
Copyright (c) 1996 Andries Brouwer
This page is somewhat derived from a page that was
(c) 1980, 1989, 1991 The Regents of the University of California
and had been heavily modified by Rik Faith and myself.
This is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The GNU General Public License's references to "object code"
and "executables" are to be interpreted as the output of any
document formatting or typesetting system, including
intermediate and printed output.
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
= umount(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: umount
== NAME
umount - unmount filesystems
== SYNOPSIS
*umount* *-a* [*-dflnrv*] [*-t* _fstype_] [*-O* _option_...]
*umount* [*-dflnrv*] {_directory_|_device_}
*umount* *-h*|*-V*
== DESCRIPTION
The *umount* command detaches the mentioned filesystem(s) from the file hierarchy. A filesystem is specified by giving the directory where it has been mounted. Giving the special device on which the filesystem lives may also work, but is obsolete, mainly because it will fail in case this device was mounted on more than one directory.
Note that a filesystem cannot be unmounted when it is 'busy' - for example, when there are open files on it, or when some process has its working directory there, or when a swap file on it is in use. The offending process could even be *umount* itself - it opens libc, and libc in its turn may open for example locale files. A lazy unmount avoids this problem, but it may introduce other issues. See *--lazy* description below.
== OPTIONS
*-a*, *--all*::
All of the filesystems described in _/proc/self/mountinfo_ (or in deprecated _/etc/mtab_) are unmounted, except the proc, devfs, devpts, sysfs, rpc_pipefs and nfsd filesystems. This list of the filesystems may be replaced by *--types* umount option.
*-A*, *--all-targets*::
Unmount all mountpoints in the current mount namespace for the specified filesystem. The filesystem can be specified by one of the mountpoints or the device name (or UUID, etc.). When this option is used together with *--recursive*, then all nested mounts within the filesystem are recursively unmounted. This option is only supported on systems where _/etc/mtab_ is a symlink to _/proc/mounts_.
*-c*, *--no-canonicalize*::
Do not canonicalize paths. The paths canonicalization is based on *stat*(2) and *readlink*(2) system calls. These system calls may hang in some cases (for example on NFS if server is not available). The option has to be used with canonical path to the mount point. +
This option is silently ignored by *umount* for non-root users. +
For more details about this option see the *mount*(8) man page. Note that *umount* does not pass this option to the **/sbin/umount.**__type__ helpers.
*-d*, *--detach-loop*::
When the unmounted device was a loop device, also free this loop device. This option is unnecessary for devices initialized by *mount*(8), in this case "autoclear" functionality is enabled by default.
*--fake*::
Causes everything to be done except for the actual system call or umount helper execution; this 'fakes' unmounting the filesystem. It can be used to remove entries from the deprecated _/etc/mtab_ that were unmounted earlier with the *-n* option.
*-f*, *--force*::
Force an unmount (in case of an unreachable NFS system). +
Note that this option does not guarantee that umount command does not hang. It's strongly recommended to use absolute paths without symlinks to avoid unwanted readlink and stat system calls on unreachable NFS in *umount*.
*-i*, *--internal-only*::
Do not call the **/sbin/umount.**__filesystem__ helper even if it exists. By default such a helper program is called if it exists.
*-l*, *--lazy*::
Lazy unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon as it is not busy anymore. +
A system reboot would be expected in near future if you're going to use this option for network filesystem or local filesystem with submounts. The recommended use-case for *umount -l* is to prevent hangs on shutdown due to an unreachable network share where a normal umount will hang due to a downed server or a network partition. Remounts of the share will not be possible.
*-N*, *--namespace* _ns_::
Perform umount in the mount namespace specified by _ns_. _ns_ is either PID of process running in that namespace or special file representing that namespace. +
*umount* switches to the namespace when it reads _/etc/fstab_, writes _/etc/mtab_ (or writes to _/run/mount_) and calls *umount*(2) system call, otherwise it runs in the original namespace. It means that the target mount namespace does not have to contain any libraries or other requirements necessary to execute *umount*(2) command. +
See *mount_namespaces*(7) for more information.
*-n*, *--no-mtab*::
Unmount without writing in _/etc/mtab_.
*-O*, *--test-opts* _option_...::
Unmount only the filesystems that have the specified option set in _/etc/fstab_. More than one option may be specified in a comma-separated list. Each option can be prefixed with *no* to indicate that no action should be taken for this option.
*-q*, *--quiet*::
Suppress "not mounted" error messages.
*-R*, *--recursive*::
Recursively unmount each specified directory. Recursion for each directory will stop if any unmount operation in the chain fails for any reason. The relationship between mountpoints is determined by _/proc/self/mountinfo_ entries. The filesystem must be specified by mountpoint path; a recursive unmount by device name (or UUID) is unsupported.
*-r*, *--read-only*::
When an unmount fails, try to remount the filesystem read-only.
*-t*, *--types* _type_...::
Indicate that the actions should only be taken on filesystems of the specified _type_. More than one type may be specified in a comma-separated list. The list of filesystem types can be prefixed with *no* to indicate that no action should be taken for all of the mentioned types. Note that *umount* reads information about mounted filesystems from kernel (_/proc/mounts_) and filesystem names may be different than filesystem names used in the _/etc/fstab_ (e.g., "nfs4" vs. "nfs").
*-v*, *--verbose*::
Verbose mode.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== NON-SUPERUSER UMOUNTS
Normally, only the superuser can umount filesystems. However, when _fstab_ contains the *user* option on a line, anybody can umount the corresponding filesystem. For more details see *mount*(8) man page.
Since version 2.34 the *umount* command can be used to perform umount operation also for fuse filesystems if kernel mount table contains user's ID. In this case fstab *user=* mount option is not required.
Since version 2.35 *umount* command does not exit when user permissions are inadequate by internal libmount security rules. It drops suid permissions and continue as regular non-root user. This can be used to support use-cases where root permissions are not necessary (e.g., fuse filesystems, user namespaces, etc).
== LOOP DEVICE
The *umount* command will automatically detach loop device previously initialized by *mount*(8) command independently of _/etc/mtab_.
In this case the device is initialized with "autoclear" flag (see *losetup*(8) output for more details), otherwise it's necessary to use the option *--detach-loop* or call *losetup -d <device>*. The autoclear feature is supported since Linux 2.6.25.
== EXTERNAL HELPERS
The syntax of external unmount helpers is:
____
**umount.**__suffix__ {__directory__|_device_} [*-flnrv*] [*-N* _namespace_] [*-t* _type_._subtype_]
____
where _suffix_ is the filesystem type (or the value from a *uhelper=* or *helper=* marker in the mtab file). The *-t* option can be used for filesystems that have subtype support. For example:
____
*umount.fuse -t fuse.sshfs*
____
A **uhelper=**__something__ marker (unprivileged helper) can appear in the _/etc/mtab_ file when ordinary users need to be able to unmount a mountpoint that is not defined in _/etc/fstab_ (for example for a device that was mounted by *udisks*(1)).
A **helper=**__type__ marker in the mtab file will redirect all unmount requests to the **/sbin/umount.**__type__ helper independently of UID.
Note that _/etc/mtab_ is currently deprecated and *helper=* and other userspace mount options are maintained by libmount.
== ENVIRONMENT
LIBMOUNT_FSTAB=<path>::
overrides the default location of the fstab file (ignored for suid)
LIBMOUNT_MTAB=<path>::
overrides the default location of the mtab file (ignored for suid)
LIBMOUNT_DEBUG=all::
enables libmount debug output
== FILES
_/etc/mtab_::
table of mounted filesystems (deprecated and usually replaced by symlink to _/proc/mounts_)
_/etc/fstab_::
table of known filesystems
_/proc/self/mountinfo_::
table of mounted filesystems generated by kernel.
== HISTORY
A *umount* command appeared in Version 6 AT&T UNIX.
== SEE ALSO
*umount*(2),
*losetup*(8),
*mount_namespaces*(7),
*mount*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

245
sys-utils/unshare.1.adoc Normal file
View File

@ -0,0 +1,245 @@
= unshare(1)
:doctype: manpage
:man manual: User commands
:man source: util-linux {release-version}
:page-layout: base
:command: unshare
== NAME
unshare - run program in new namespaces
== SYNOPSIS
*unshare* [_options_] [_program_ [_arguments_]
== DESCRIPTION
The *unshare* command creates new namespaces (as specified by the command-line options described below) and then executes the specified _program_. If _program_ is not given, then "${SHELL}" is run (default: _/bin/sh_).
By default, a new namespace persists only as long as it has member processes. A new namespace can be made persistent even when it has no member processes by bind mounting /proc/_pid_/ns/_type_ files to a filesystem path. A namespace that has been made persistent in this way can subsequently be entered with *­nsenter*(1) even after the _program_ terminates (except PID namespaces where a permanently running init process is required). Once a persistent ­namespace is no longer needed, it can be unpersisted by using *umount*(8) to remove the bind mount. See the EXAMPLES section for more details.
*unshare* since util-linux version 2.36 uses _/proc/[pid]/ns/pid_for_children_ and _/proc/[pid]/ns/time_for_children_ files for persistent PID and TIME namespaces. This change requires Linux kernel 4.17 or newer.
The following types of namespaces can be created with *unshare*:
*mount namespace*::
Mounting and unmounting filesystems will not affect the rest of the system, except for filesystems which are explicitly marked as shared (with *mount --make-shared*; see _/proc/self/mountinfo_ or *findmnt -o+PROPAGATION* for the *shared* flags). For further details, see *mount_namespaces*(7). +
*unshare* since util-linux version 2.27 automatically sets propagation to *private* in a new mount namespace to make sure that the new namespace is really unshared. It's possible to disable this feature with option *--propagation unchanged*. Note that *private* is the kernel default.
*UTS namespace*::
Setting hostname or domainname will not affect the rest of the system. For further details, see *uts_namespaces*(7).
*IPC namespace*::
The process will have an independent namespace for POSIX message queues as well as System V ­message queues, semaphore sets and shared memory segments. For further details, see *ipc_namespaces*(7).
*network namespace*::
The process will have independent IPv4 and IPv6 stacks, IP routing tables, firewall rules, the _/proc/net_ and _/sys/class/net_ directory trees, sockets, etc. For further details, see *network_namespaces*(7).
*PID namespace*::
Children will have a distinct set of PID-to-process mappings from their parent. For further details, see *pid_namespaces*(7).
*cgroup namespace*::
The process will have a virtualized view of _/proc/self/cgroup_, and new cgroup mounts will be rooted at the namespace cgroup root. For further details, see *cgroup_namespaces*(7).
*user namespace*::
The process will have a distinct set of UIDs, GIDs and capabilities. For further details, see *user_namespaces*(7).
*time namespace*::
The process can have a distinct view of *CLOCK_MONOTONIC* and/or *CLOCK_BOOTTIME* which can be changed using _/proc/self/timens_offsets_. For further details, see *time_namespaces*(7).
== OPTIONS
*-i*, *--ipc*[**=**__file__]::
Unshare the IPC namespace. If _file_ is specified, then a persistent namespace is created by a bind mount.
*-m*, *--mount*[**=**__file__]::
Unshare the mount namespace. If _file_ is specified, then a persistent namespace is created by a bind mount. Note that _file_ must be located on a mount whose propagation type is not *shared* (or an error results). Use the command *findmnt -o+PROPAGATION* when not sure about the current setting. See also the examples below.
*-n*, *--net*[**=**__file__]::
Unshare the network namespace. If _file_ is specified, then a persistent namespace is created by a bind mount.
*-p*, *--pid*[**=**__file__]::
Unshare the PID namespace. If _file_ is specified, then a persistent namespace is created by a bind mount. (Creation of a persistent PID namespace will fail if the *--fork* option is not also specified.) +
See also the *--fork* and *--mount-proc* options.
*-u*, *--uts*[**=**__file__]::
Unshare the UTS namespace. If _file_ is specified, then a persistent namespace is created by a bind mount.
*-U*, *--user*[**=**__file__]::
Unshare the user namespace. If _file_ is specified, then a persistent namespace is created by a bind mount.
*-C*, *--cgroup*[**=**__file__]::
Unshare the cgroup namespace. If _file_ is specified, then persistent namespace is created by bind mount.
*-T*, *--time*[**=**__file__]::
Unshare the time namespace. If _file_ is specified, then a persistent namespace is created by a bind mount. The *--monotonic* and *--boottime* options can be used to specify the corresponding offset in the time namespace.
*-f*, *--fork*::
Fork the specified _program_ as a child process of *unshare* rather than running it directly. This is useful when creating a new PID namespace. Note that when *unshare* is waiting for the child process, then it ignores *SIGINT* and *SIGTERM* and does not forward any signals to the child. It is necessary to send signals to the child process.
*--keep-caps*::
When the *--user* option is given, ensure that capabilities granted in the user namespace are preserved in the child process.
*--kill-child*[**=**__signame__]::
When *unshare* terminates, have _signame_ be sent to the forked child process. Combined with *--pid* this allows for an easy and reliable killing of the entire process tree below *unshare*. If not given, _signame_ defaults to *SIGKILL*. This option implies *--fork*.
*--mount-proc*[**=**__mountpoint__]::
Just before running the program, mount the proc filesystem at _mountpoint_ (default is _/proc_). This is useful when creating a new PID namespace. It also implies creating a new mount namespace since the _/proc_ mount would otherwise mess up existing programs on the system. The new proc filesystem is explicitly mounted as private (with *MS_PRIVATE*|*MS_REC*).
**--map-user=**__uid|name__::
Run the program only after the current effective user ID has been mapped to _uid_. If this option is specified multiple times, the last occurrence takes precedence. This option implies *--user*.
**--map-group=**__gid|name__::
Run the program only after the current effective group ID has been mapped to _gid_. If this option is specified multiple times, the last occurrence takes precedence. This option implies *--setgroups=deny* and *--user*.
*-r*, *--map-root-user*::
Run the program only after the current effective user and group IDs have been mapped to the superuser UID and GID in the newly created user namespace. This makes it possible to conveniently gain capabilities needed to manage various aspects of the newly created namespaces (such as configuring interfaces in the network namespace or mounting filesystems in the mount namespace) even when run unprivileged. As a mere convenience feature, it does not support more sophisticated use cases, such as mapping multiple ranges of UIDs and GIDs. This option implies *--setgroups=deny* and *--user*. This option is equivalent to *--map-user=0 --map-group=0*.
*-c*, *--map-current-user*::
Run the program only after the current effective user and group IDs have been mapped to the same UID and GID in the newly created user namespace. This option implies *--setgroups=deny* and *--user*. This option is equivalent to *--map-user=$(id -ru) --map-group=$(id -rg)*.
**--propagation private**|**shared**|**slave**|*unchanged*::
Recursively set the mount propagation flag in the new mount namespace. The default is to set the propagation to _private_. It is possible to disable this feature with the argument *unchanged*. The option is silently ignored when the mount namespace (*--mount*) is not requested.
**--setgroups allow**|*deny*::
Allow or deny the *setgroups*(2) system call in a user namespace. +
To be able to call *setgroups*(2), the calling process must at least have *CAP_SETGID*. But since Linux 3.19 a further restriction applies: the kernel gives permission to call ­*setgroups*(2) only after the GID map (**/proc/**__pid__*/gid_map*) has been set. The GID map is writable by root when ­*setgroups*(2) is enabled (i.e., *allow*, the default), and the GID map becomes writable by unprivileged processes when ­*setgroups*(2) is permanently disabled (with *deny*).
*-R*, **--root=**__dir__::
run the command with root directory set to _dir_.
*-w*, **--wd=**__dir__::
change working directory to _dir_.
*-S*, *--setuid* _uid_::
Set the user ID which will be used in the entered namespace.
*-G*, *--setgid* _gid_::
Set the group ID which will be used in the entered namespace and drop supplementary groups.
*--monotonic* _offset_::
Set the offset of *CLOCK_MONOTONIC* which will be used in the entered time namespace. This option requires unsharing a time namespace with *--time*.
*--boottime* _offset_::
Set the offset of *CLOCK_BOOTTIME* which will be used in the entered time namespace. This option requires unsharing a time namespace with *--time*.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== NOTES
The proc and sysfs filesystems mounting as root in a user namespace have to be restricted so that a less privileged user can not get more access to sensitive files that a more privileged user made unavailable. In short the rule for proc and sysfs is as close to a bind mount as possible.
== EXAMPLES
The following command creates a PID namespace, using *--fork* to ensure that the executed command is performed in a child process that (being the first process in the namespace) has PID 1. The *--mount-proc* option ensures that a new mount namespace is also simultaneously created and that a new *proc*(5) filesystem is mounted that contains information corresponding to the new PID namespace. When the *readlink* command terminates, the new namespaces are automatically torn down.
....
# unshare --fork --pid --mount-proc readlink /proc/self
1
....
As an unprivileged user, create a new user namespace where the user's credentials are mapped to the root IDs inside the namespace:
....
$ id -u; id -g
1000
1000
$ unshare --user --map-root-user \
sh -c ''whoami; cat /proc/self/uid_map /proc/self/gid_map''
root
0 1000 1
0 1000 1
....
The first of the following commands creates a new persistent UTS namespace and modifies the hostname as seen in that namespace. The namespace is then entered with *nsenter*(1) in order to display the modified hostname; this step demonstrates that the UTS namespace continues to exist even though the namespace had no member processes after the *unshare* command terminated. The namespace is then destroyed by removing the bind mount.
....
# touch /root/uts-ns
# unshare --uts=/root/uts-ns hostname FOO
# nsenter --uts=/root/uts-ns hostname
FOO
# umount /root/uts-ns
....
The following commands establish a persistent mount namespace referenced by the bind mount _/root/namespaces/mnt_. In order to ensure that the creation of that bind mount succeeds, the parent directory (_/root/namespaces_) is made a bind mount whose propagation type is not *shared*.
....
# mount --bind /root/namespaces /root/namespaces
# mount --make-private /root/namespaces
# touch /root/namespaces/mnt
# unshare --mount=/root/namespaces/mnt
....
The following commands demonstrate the use of the *--kill-child* option when creating a PID namespace, in order to ensure that when *unshare* is killed, all of the processes within the PID namespace are killed.
....
# set +m # Don't print job status messages
# unshare --pid --fork --mount-proc --kill-child -- \
bash --norc -c ''(sleep 555 &) && (ps a &) && sleep 999'' &
[1] 53456
# PID TTY STAT TIME COMMAND
1 pts/3 S+ 0:00 sleep 999
3 pts/3 S+ 0:00 sleep 555
5 pts/3 R+ 0:00 ps a
# ps h -o 'comm' $! # Show that background job is unshare(1)
unshare
# kill $! # Kill unshare(1)
# pidof sleep
....
The *pidof*(1) command prints no output, because the *sleep* processes have been killed. More precisely, when the *sleep* process that has PID 1 in the namespace (i.e., the namespace's init process) was killed, this caused all other processes in the namespace to be killed. By contrast, a similar series of commands where the *--kill-child* option is not used shows that when *unshare* terminates, the processes in the PID namespace are not killed:
....
# unshare --pid --fork --mount-proc -- \
bash --norc -c ''(sleep 555 &) && (ps a &) && sleep 999'' &
[1] 53479
# PID TTY STAT TIME COMMAND
1 pts/3 S+ 0:00 sleep 999
3 pts/3 S+ 0:00 sleep 555
5 pts/3 R+ 0:00 ps a
# kill $!
# pidof sleep
53482 53480
....
The following example demonstrates the creation of a time namespace where the boottime clock is set to a point several years in the past:
....
# uptime -p # Show uptime in initial time namespace
up 21 hours, 30 minutes
# unshare --time --fork --boottime 300000000 uptime -p
up 9 years, 28 weeks, 1 day, 2 hours, 50 minutes
....
== AUTHORS
mailto:dottedmag@dottedmag.net[Mikhail Gusarov] +
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*clone*(2),
*unshare*(2),
*namespaces*(7),
*mount*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

73
sys-utils/wdctl.8.adoc Normal file
View File

@ -0,0 +1,73 @@
= wdctl(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: wdctl
== NAME
wdctl - show hardware watchdog status
== SYNOPSIS
*wdctl* [_options_] [_device_...]
== DESCRIPTION
Show hardware watchdog status. The default device is _/dev/watchdog_. If more than one device is specified then the output is separated by one blank line.
If the device is already used or user has no permissions to read from the device, then *wdctl* reads data from sysfs. In this case information about supported features (flags) might be missing.
Note that the number of supported watchdog features is hardware specific.
== OPTIONS
*-f*, *--flags* _list_::
Print only the specified flags.
*-F*, *--noflags*::
Do not print information about flags.
*-I*, *--noident*::
Do not print watchdog identity information.
*-n*, *--noheadings*::
Do not print a header line for flags table.
*-o*, *--output* _list_::
Define the output columns to use in table of watchdog flags. If no output arrangement is specified, then a default set is used. Use *--help* to get list of all supported columns.
*-O*, *--oneline*::
Print all wanted information on one line in key="value" output format.
*-r*, *--raw*::
Use the raw output format.
*-s*, *-settimeout* _seconds_::
Set the watchdog timeout in seconds.
*-T*, *--notimeouts*::
Do not print watchdog timeouts.
*-x*, *--flags-only*::
Same as *-I -T*.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== AUTHORS
mailto:kzak@redhat.com[Karel Zak] +
mailto:lennart@poettering.net[Lennart Poettering]
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

112
sys-utils/zramctl.8.adoc Normal file
View File

@ -0,0 +1,112 @@
= zramctl(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: zramctl
== NAME
zramctl - set up and control zram devices
== SYNOPSIS
Get info: ::
*zramctl* [_options_]
Reset zram: ::
*zramctl* *-r* _zramdev_...
Print name of first unused zram device: ::
*zramctl* *-f*
Set up a zram device: ::
*zramctl* [*-f* | _zramdev_] [*-s* _size_] [*-t* _number_] [*-a* _algorithm_]
== DESCRIPTION
*zramctl* is used to quickly set up zram device parameters, to reset zram devices, and to query the status of used zram devices.
If no option is given, all non-zero size zram devices are shown.
Note that _zramdev_ node specified on command line has to already exist. The command *zramctl* creates a new _/dev/zram<N>_ nodes only when *--find* option specified. It's possible (and common) that after system boot _/dev/zram<N>_ nodes are not created yet.
== OPTIONS
*-a*, **--algorithm lzo**|**lz4**|**lz4hc**|**deflate**|*842*::
Set the compression algorithm to be used for compressing data in the zram device.
*-f*, *--find*::
Find the first unused zram device. If a *--size* argument is present, then initialize the device.
*-n*, *--noheadings*::
Do not print a header line in status output.
*-o*, *--output* _list_::
Define the status output columns to be used. If no output arrangement is specified, then a default set is used. Use *--help* to get a list of all supported columns.
*--output-all*::
Output all available columns.
*--raw*::
Use the raw format for status output.
*-r*, *--reset*::
Reset the options of the specified zram device(s). Zram device settings can be changed only after a reset.
*-s*, *--size* _size_::
Create a zram device of the specified _size_. Zram devices are aligned to memory pages; when the requested _size_ is not a multiple of the page size, it will be rounded up to the next multiple. When not otherwise specified, the unit of the _size_ parameter is bytes. +
The _size_ argument 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.
*-t*, *--streams* _number_::
Set the maximum number of compression streams that can be used for the device. The default is one stream.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== EXIT STATUS
*zramctl* returns 0 on success, nonzero on failure.
== FILES
_/dev/zram[0..N]_::
zram block devices
== EXAMPLE
The following commands set up a zram device with a size of one gigabyte and use it as swap device.
....
# zramctl --find --size 1024M
/dev/zram0
# mkswap /dev/zram0
# swapon /dev/zram0
...
# swapoff /dev/zram0
# zramctl --reset /dev/zram0
....
== AUTHORS
mailto:nefelim4ag@gmail.com[Timofey Titovets] +
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
link:http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/blockdev/zram.rst[Linux kernel documentation]
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]