Util-Linux Archive on lore.kernel.org
 help / color / Atom feed
* lsblk full disk id output column
@ 2019-06-06 14:14 Dan MacDonald
  2019-06-07  7:17 ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Dan MacDonald @ 2019-06-06 14:14 UTC (permalink / raw)
  To: util-linux

I need a tool that makes it simple to correlate disk device names with
their ids, as can be seen under . The main reason for this is when
administrating ZFS (replacing failed disks etc)  it doesn't deal with
device names (sda, sdb etc) but uses disk id's instead and I often
struggle to marry them up.

I know lsblk already has the "-o model" output column which prints
part of the disk id but I want to see the full disk id (the full
device name, with or without its /dev/disk/by-id prefix) printed under
a column called ID, DISKID or similar.

Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lsblk full disk id output column
  2019-06-06 14:14 lsblk full disk id output column Dan MacDonald
@ 2019-06-07  7:17 ` Karel Zak
  2019-06-07 10:30   ` Dan MacDonald
  0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2019-06-07  7:17 UTC (permalink / raw)
  To: Dan MacDonald; +Cc: util-linux

On Thu, Jun 06, 2019 at 03:14:35PM +0100, Dan MacDonald wrote:
> I need a tool that makes it simple to correlate disk device names with
> their ids, as can be seen under . The main reason for this is when
> administrating ZFS (replacing failed disks etc)  it doesn't deal with
> device names (sda, sdb etc) but uses disk id's instead and I often
> struggle to marry them up.
> 
> I know lsblk already has the "-o model" output column which prints
> part of the disk id but I want to see the full disk id (the full
> device name, with or without its /dev/disk/by-id prefix) printed under
> a column called ID, DISKID or similar.

Not sure what you mean with ID in this case.

Try 
    lsblk -o+MODEL,WWN 
or
    lsblk -o+MODEL,SERIAL

maybe we can add SERIAL-LONG, because udev differentiate between
SERIAL and SERIAL_SHORT (used by lsblk), and it's MODEL+SERIAL.

See also

    udevadm info /dev/sda


  Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lsblk full disk id output column
  2019-06-07  7:17 ` Karel Zak
@ 2019-06-07 10:30   ` Dan MacDonald
  0 siblings, 0 replies; 3+ messages in thread
From: Dan MacDonald @ 2019-06-07 10:30 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

Hi Karel

On Fri, Jun 7, 2019 at 7:17 AM Karel Zak <kzak@redhat.com> wrote:
> Not sure what you mean with ID in this case.
>
> Try
>     lsblk -o+MODEL,WWN
> or
>     lsblk -o+MODEL,SERIAL
>
> maybe we can add SERIAL-LONG, because udev differentiate between
> SERIAL and SERIAL_SHORT (used by lsblk), and it's MODEL+SERIAL.

Neither of those commands provide the output I want.

>
> See also
>
>     udevadm info /dev/sda

That command does though, on my current laptop it prints

S: disk/by-id/ata-Samsung_SSD_840_EVO_250GB_S1DBNSBD945982B

As part of its output and that's exactly the sort of ZFS-friendly
device name I require and was hoping to get from lsblk.

I had never heard of or used udevadm until you mentioned it but it
serves the purpose of translating "regular" Linux disk device names
into their ID equivalents.

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 14:14 lsblk full disk id output column Dan MacDonald
2019-06-07  7:17 ` Karel Zak
2019-06-07 10:30   ` Dan MacDonald

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org util-linux@archiver.kernel.org
	public-inbox-index util-linux


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox