hack のためのネタ帳, etc,,,

util-linux に含まれる。

公式ページ等

  • The util-linux code repository / tree / misc-utils / lsblk.c
  • GitHub / karelzak / util-linux / misc-utils / lsblk.c

manpage

columns

columndescription
NAMEdevice name
KNAMEinternal kernel device name
MAJ:MINmajor:minor device number
FSTYPEfilesystem type
MOUNTPOINTwhere the device is mounted
LABELfilesystem LABEL
UUIDfilesystem UUID
PARTTYPEpartition type UUID
PARTLABELpartition LABEL
PARTUUIDpartition UUID
PARTFLAGSpartition flags
RAread-ahead of the device
ROread-only device
RMremovable device
HOTPLUGremovable or hotplug device (usb, pcmcia, ...)
MODELdevice identifier
SERIALdisk serial number
SIZEsize of the device
STATEstate of the device
OWNERuser name
GROUPgroup name
MODEdevice node permissions
ALIGNMENTalignment offset
MIN-IOminimum I/O size
OPT-IOoptimal I/O size
PHY-SECphysical sector size
LOG-SEClogical sector size
ROTArotational device
SCHEDI/O scheduler name
RQ-SIZErequest queue size
TYPEdevice type
DISC-ALNdiscard alignment offset
DISC-GRANdiscard granularity
DISC-MAXdiscard max bytes
DISC-ZEROdiscard zeroes data
WSAMEwrite same max bytes
WWNunique storage identifier
RANDadds randomness
PKNAMEinternal parent kernel device name
HCTLHost:Channel:Target:Lun for SCSI
TRANdevice transport type
SUBSYSTEMSde-duplicated chain of subsystems
REVdevice revision
VENDORdevice vendor

optionalias
default-o NAME,MAJ:MIN,RM,SIZE,RO,TYPE,MOUNTPOINT
-f, --fs-o NAME,FSTYPE,LABEL,UUID,MOUNTPOINT
-m, --perms-o NAME,SIZE,OWNER,GROUP,MODE
-t, --topology-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOGSEC,ROTA,SCHED,RQ-SIZE,RA,WSAME

Tips

columns 暗ちょこ

ストレージの状況確認
lsblk -oNAME,FSTYPE,LABEL,MODEL,SERIAL,MOUNTPOINT -xNAME
-x はソート用のカラム指定
sort すると tree format が切れるんだけど、v2.32 以降なら 2017-06-09 の commit 1d9e35c で追加された -T, --tree オプションで tree format を強制可能になっている模様。
Ubuntu 16.04.4 LTS のは lsblk from util-linux 2.27.1 だったので未対応。

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

管理人/副管理人のみ編集できます