diff options
author | Karel Zak | 2018-10-18 15:46:07 +0200 |
---|---|---|
committer | Karel Zak | 2018-12-07 12:33:34 +0100 |
commit | dc4662f0e755929de9cbe98b1b343b492fd620f4 (patch) | |
tree | 6947fd4b81219649cb23eff5d1eb4b12f3c86252 /misc-utils/lsblk.8 | |
parent | lsblk: remember whole-disk, remove unused struct member (diff) | |
download | kernel-qcow2-util-linux-dc4662f0e755929de9cbe98b1b343b492fd620f4.tar.gz kernel-qcow2-util-linux-dc4662f0e755929de9cbe98b1b343b492fd620f4.tar.xz kernel-qcow2-util-linux-dc4662f0e755929de9cbe98b1b343b492fd620f4.zip |
lsblk: add --dedup <column>
The target use-case are systems with large number of multi-path
devices or systems with duplicate (copied) filesystems.
The feature is flexible enough to use arbitrary column (for example
WWM or UUID, ...) as de-duplication key.
For example tree with multi-path devices sd{c,d,e,f}
./lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 200M 0 part /boot
├─sda3 8:3 0 130.3G 0 part
├─sda4 8:4 0 50G 0 part /
└─sda5 8:5 0 42.9G 0 part
sdb 8:16 0 74.5G 0 disk
└─sdb1 8:17 0 74.5G 0 part /home/archive
sdc 8:32 0 100M 0 disk
└─mpatha 253:0 0 100M 0 mpath
├─mpatha1 253:1 0 50M 0 part
└─mpatha2 253:2 0 49M 0 part
sdd 8:48 0 100M 0 disk
└─mpatha 253:0 0 100M 0 mpath
├─mpatha1 253:1 0 50M 0 part
└─mpatha2 253:2 0 49M 0 part
sde 8:64 0 100M 0 disk
└─mpatha 253:0 0 100M 0 mpath
├─mpatha1 253:1 0 50M 0 part
└─mpatha2 253:2 0 49M 0 part
sdf 8:80 0 100M 0 disk
└─mpatha 253:0 0 100M 0 mpath
├─mpatha1 253:1 0 50M 0 part
└─mpatha2 253:2 0 49M 0 part
De-duplicate by WWN:
./lsblk -M WWN
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 200M 0 part /boot
├─sda3 8:3 0 130.3G 0 part
├─sda4 8:4 0 50G 0 part /
└─sda5 8:5 0 42.9G 0 part
sdb 8:16 0 74.5G 0 disk
└─sdb1 8:17 0 74.5G 0 part /home/archive
sdc 8:32 0 100M 0 disk
└─mpatha 253:0 0 100M 0 mpath
├─mpatha1 253:1 0 50M 0 part
└─mpatha2 253:2 0 49M 0 part
Addresses: https://github.com/karelzak/util-linux/issues/616
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/lsblk.8')
-rw-r--r-- | misc-utils/lsblk.8 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/misc-utils/lsblk.8 b/misc-utils/lsblk.8 index 7cc2788db..d2a58ed08 100644 --- a/misc-utils/lsblk.8 +++ b/misc-utils/lsblk.8 @@ -88,6 +88,14 @@ Use JSON output format. .BR \-l , " \-\-list" Produce output in the form of a list. .TP +.BR \-M , " \-\-dedup " \fIcolumn\fP +Use \fIcolumn\fP 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 \fB\-M WWN\fR. +.TP .BR \-m , " \-\-perms" Output info about device owner, group and mode. This option is equivalent to .BR -o\ NAME,SIZE,OWNER,GROUP,MODE . |