Commit Graph

55 Commits

Author SHA1 Message Date
Karel Zak dc4662f0e7 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>
2018-12-07 12:33:34 +01:00
Karel Zak 881953d735 lsblk: add note about --list -I <maj,...>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-18 16:21:01 +02:00
Karel Zak 498d148661 lsblk: document --sysroot
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:19:28 +02:00
Bjarni Ingi Gislason 0bb7e904d7 man: Use the correct macro for a font change of one argument
Use the correct macro (I, B) for the font change of one argument, not
those that are used for alternating two fonts, like "BR", "IR", "RB",
or "RI".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-05-23 10:43:27 +02:00
Karel Zak 3d15a5e852 lsblk: fix notes about RAM disks
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-15 10:51:15 +02:00
Karel Zak 3476084d14 lsblk: document LSBLK_DEBUG=
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-16 19:10:35 +01:00
Karel Zak 06a27566e1 lsblk: add hint about perms to man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-11-22 12:31:58 +01:00
Karel Zak e12364cdfb lsblk: small man page change in return codes description
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-07 10:03:18 +02:00
Karel Zak 1d9e35cc1e lsblk: add option --tree
Now lsblk uses --list when --sort <column> is specified. This patch
allows to specify --tree to overwrite this default behavior add to
force tree-like output. In this case tree branches are sorted by the
<column>.

$ lsblk --sort SIZE
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda2   8:2    0   200M  0 part /boot
sda1   8:1    0   200M  0 part /boot/efi
sda6   8:6    0   7.8G  0 part [SWAP]
sda5   8:5    0  35.1G  0 part /home/misc
sda4   8:4    0    50G  0 part /
sdb1   8:17   0  74.5G  0 part /home/archive
sdb    8:16   0  74.5G  0 disk
sda3   8:3    0 130.3G  0 part /home
sda    8:0    0 223.6G  0 disk

$ lsblk --sort SIZE --tree
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0  74.5G  0 disk
└─sdb1   8:17   0  74.5G  0 part /home/archive
sda      8:0    0 223.6G  0 disk
├─sda2   8:2    0   200M  0 part /boot
├─sda1   8:1    0   200M  0 part /boot/efi
├─sda6   8:6    0   7.8G  0 part [SWAP]
├─sda5   8:5    0  35.1G  0 part /home/misc
├─sda4   8:4    0    50G  0 part /
└─sda3   8:3    0 130.3G  0 part /home

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-09 11:33:18 +02:00
Damien Le Moal f2df436564 lsblk: add ZONED column
Add the column "ZONED" to the output to display block devices zone
model information.

Example output:

> lsblk -o+ZONED
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT ZONED
sda      8:0    0 111.8G  0 disk            none
├─sda1   8:1    0   500M  0 part /boot      none
├─sda2   8:2    0  87.3G  0 part /          none
└─sda3   8:3    0    24G  0 part [SWAP]     none
sdb      8:16   0  12.8T  0 disk            host-managed
sdc      8:32   0   5.5T  0 disk            host-managed

or:

> lsblk --zoned
NAME   ZONED
sda    none
├─sda1 none
├─sda2 none
└─sda3 none
sdb    host-managed
sdc    host-managed

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2017-04-19 14:07:03 +02:00
Karel Zak 091683a82f lsblk: fix --inverse --list
Let's follow --inverse dependencies although --list output requested.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1441175
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-13 11:39:22 +02:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Michael Kerrisk 46f057ed37 docs: various pages: Format pathnames as italic (.I)
In the majority of pages, pathnames are formatted as Italic,
which is the norm. However, there are several cases where they
are formatted as bold. This patch fixes a number of those
exceptions.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk (man-pages) f053ff1e3a Place SEE ALSO entries in order
This patch does only the following:

* Order SEE ALSO entries first by section name, then alphabetically
  within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
  at the end of SEE ALSO lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Karel Zak e76e6747cb lsblk: add note about --sort and --list relation
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-02 14:47:37 +01:00
Karel Zak 37948503c9 libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=on
This env.variable forces libsmartcols to use visible padding chars.
The standard debug has to be enabled (to minimize overhead for
non-debug execution).

For example:

 $ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-07 12:25:06 +02:00
Karel Zak 85008725d0 lsblk: tiny man page update for --sort
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-10 13:06:48 +01:00
Karel Zak 4a102a4871 lsblk: add --json
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-04 15:49:52 +02:00
Stanislav Brabec a79b7cab66 lsblk.8: Fix description of output format
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2015-06-02 11:58:53 +02:00
Karel Zak 1539750f2a lsblk: implement SOMEOK (=64) return code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-29 12:35:26 +01:00
J William Piggott b06c1ca6f8 docs: restore minus symbols in long opts
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-20 18:15:30 -05:00
Benno Schulenberg 3a60b1c26b docs: remove obsolete and unneeded comments from man-page files
Transform some of them into copyright lines.
Also fix three header lines and snip some trailing whitespace.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:03:26 +01:00
Benno Schulenberg f49ccec212 docs: don't use bold or italics for "[option]" in synopsis of man pages
As per the convention shown in Documentation/howto-man-page.txt.
Also make a few other tiny adjustments along the way.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:23 +01:00
Karel Zak 68e422ecae docs: update info about env debug variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:54 +01:00
Karel Zak 3c2e64b0ca lsblk: add notes about udev to the man page
Reported-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-09-05 10:02:45 +02:00
Karel Zak 642048e4a4 lsblk: add --sort <column>
This implementation allow to sort output by arbitrary output column.

Note that output is always converted to human readable strings, but
sort functions in many cases work with original data (stored as
private data to cells by scols_cell_set_userdata()).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-20 15:12:51 +02:00
Masatake YAMATO 1b4d2a4a4a lsblk: add -O option to show all available columns
Simple command line for gathering information as many as possible is
useful when understanding a system, especially when trouble shooting.

This patch introduces -O option which enables all available columns.

[kzak@redhat.com: - define collisions between options,
                  - define columns when parse argv[]]

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:56:52 +02:00
Benno Schulenberg b4362b6f84 docs: standardize the phrases for --help and --version in all man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15 10:28:30 +02:00
Karel Zak c7e76cd145 lsblk: add --paths
Now it's not so simple to generate full paths to devices if you want to
use user friendly names like /dev/mapper/foo. Let's make it easy.
2013-03-29 17:16:09 +01:00
Benno Schulenberg ceefa682b4 docs: improve wording, grammar and formatting of lsblk man page
Also sort the options alphabetically.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-04 12:33:31 +01:00
Benno Schulenberg 3768420374 docs: improve grammar and formatting of explanation of "-o +list"
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-04 12:33:25 +01:00
Karel Zak 36fb10074c docs: add missing information about -o +<list>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-18 13:30:00 +01:00
Milan Broz 2adb1a44c2 lsblk: Add write-same attribute to topology info
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-07 18:12:02 +01:00
Karel Zak a402012e61 lsblk: fix and update man page about --scsi
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-07 14:39:43 +01:00
Milan Broz 28ffc2b735 lsblk: Add --scsi switch
The --scsi switch prints similar information to lsscsi command.

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-11-07 13:20:45 +01:00
Davidlohr Bueso ca3dbca10b libmount: document LIBMOUNT_DEBUG users
Update the manpages of programs that use this environment variable for
extra debugging information.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-09-04 17:21:57 +02:00
Karel Zak 88ca32b38b lsblk: add WWN, improve udev support
* read WWN from udev DB

 * use *_ENC properties from udev DB to get original unmodified
   strings (otherwise for example blank space is replaced with '_' in
   ID_FS_LABEL)

 * always read from udev, libblkid is fallback solution only

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-14 18:15:38 +02:00
Karel Zak 980358f1ef lsblk: add not about unstable default output
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26 11:44:59 +02:00
Karel Zak 2ef4e8ba1a lsblk: add --include option
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-19 16:06:22 +02:00
Petr Uzel 68eebd5354 lsblk: improve man page wording
Cc: Regid Ichira <regid23@yahoo.com>
From: Regid Ichira <regid23@yahoo.com>
Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672702
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-15 11:19:44 +02:00
Karel Zak d324270eee lsblk: remove private \x<hex> coding, decode data from udev
* remove private encoding code (all encoding will be in lib/tt.c)
 * decode LABELs from udev

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:20:47 +02:00
Peter Rajnoha 8265242b22 lsblk: count with terminating character, man page -s entry
Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
2012-04-04 13:32:25 +02:00
Dave Reisner abd4e8a52f lsblk: RQ-SIZE is part of the --topology output (man page bugfix)
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-13 12:22:11 +01:00
Milan Broz 5791238768 lsblk: add --version switch
[kzak@redhat.com: - update usage() and man page]

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-03-08 16:19:57 +01:00
Karel Zak 7c9c872c2b lsblk: escape unsafe chars in parsable output
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-08 16:04:45 +01:00
Sami Kerola f65b3bb625 lsblk: inform about depencency to /sys/dev/block
The lsblk depends on /sys/dev/block/ symlinks, which appeared in
kernel 2.6.27.  Users with old, or non-sysfs configured, kernel
got ealier message

lsblk: md0: failed to initialize sysfs handler
lsblk: xvda: failed to initialize sysfs handler
[...]

that I found a little too difficult to understand.  This patch will
change the message to

lsblk: failed to access sysfs directory: /sys/dev/block: No such file or directory

and informs in manual page what could be reason to that.

[kzak@redhat.com: - use access() rather than opendir()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-10 14:51:26 +02:00
Karel Zak 9830eca533 lsblk: add note to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-29 11:34:10 +02:00
Benno Schulenberg 232dc924c4 docs: uniformize the header and footer lines in man pages
Use dates without the day, use the full month name, put "util-linux" in
the lower left corner, and "User Commands" or "System Administration"
at the top center.

Also improve here and there the one-line program description.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-22 10:39:21 +02:00
Karel Zak 6ea1bdd32c lsblk: add --pairs to output in key="value" format
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-10 10:38:29 +02:00
Martin K. Petersen 2d2322461c lsblk: add support for discard topology (-D option)
I got tired of poking around in sysfs to find the discard topology.
Here's a patch against lsblk that adds a -D option to present this
information in a human-readable form:

NAME                  DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda                          0        0B       0B         0
└─sda1                       0        0B       0B         0
sdb                          0      512B       2G         1
└─sdb1                       0      512B       2G         1

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-05 10:09:26 +02:00