From: Naohiro Aota Date: Mon, 30 Aug 2021 05:52:57 +0000 (+0900) Subject: lsblk: add zoned columns to "lsblk -z" X-Git-Tag: v2.38-rc1~274 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e72528403ecfc38d72364c9a1c031f830b047847;p=thirdparty%2Futil-linux.git lsblk: add zoned columns to "lsblk -z" 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 Signed-off-by: Naohiro Aota --- diff --git a/misc-utils/lsblk.8.adoc b/misc-utils/lsblk.8.adoc index 7356976403..9e68a847ce 100644 --- a/misc-utils/lsblk.8.adoc +++ b/misc-utils/lsblk.8.adoc @@ -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. diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index 807ddcfea6..b4696f5ec5 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -1920,7 +1920,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -t, --topology output info about topology\n"), out); fputs(_(" -w, --width specifies output width as number of characters\n"), out); fputs(_(" -x, --sort sort output by \n"), out); - fputs(_(" -z, --zoned print zone model\n"), out); + fputs(_(" -z, --zoned print zone related information\n"), out); fputs(_(" --sysroot 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);