Command:
lsblk -l -e7 -o RM,TYPE,PATH,NAME,VENDOR,MODEL |\
awk '{ if ( ($1 == 1) && ($2 == "disk") ) {print $2,$3,$4,$5,$6} }'
Context/limitations regarding my question:
- The LABEL field, which can be requested with
lsblk -l -e7 -o RM,TYPE,NAME,LABEL |\
awk '{ if ( ($1 == 1) && ($2 == "part") ) {print $2,$3,$4} }'
concerns the partition(s) and can be changed with fatlabel
, e2label
, ntfslabel
. . . ; this is not what I am looking for.
The volume-label mentioned in the man page of
tune2fs
command seems to actually be the partition label.
The commandtune2fs -l PATH
only works with a PATH including a magic number, therefore a partition (not a disk).Why do I suspect I miss some knowledge or information in this matter?
A device/volume/PATH(without magic number) can encompass several partitions ; therefore, I do not see any other specific identifier for the hardware device than theVENDOR
andMODEL
fields. If you use several usb sticks from the same manufacturer (my case), it is getting confusing and I found nothing on the web.
My regards to the experienced contributors on this site ; I owe them much of the modest progress I booked on my Ubuntu system.
lsblk
? Just addSERIAL
to the-o
fields to get the serial no. of the drive which should be unique. – don_crissti Jan 29 '23 at 22:04