From: Karel Zak Date: Fri, 17 Mar 2023 11:16:31 +0000 (+0100) Subject: lsblk: (man) add hint about --merge X-Git-Tag: v2.39-rc2~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46ead6f9409e7e4424a94c24a57f125fc58e049f;p=thirdparty%2Futil-linux.git lsblk: (man) add hint about --merge Signed-off-by: Karel Zak --- diff --git a/misc-utils/lsblk.8.adoc b/misc-utils/lsblk.8.adoc index 87df92ff91..d4b13f2dea 100644 --- a/misc-utils/lsblk.8.adoc +++ b/misc-utils/lsblk.8.adoc @@ -18,10 +18,12 @@ lsblk - list block devices *lsblk* lists information about all available or the specified block devices. The *lsblk* command reads the *sysfs* filesystem and *udev db* to gather information. If the udev db is not available or *lsblk* is compiled without udev support, then it tries to read LABELs, UUIDs and filesystem types from the block device. In this case root permissions are necessary. -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. +By default, the command prints all block devices (except RAM disks) in a tree-like format. The same device can be repeated in the tree if it relates to other devices. The *--merge* option is recommended for more complicated setups to gather groups of devices and describe complex N:M relationships. 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_ and *--list* in environments where a stable output is required. +Use *lsblk --help* to get a list of all available columns. + 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 relationship between block devices and filesystems is not always one-to-one. The filesystem may use more block devices, or the same filesystem may be accessible by more paths. This is the reason why *lsblk* provides MOUNTPOINT and MOUNTPOINTS (pl.) columns. The column MOUNTPOINT displays only one mount point (usually the last mounted instance of the filesystem), and the column MOUNTPOINTS displays by multi-line cell all mount points associated with the device.