man-pages/man8/zramctl.8.html
2021-03-31 01:06:50 +01:00

218 lines
5.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of ZRAMCTL</TITLE>
</HEAD><BODY>
<H1>ZRAMCTL</H1>
Section: System Administration (8)<BR>Updated: July 2014<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
zramctl - set up and control zram devices
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
Get info:
<P>
<B>zramctl</B> [options]
<P>
Reset zram:
<P>
<B>zramctl -r</B>
<I>zramdev</I>...
<P>
Print name of first unused zram device:
<P>
<B>zramctl -f</B>
<P>
Set up a zram device:
<P>
<B>zramctl</B>
[<B>-f</B> | <I>zramdev</I><B>]</B>
[<B>-s</B>
<I>size</I>]
[<B>-t</B>
<I>number</I>]
[<B>-a</B>
<I>algorithm</I>]
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>zramctl</B>
is used to quickly set up zram device parameters, to reset zram devices, and to
query the status of used zram devices.
<P>
If no option is given, all non-zero size zram devices are shown.
<P>
Note that <I>zramdev</I> node specified on command line has to already exist. The command
<B>zramctl</B>
creates a new /dev/zram&lt;N&gt; nodes only when <B>--find</B> option specified. It's possible
(and common) that after system boot /dev/zram&lt;N&gt; nodes are not created yet.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-a</B>,<B> --algorithm lzo</B>|<B>lz4</B>|<B>lz4hc</B>|<B>deflate</B>|<B>842</B>
<DD>
Set the compression algorithm to be used for compressing data in the zram device.
<DT id="2"><B>-f</B>,<B> --find</B>
<DD>
Find the first unused zram device. If a <B>--size</B> argument is present, then
initialize the device.
<DT id="3"><B>-n</B>,<B> --noheadings</B>
<DD>
Do not print a header line in status output.
<DT id="4"><B>-o</B>,<B> --output </B><I>list</I>
<DD>
Define the status output columns to be used. If no output arrangement is
specified, then a default set is used.
Use <B>--help</B> to get a list of all supported columns.
<DT id="5"><B>--output-all</B>
<DD>
Output all available columns.
<DT id="6"><B>--raw</B>
<DD>
Use the raw format for status output.
<DT id="7"><B>-r</B>,<B> --reset</B>
<DD>
Reset the options of the specified zram device(s). Zram device settings
can be changed only after a reset.
<DT id="8"><B>-s</B>,<B> --size </B><I>size</I>
<DD>
Create a zram device of the specified <I>size</I>.
Zram devices are aligned to memory pages; when the requested <I>size</I> 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 <I>size</I> parameter is bytes.
<DT id="9"><DD>
The <I>size</I> 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 &quot;iB&quot;
is optional, e.g., &quot;K&quot; has the same meaning as &quot;KiB&quot;) or the suffixes
KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
<DT id="10"><B>-t</B>,<B> --streams </B><I>number</I>
<DD>
Set the maximum number of compression streams that can be used for the device.
The default is one stream.
<DT id="11"><B>-V</B>,<B> --version</B>
<DD>
Display version information and exit.
<DT id="12"><B>-h</B>,<B> --help</B>
<DD>
Display help text and exit.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>RETURN VALUE</H2>
<B>zramctl</B>
returns 0 on success, nonzero on failure.
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="13"><I>/dev/zram[0..N]</I>
<DD>
zram block devices
<P>
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>EXAMPLE</H2>
The following commands set up a zram device with a size of one gigabyte
and use it as swap device.
<PRE>
<DL COMPACT>
<DT id="14"><DD># zramctl --find --size 1024M
/dev/zram0
# mkswap /dev/zram0
# swapon /dev/zram0
...
# swapoff /dev/zram0
# zramctl --reset /dev/zram0
</PRE>
</DL>
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
Linux kernel documentation
<A NAME="lbAJ">&nbsp;</A>
<H2>AUTHORS</H2>
<PRE>
Timofey Titovets &lt;<A HREF="mailto:nefelim4ag@gmail.com">nefelim4ag@gmail.com</A>&gt;
Karel Zak &lt;<A HREF="mailto:kzak@redhat.com">kzak@redhat.com</A>&gt;
</PRE>
<A NAME="lbAK">&nbsp;</A>
<H2>AVAILABILITY</H2>
The zramctl command is part of the util-linux package and is available from
<A HREF="https://www.kernel.org/pub/linux/utils/util-linux/.">https://www.kernel.org/pub/linux/utils/util-linux/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="15"><A HREF="#lbAB">NAME</A><DD>
<DT id="16"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="17"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="18"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="19"><A HREF="#lbAF">RETURN VALUE</A><DD>
<DT id="20"><A HREF="#lbAG">FILES</A><DD>
<DT id="21"><A HREF="#lbAH">EXAMPLE</A><DD>
<DT id="22"><A HREF="#lbAI">SEE ALSO</A><DD>
<DT id="23"><A HREF="#lbAJ">AUTHORS</A><DD>
<DT id="24"><A HREF="#lbAK">AVAILABILITY</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:19 GMT, March 31, 2021
</BODY>
</HTML>