]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: add zoned columns to "lsblk -z"
authorNaohiro Aota <naohiro.aota@wdc.com>
Mon, 30 Aug 2021 05:52:57 +0000 (14:52 +0900)
committerKarel Zak <kzak@redhat.com>
Tue, 31 Aug 2021 08:24:28 +0000 (10:24 +0200)
Add zoned columns to the "-z" option as follow.

$ lsblk -z -i
NAME        ZONED        ZONE-SZ ZONE-NR ZONE-AMAX ZONE-OMAX ZONE-APP ZONE-WGRAN
sda         host-managed    256M   55880         0       128     672K         4K
sdb         host-managed    256M   55880         0       128     672K         4K
zram0       none              0B       0         0         0       0B         0B
nvme2n1     none              0B       0         0         0       0B         0B
|-nvme2n1p1 none              0B       0         0         0       0B         0B
|-nvme2n1p2 none              0B       0         0         0       0B         0B
`-nvme2n1p3 none              0B       0         0         0       0B         0B
nvme0n1     none              0B       0         0         0       0B         0B
nvme1n1     none              0B       0         0         0       0B         0B
nvme0n2     host-managed      2G    1844        14        14       4M         4K
nvme1n2     host-managed      2G    1844        14        14       4M         4K

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
misc-utils/lsblk.8.adoc
misc-utils/lsblk.c

index 7356976403a7e1afd69924e335c7b59ca7e057ba..9e68a847ce0c16499d1ba9d134d925bb63b1f53c 100644 (file)
@@ -116,7 +116,7 @@ Specifies output width as a number of characters. The default is the number of t
 Sort output lines by _column_. This option enables *--list* output format by default. It is possible to use the option *--tree* to force tree-like output and than the tree branches are sorted by the _column_.
 
 *-z*, *--zoned*::
-Print the zone model for each device.
+Print the zone related information for each device.
 
 *--sysroot* _directory_::
 Gather data for a Linux instance other than the instance from which the *lsblk* command is issued. The specified directory is the system root of the Linux instance to be inspected. The real device nodes in the target directory can be replaced by text files with udev attributes.
index 807ddcfea63106658432c7893d305fab8816a871..b4696f5ec5c9d681760ae195071b432330090de3 100644 (file)
@@ -1920,7 +1920,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -t, --topology       output info about topology\n"), out);
        fputs(_(" -w, --width <num>    specifies output width as number of characters\n"), out);
        fputs(_(" -x, --sort <column>  sort output by <column>\n"), out);
-       fputs(_(" -z, --zoned          print zone model\n"), out);
+       fputs(_(" -z, --zoned          print zone related information\n"), out);
        fputs(_("     --sysroot <dir>  use specified directory as system root\n"), out);
        fputs(USAGE_SEPARATOR, out);
        printf(USAGE_HELP_OPTIONS(22));
@@ -2042,6 +2042,12 @@ int main(int argc, char *argv[])
                case 'z':
                        add_uniq_column(COL_NAME);
                        add_uniq_column(COL_ZONED);
+                       add_uniq_column(COL_ZONE_SZ);
+                       add_uniq_column(COL_ZONE_NR);
+                       add_uniq_column(COL_ZONE_AMAX);
+                       add_uniq_column(COL_ZONE_OMAX);
+                       add_uniq_column(COL_ZONE_APP);
+                       add_uniq_column(COL_ZONE_WGRAN);
                        break;
                case 'e':
                        parse_excludes(optarg);