Section: System Administration (8)
Updated: February 2013
lsblk lists information about all available or the specified block devices. The lsblk command reads the sysfs filesystem and udev db to gather information.
The command prints all block devices (except RAM disks) in a tree-like format by default. Use lsblk --help to get a list of all available columns.
The default output, as well as the default output from options like --fs and --topology, is subject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected columns by using --output columns-list in environments where a stable output is required.
Note that lsblk might be executed in time when udev does not have all information about recently added or modified devices yet. In this case it is recommended to use udevadm settle before lsblk to synchronize with udev.
The default list of columns may be extended if list is specified in the format +list (e.g. lsblk -o +UUID).
For partitions, some information (e.g. queue attributes) is inherited from the parent device.
The lsblk command needs to be able to look up each block device by major:minor numbers, which is done by using /sys/dev/block. This sysfs block directory appeared in kernel 2.6.27 (October 2008). In case of problems with a new enough kernel, check that CONFIG_SYSFS was enabled at the time of the kernel build.
:Setting LIBMOUNT_DEBUG=0xffff enables debug output.
The lsblk command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
Tutoriais de Tecnologia Web