{
    "mode": "man",
    "parameter": "lsblk",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/lsblk/8/json",
    "generated": "2026-06-13T23:46:11Z",
    "synopsis": "lsblk [options] [device...]",
    "sections": {
        "NAME": {
            "content": "lsblk - list block devices\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "lsblk [options] [device...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "lsblk lists information about all available or the specified block devices. The lsblk command\nreads the sysfs filesystem and udev db to gather information. If the udev db is not available\nor lsblk is compiled without udev support, then it tries to read LABELs, UUIDs and filesystem\ntypes from the block device. In this case root permissions are necessary.\n\nThe command prints all block devices (except RAM disks) in a tree-like format by default. Use\nlsblk --help to get a list of all available columns.\n\nThe default output, as well as the default output from options like --fs and --topology, is\nsubject to change. So whenever possible, you should avoid using default outputs in your\nscripts. Always explicitly define expected columns by using --output columns-list and --list\nin environments where a stable output is required.\n\nNote that lsblk might be executed in time when udev does not have all information about\nrecently added or modified devices yet. In this case it is recommended to use udevadm settle\nbefore lsblk to synchronize with udev.\n\nThe relationship between block devices and filesystems is not always one-to-one. The\nfilesystem may use more block devices, or the same filesystem may be accessible by more\npaths. This is the reason why lsblk provides MOUNTPOINT and MOUNTPOINTS (pl.) columns. The\ncolumn MOUNTPOINT displays only one mount point (usually the last mounted instance of the\nfilesystem), and the column MOUNTPOINTS displays by multi-line cell all mount points\nassociated with the device.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a --all",
                    "content": "Also list empty devices and RAM disk devices.\n",
                    "flag": "-a",
                    "long": "--all"
                },
                {
                    "name": "-b --bytes",
                    "content": "Print the SIZE column in bytes rather than in a human-readable format.\n",
                    "flag": "-b",
                    "long": "--bytes"
                },
                {
                    "name": "-D --discard",
                    "content": "Print information about the discarding capabilities (TRIM, UNMAP) for each device.\n",
                    "flag": "-D",
                    "long": "--discard"
                },
                {
                    "name": "-d --nodeps",
                    "content": "Do not print holder devices or slaves. For example, lsblk --nodeps /dev/sda prints\ninformation about the sda device only.\n",
                    "flag": "-d",
                    "long": "--nodeps"
                },
                {
                    "name": "-E --dedup",
                    "content": "Use column as a de-duplication key to de-duplicate output tree. If the key is not\navailable for the device, or the device is a partition and parental whole-disk device\nprovides the same key than the device is always printed.\n\nThe usual use case is to de-duplicate output on system multi-path devices, for example by\n-E WWN.\n",
                    "flag": "-E",
                    "long": "--dedup"
                },
                {
                    "name": "-e --exclude",
                    "content": "Exclude the devices specified by the comma-separated list of major device numbers. Note\nthat RAM disks (major=1) are excluded by default if --all is not specified. The filter is\napplied to the top-level devices only. This may be confusing for --list output format\nwhere hierarchy of the devices is not obvious.\n",
                    "flag": "-e",
                    "long": "--exclude"
                },
                {
                    "name": "-f --fs",
                    "content": "Output info about filesystems. This option is equivalent to -o\nNAME,FSTYPE,FSVER,LABEL,UUID,FSAVAIL,FSUSE%,MOUNTPOINTS. The authoritative information\nabout filesystems and raids is provided by the blkid(8) command.\n",
                    "flag": "-f",
                    "long": "--fs"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-I --include",
                    "content": "Include devices specified by the comma-separated list of major device numbers. The filter\nis applied to the top-level devices only. This may be confusing for --list output format\nwhere hierarchy of the devices is not obvious.\n",
                    "flag": "-I",
                    "long": "--include"
                },
                {
                    "name": "-i --ascii",
                    "content": "Use ASCII characters for tree formatting.\n",
                    "flag": "-i",
                    "long": "--ascii"
                },
                {
                    "name": "-J --json",
                    "content": "Use JSON output format. It’s strongly recommended to use --output and also --tree if\nnecessary.\n",
                    "flag": "-J",
                    "long": "--json"
                },
                {
                    "name": "-l --list",
                    "content": "Produce output in the form of a list. The output does not provide information about\nrelationships between devices and since version 2.34 every device is printed only once if\n--pairs or --raw not specified (the parsable outputs are maintained in backwardly\ncompatible way).\n",
                    "flag": "-l",
                    "long": "--list"
                },
                {
                    "name": "-M --merge",
                    "content": "Group parents of sub-trees to provide more readable output for RAIDs and Multi-path\ndevices. The tree-like output is required.\n",
                    "flag": "-M",
                    "long": "--merge"
                },
                {
                    "name": "-m --perms",
                    "content": "Output info about device owner, group and mode. This option is equivalent to -o\nNAME,SIZE,OWNER,GROUP,MODE.\n",
                    "flag": "-m",
                    "long": "--perms"
                },
                {
                    "name": "-n --noheadings",
                    "content": "Do not print a header line.\n",
                    "flag": "-n",
                    "long": "--noheadings"
                },
                {
                    "name": "-o --output",
                    "content": "Specify which output columns to print. Use --help to get a list of all supported columns.\nThe columns may affect tree-like output. The default is to use tree for the column 'NAME'\n(see also --tree).\n\nThe default list of columns may be extended if list is specified in the format +list\n(e.g., lsblk -o +UUID).\n",
                    "flag": "-o",
                    "long": "--output"
                },
                {
                    "name": "-O --output-all",
                    "content": "Output all available columns.\n",
                    "flag": "-O",
                    "long": "--output-all"
                },
                {
                    "name": "-P --pairs",
                    "content": "Produce output in the form of key=\"value\" pairs. The output lines are still ordered by\ndependencies. All potentially unsafe value characters are hex-escaped (\\x<code>).\n",
                    "flag": "-P",
                    "long": "--pairs"
                },
                {
                    "name": "-p --paths",
                    "content": "Print full device paths.\n",
                    "flag": "-p",
                    "long": "--paths"
                },
                {
                    "name": "-r --raw",
                    "content": "Produce output in raw format. The output lines are still ordered by dependencies. All\npotentially unsafe characters are hex-escaped (\\x<code>) in the NAME, KNAME, LABEL,\nPARTLABEL and MOUNTPOINT columns.\n",
                    "flag": "-r",
                    "long": "--raw"
                },
                {
                    "name": "-S --scsi",
                    "content": "Output info about SCSI devices only. All partitions, slaves and holder devices are\nignored.\n",
                    "flag": "-S",
                    "long": "--scsi"
                },
                {
                    "name": "-s --inverse",
                    "content": "Print dependencies in inverse order. If the --list output is requested then the lines are\nstill ordered by dependencies.\n",
                    "flag": "-s",
                    "long": "--inverse"
                },
                {
                    "name": "-T --tree",
                    "content": "Force tree-like output format. If column is specified, then a tree is printed in the\ncolumn. The default is NAME column.\n",
                    "flag": "-T",
                    "long": "--tree"
                },
                {
                    "name": "-t --topology",
                    "content": "Output info about block-device topology. This option is equivalent to\n\n-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,RA,WSAME.\n",
                    "flag": "-t",
                    "long": "--topology"
                },
                {
                    "name": "-V --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-w --width",
                    "content": "Specifies output width as a number of characters. The default is the number of the\nterminal columns, and if not executed on a terminal, then output width is not restricted\nat all by default. This option also forces lsblk to assume that terminal control\ncharacters and unsafe characters are not allowed. The expected use-case is for example\nwhen lsblk is used by the watch(1) command.\n",
                    "flag": "-w",
                    "long": "--width"
                },
                {
                    "name": "-x --sort",
                    "content": "Sort output lines by column. This option enables --list output format by default. It is\npossible to use the option --tree to force tree-like output and than the tree branches\nare sorted by the column.\n",
                    "flag": "-x",
                    "long": "--sort"
                },
                {
                    "name": "-z --zoned",
                    "content": "Print the zone model for each device.\n\n--sysroot directory\nGather data for a Linux instance other than the instance from which the lsblk command is\nissued. The specified directory is the system root of the Linux instance to be inspected.\nThe real device nodes in the target directory can be replaced by text files with udev\nattributes.\n",
                    "flag": "-z",
                    "long": "--zoned"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "0\nsuccess\n\n1\nfailure\n\n32\nnone of specified devices found\n\n64\nsome specified devices found, some not found\n",
            "subsections": []
        },
        "ENVIRONMENT": {
            "content": "LSBLKDEBUG=all\nenables lsblk debug output.\n\nLIBBLKIDDEBUG=all\nenables libblkid debug output.\n\nLIBMOUNTDEBUG=all\nenables libmount debug output.\n\nLIBSMARTCOLSDEBUG=all\nenables libsmartcols debug output.\n\nLIBSMARTCOLSDEBUGPADDING=on\nuse visible padding characters.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "For partitions, some information (e.g., queue attributes) is inherited from the parent\ndevice.\n\nThe lsblk command needs to be able to look up each block device by major:minor numbers, which\nis done by using /sys/dev/block. This sysfs block directory appeared in kernel 2.6.27\n(October 2008). In case of problems with a new enough kernel, check that CONFIGSYSFS was\nenabled at the time of the kernel build.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Milan Broz <mbroz@redhat.com>, Karel Zak <kzak@redhat.com>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ls(1), blkid(8), findmnt(8)\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 lsblk command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2026-03-06                                     LSBLK(8)",
            "subsections": []
        }
    },
    "summary": "lsblk - list block devices",
    "flags": [
        {
            "flag": "-a",
            "long": "--all",
            "arg": null,
            "description": "Also list empty devices and RAM disk devices."
        },
        {
            "flag": "-b",
            "long": "--bytes",
            "arg": null,
            "description": "Print the SIZE column in bytes rather than in a human-readable format."
        },
        {
            "flag": "-D",
            "long": "--discard",
            "arg": null,
            "description": "Print information about the discarding capabilities (TRIM, UNMAP) for each device."
        },
        {
            "flag": "-d",
            "long": "--nodeps",
            "arg": null,
            "description": "Do not print holder devices or slaves. For example, lsblk --nodeps /dev/sda prints information about the sda device only."
        },
        {
            "flag": "-E",
            "long": "--dedup",
            "arg": null,
            "description": "Use column as a de-duplication key to de-duplicate output tree. If the key is not available for the device, or the device is a partition and parental whole-disk device provides the same key than the device is always printed. The usual use case is to de-duplicate output on system multi-path devices, for example by -E WWN."
        },
        {
            "flag": "-e",
            "long": "--exclude",
            "arg": null,
            "description": "Exclude the devices specified by the comma-separated list of major device numbers. Note that RAM disks (major=1) are excluded by default if --all is not specified. The filter is applied to the top-level devices only. This may be confusing for --list output format where hierarchy of the devices is not obvious."
        },
        {
            "flag": "-f",
            "long": "--fs",
            "arg": null,
            "description": "Output info about filesystems. This option is equivalent to -o NAME,FSTYPE,FSVER,LABEL,UUID,FSAVAIL,FSUSE%,MOUNTPOINTS. The authoritative information about filesystems and raids is provided by the blkid(8) command."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        },
        {
            "flag": "-I",
            "long": "--include",
            "arg": null,
            "description": "Include devices specified by the comma-separated list of major device numbers. The filter is applied to the top-level devices only. This may be confusing for --list output format where hierarchy of the devices is not obvious."
        },
        {
            "flag": "-i",
            "long": "--ascii",
            "arg": null,
            "description": "Use ASCII characters for tree formatting."
        },
        {
            "flag": "-J",
            "long": "--json",
            "arg": null,
            "description": "Use JSON output format. It’s strongly recommended to use --output and also --tree if necessary."
        },
        {
            "flag": "-l",
            "long": "--list",
            "arg": null,
            "description": "Produce output in the form of a list. The output does not provide information about relationships between devices and since version 2.34 every device is printed only once if --pairs or --raw not specified (the parsable outputs are maintained in backwardly compatible way)."
        },
        {
            "flag": "-M",
            "long": "--merge",
            "arg": null,
            "description": "Group parents of sub-trees to provide more readable output for RAIDs and Multi-path devices. The tree-like output is required."
        },
        {
            "flag": "-m",
            "long": "--perms",
            "arg": null,
            "description": "Output info about device owner, group and mode. This option is equivalent to -o NAME,SIZE,OWNER,GROUP,MODE."
        },
        {
            "flag": "-n",
            "long": "--noheadings",
            "arg": null,
            "description": "Do not print a header line."
        },
        {
            "flag": "-o",
            "long": "--output",
            "arg": null,
            "description": "Specify which output columns to print. Use --help to get a list of all supported columns. The columns may affect tree-like output. The default is to use tree for the column 'NAME' (see also --tree). The default list of columns may be extended if list is specified in the format +list (e.g., lsblk -o +UUID)."
        },
        {
            "flag": "-O",
            "long": "--output-all",
            "arg": null,
            "description": "Output all available columns."
        },
        {
            "flag": "-P",
            "long": "--pairs",
            "arg": null,
            "description": "Produce output in the form of key=\"value\" pairs. The output lines are still ordered by dependencies. All potentially unsafe value characters are hex-escaped (\\x<code>)."
        },
        {
            "flag": "-p",
            "long": "--paths",
            "arg": null,
            "description": "Print full device paths."
        },
        {
            "flag": "-r",
            "long": "--raw",
            "arg": null,
            "description": "Produce output in raw format. The output lines are still ordered by dependencies. All potentially unsafe characters are hex-escaped (\\x<code>) in the NAME, KNAME, LABEL, PARTLABEL and MOUNTPOINT columns."
        },
        {
            "flag": "-S",
            "long": "--scsi",
            "arg": null,
            "description": "Output info about SCSI devices only. All partitions, slaves and holder devices are ignored."
        },
        {
            "flag": "-s",
            "long": "--inverse",
            "arg": null,
            "description": "Print dependencies in inverse order. If the --list output is requested then the lines are still ordered by dependencies."
        },
        {
            "flag": "-T",
            "long": "--tree",
            "arg": null,
            "description": "Force tree-like output format. If column is specified, then a tree is printed in the column. The default is NAME column."
        },
        {
            "flag": "-t",
            "long": "--topology",
            "arg": null,
            "description": "Output info about block-device topology. This option is equivalent to -o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,RA,WSAME."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        },
        {
            "flag": "-w",
            "long": "--width",
            "arg": null,
            "description": "Specifies output width as a number of characters. The default is the number of the terminal columns, and if not executed on a terminal, then output width is not restricted at all by default. This option also forces lsblk to assume that terminal control characters and unsafe characters are not allowed. The expected use-case is for example when lsblk is used by the watch(1) command."
        },
        {
            "flag": "-x",
            "long": "--sort",
            "arg": null,
            "description": "Sort output lines by column. This option enables --list output format by default. It is possible to use the option --tree to force tree-like output and than the tree branches are sorted by the column."
        },
        {
            "flag": "-z",
            "long": "--zoned",
            "arg": null,
            "description": "Print the zone model for each device. --sysroot directory Gather data for a Linux instance other than the instance from which the lsblk command is issued. The specified directory is the system root of the Linux instance to be inspected. The real device nodes in the target directory can be replaced by text files with udev attributes."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "ls",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ls/1/json"
        },
        {
            "name": "blkid",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/blkid/8/json"
        },
        {
            "name": "findmnt",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/findmnt/8/json"
        }
    ]
}