summaryrefslogtreecommitdiffstats
path: root/misc-utils/lsblk.h
Commit message (Collapse)AuthorAgeFilesLines
* lsblk: allow to specify tree columnKarel Zak2019-02-201-1/+3
| | | | | | | | | | | | | | | * document --tree (was missing in the man page) * add optional argument to --tree to specify tree For example: $ lsblk -o KNAME,SIZE,MOUNTPOINT --tree=KNAME /dev/dm-0 KNAME SIZE MOUNTPOINT dm-0 232.9G └─dm-1 232.9G └─dm-2 232.9G Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: fix typos [codespell]Sami Kerola2019-02-181-1/+1
| | | | | Reference: https://github.com/codespell-project/codespell Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lsblk: add --mergeKarel Zak2018-12-071-0/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: make devtree dependences more genericKarel Zak2018-12-071-3/+8
| | | | | | | We also need reference from child to parent to implement multi-parent view. This change allows to walk on tree in both directions. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add --dedup <column>Karel Zak2018-12-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lsblk: remember whole-disk, remove unused struct memberKarel Zak2018-12-071-4/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: make device_get_data() more genericKarel Zak2018-12-071-2/+0Star
| | | | | | | * independent on smartcols line * keep sort data optional Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: read queue/discard_granularity only when necessaryKarel Zak2018-12-071-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: reuse 'removable' flag from parentKarel Zak2018-12-071-0/+1
| | | | | | | It's used in the default output, let's make it a little bit more effective. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: remove unncessary parent pointerKarel Zak2018-12-071-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add lsblk_device_has_dependence()Karel Zak2018-12-071-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: cleanup device reference in the treeKarel Zak2018-12-071-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: remove badly named debug interface nameKarel Zak2018-12-071-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add basic function to build devices treeKarel Zak2018-12-071-3/+96
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: rename blkdev_cxt to lsblk_deviceKarel Zak2018-12-071-4/+4
| | | | | | | | | The patch does not change code logic and semantic -- just rename. * set_cxt() to set_device() * struct blkdev_cxt to lsblk_device Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: fix unknown type `stat` caused by missing headerPatrick Steinhardt2018-10-041-0/+1
| | | | | | | | | | | | The structure `blkdev_cxt` has a `struct stat` member embedded, whose size may not be known on some systems because of a missing include for "sys/stat.h". On glibc-based systems, this header is included transitively via "sys/statvfs.h", but on musl-based systems it is not. Fix the resulting compile error due to unknown size of the struct by including "sys/stat.h". Signed-off-by: Patrick Steinhardt <ps@pks.im>
* lsblk: move udev and blkid stuff to lsblk-properties.cKarel Zak2018-09-191-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: cleanup udev/blkid properties codeKarel Zak2018-09-191-15/+19
| | | | | | | | | | | | | | * split properties to separate struct which is allocated only when udev or blkid provides some information * use separate function for udev and blkid and hide details in generic get_device_properties() * make sure we do not overwrite stuff udev and blkid (but this is only theoretic issue as we do not call get_properties_by_blkid() directly from code) Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: differentiate between swap and mountKarel Zak2018-09-141-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: use lsblk_ prefix mountpoint getterKarel Zak2018-09-141-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: init/deinit libmount stuffKarel Zak2018-09-141-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: move mount stuff to lsblk-mnt.cKarel Zak2018-09-141-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add lsblk.hKarel Zak2018-09-141-0/+95
* move core struct to the header file * move debug stuff to the header file Signed-off-by: Karel Zak <kzak@redhat.com>