{
    "mode": "man",
    "parameter": "zramctl",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/zramctl/8/json",
    "generated": "2026-06-16T10:26:30Z",
    "synopsis": "Get info:\nzramctl [options]\nReset zram:\nzramctl -r zramdev...\nPrint name of first unused zram device:\nzramctl -f\nSet up a zram device:\nzramctl [-f | zramdev] [-s size] [-t number] [-a algorithm]",
    "sections": {
        "NAME": {
            "content": "zramctl - set up and control zram devices\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "Get info:\nzramctl [options]\n\nReset zram:\nzramctl -r zramdev...\n\nPrint name of first unused zram device:\nzramctl -f\n\nSet up a zram device:\nzramctl [-f | zramdev] [-s size] [-t number] [-a algorithm]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "zramctl is used to quickly set up zram device parameters, to reset zram devices, and to query\nthe status of used zram devices.\n\nIf no option is given, all non-zero size zram devices are shown.\n\nNote that zramdev node specified on command line has to already exist. The command zramctl\ncreates a new /dev/zram<N> nodes only when --find option specified. It’s possible (and\ncommon) that after system boot /dev/zram<N> nodes are not created yet.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a --algorithm",
                    "content": "Set the compression algorithm to be used for compressing data in the zram device.\n",
                    "flag": "-a",
                    "long": "--algorithm"
                },
                {
                    "name": "-f --find",
                    "content": "Find the first unused zram device. If a --size argument is present, then initialize the\ndevice.\n",
                    "flag": "-f",
                    "long": "--find"
                },
                {
                    "name": "-n --noheadings",
                    "content": "Do not print a header line in status output.\n",
                    "flag": "-n",
                    "long": "--noheadings"
                },
                {
                    "name": "-o --output",
                    "content": "Define the status output columns to be used. If no output arrangement is specified, then\na default set is used. Use --help to get a list of all supported columns.\n",
                    "flag": "-o",
                    "long": "--output"
                },
                {
                    "name": "--output-all",
                    "content": "Output all available columns.\n",
                    "long": "--output-all"
                },
                {
                    "name": "--raw",
                    "content": "Use the raw format for status output.\n",
                    "long": "--raw"
                },
                {
                    "name": "-r --reset",
                    "content": "Reset the options of the specified zram device(s). Zram device settings can be changed\nonly after a reset.\n",
                    "flag": "-r",
                    "long": "--reset"
                },
                {
                    "name": "-s --size",
                    "content": "Create a zram device of the specified size. Zram devices are aligned to memory pages;\nwhen the requested size is not a multiple of the page size, it will be rounded up to the\nnext multiple. When not otherwise specified, the unit of the size parameter is bytes.\n\nThe size argument may be followed by the multiplicative suffixes KiB (=1024), MiB\n(=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the \"iB\" is optional, e.g.,\n\"K\" has the same meaning as \"KiB\") or the suffixes KB (=1000), MB (=1000*1000), and so on\nfor GB, TB, PB, EB, ZB and YB.\n",
                    "flag": "-s",
                    "long": "--size"
                },
                {
                    "name": "-t --streams",
                    "content": "Set the maximum number of compression streams that can be used for the device. The\ndefault is use all CPUs and one stream for kernels older than 4.6.\n",
                    "flag": "-t",
                    "long": "--streams"
                },
                {
                    "name": "-V --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "zramctl returns 0 on success, nonzero on failure.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/dev/zram[0..N]\nzram block devices\n",
            "subsections": []
        },
        "EXAMPLE": {
            "content": "The following commands set up a zram device with a size of one gigabyte and use it as swap\ndevice.\n\n# zramctl --find --size 1024M\n/dev/zram0\n# mkswap /dev/zram0\n# swapon /dev/zram0\n...\n# swapoff /dev/zram0\n# zramctl --reset /dev/zram0\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Timofey Titovets <nefelim4ag@gmail.com>, Karel Zak <kzak@redhat.com>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Linux kernel documentation\n<http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/blockdev/zram.rst>\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The zramctl command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                   ZRAMCTL(8)",
            "subsections": []
        }
    },
    "summary": "zramctl - set up and control zram devices",
    "flags": [
        {
            "flag": "-a",
            "long": "--algorithm",
            "arg": null,
            "description": "Set the compression algorithm to be used for compressing data in the zram device."
        },
        {
            "flag": "-f",
            "long": "--find",
            "arg": null,
            "description": "Find the first unused zram device. If a --size argument is present, then initialize the device."
        },
        {
            "flag": "-n",
            "long": "--noheadings",
            "arg": null,
            "description": "Do not print a header line in status output."
        },
        {
            "flag": "-o",
            "long": "--output",
            "arg": null,
            "description": "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."
        },
        {
            "flag": "",
            "long": "--output-all",
            "arg": null,
            "description": "Output all available columns."
        },
        {
            "flag": "",
            "long": "--raw",
            "arg": null,
            "description": "Use the raw format for status output."
        },
        {
            "flag": "-r",
            "long": "--reset",
            "arg": null,
            "description": "Reset the options of the specified zram device(s). Zram device settings can be changed only after a reset."
        },
        {
            "flag": "-s",
            "long": "--size",
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-t",
            "long": "--streams",
            "arg": null,
            "description": "Set the maximum number of compression streams that can be used for the device. The default is use all CPUs and one stream for kernels older than 4.6."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        }
    ],
    "examples": [
        "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"
    ],
    "see_also": []
}