Bug 1596162 - Command 'lsblk -I <MAJ>' does not perform according to manual.
Summary: Command 'lsblk -I <MAJ>' does not perform according to manual.
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 28
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-28 10:59 UTC by ricky.tigg
Modified: 2018-08-24 10:04 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-08-24 10:04:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Opensuse graphical partition tool (13.40 KB, image/png)
2018-07-18 20:06 UTC, ricky.tigg
no flags Details

Description ricky.tigg 2018-06-28 10:59:25 UTC
Description of problem: command 'lsblk -I <MAJ>' does not perform according to manual.
Version-Release number of selected component: util-linux-2.32-2.fc28.x86_64

How reproducible in terminal:
Test case: Aim to produce output with headers (NAME MAJ, ..., MOUNTPOINT) and select only devices associated to sda (sda1, sda2).

Actual results: 
– Command 'lsblk --help' does not contain entry related to major device numbers.
Observing the syntax 'lsblk -I <MAJ>', commands whose MAJ-values are 8, 11  produce output but not value '253'.

Expected results: 'lsblk -I <MAJ>' to cover MAJ-value associated to LVM partitions since in the manual nothing states that they do not belong to the top-level devices category.

Additional info from 'man lsblk': 
'-I, --include list
Include devices specified by the comma-separated list of major device numbers. The filter is applied to the top-level devices only.'

$ LANG=C lsblk --help
(...)
 -I, --include <list> show only devices with specified major numbers
(...)
MAJ:MIN  major:minor device number

$ lsblk
NAME                            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                               8:0    0 232,9G  0 disk 
├─sda1                            8:1    0     1G  0 part /boot
└─sda2                            8:2    0 231,9G  0 part 
  ├─fedora_localhost--live-root 253:0    0   150G  0 lvm  /
  ├─fedora_localhost--live-swap 253:1    0     4G  0 lvm  [SWAP]
  └─fedora_localhost--live-home 253:2    0    78G  0 lvm  /home
sdb                               8:16   1   3,6G  0 disk 
└─sdb1                            8:17   1   3,6G  0 part /run/media/yk/FEDORA-WS-L
sr0                              11:0    1  1024M  0 rom

Comment 1 Karel Zak 2018-07-18 14:15:32 UTC
well, I think
  -I, --include <list>    show only devices with specified major numbers

is good enough for --help and I guess man page contains all necessary information, but we can improve it -- any suggestion?

The top-level device is a device without dependence, I think it's pretty obvious from lsblk tree-like output. 

The problem I see is  --list output. In this case the filter is applied in the same way as for tree-like output, but dependence between devices is not obvious from the output. Maybe we can add a note about it in the man page.


The current behaviour is correct

$ 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  35.1G  0 part 
└─sda6              8:6    0   7.8G  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 
└─vg_test-lv_test 253:0    0    12M  0 lvm  
nvme0n1           259:0    0 223.6G  0 disk 
├─nvme0n1p1       259:1    0   7.8G  0 part 
├─nvme0n1p2       259:2    0   200G  0 part /home
└─nvme0n1p3       259:3    0  15.8G  0 part /home/test

# lsblk -I 8
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  35.1G  0 part 
└─sda6              8:6    0   7.8G  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 
└─vg_test-lv_test 253:0    0    12M  0 lvm

Comment 2 ricky.tigg 2018-07-18 20:06:59 UTC
Created attachment 1459797 [details]
Opensuse graphical partition tool

At least for my use that tool suits me rather well; it appears to be the only one –even if it is as text-based interface– available for that distribution that provides a comparable feature to the graphical one proper to the distribution Opensuse. Though the addition of a feature covering volumes' free space would be welcome.

Comment 3 Karel Zak 2018-08-24 10:04:49 UTC
Yes, I have already thought about free/used space columns -- the problem is that such info is mostly about filesystems and in cases where FS:DEV is not 1:1 (RAIDs, btrfs, etc) the result may be confusing for end users. 

We'll see...


Note You need to log in before you can comment on or make changes to this bug.