util-linux.vger.kernel.org archive mirror
 help / color / mirror / 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, other threads:[~2019-06-07 10:30 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).