The officially official Devuan Forum!

You are not logged in.

#1 2020-03-28 14:31:43

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Drive letter assignments [Solved]

Hello:

I use conky to monitor the temperature of my SAS/SATA drives with this configuration:

TEMPERATURES
${hr 2}
${execpi 5 sensors | grep Core | awk '{print $1 $2 $3}' | cut -c1-15}
${hr 0.3}
/dev/sda: ${execi 60 hddtemp /dev/sda | cut -c 35-55}
/dev/sdb: ${execi 60 hddtemp /dev/sdb | cut -c 37-57}
/dev/sdc: ${execi 60 hddtemp /dev/sdc | cut -c 32-55}
/dev/sdd: ${execi 60 hddtemp /dev/sdd | cut -c 37-55}
/dev/sde: ${execi 60 hddtemp /dev/sde | cut -c 55-65}

The readout I get is ...

/dev/sda: 27 C
/dev/sdb: 44 C
/dev/sdc: 50 C
/dev/sdd: 45 C
/dev/sde: 39 C

But everytime I plug in an external drive or a reader, forget to unplug it and reboot, the readout gets mangled as whatever I have plugged in gets assigned one of the already assigned drive letters and scrambling the readout.

It makes me remember that I have left something plugged in but it is a nuisance.  =-)

Is there a way to get the system to keep the already assigned drive letters in place and assign vacan ones to whatever gets plugged in?

Thanks in advance,

A.

Last edited by Altoid (2020-03-29 20:37:43)

Offline

#2 2020-03-28 14:52:05

Camtaf
Member
Registered: 2019-11-19
Posts: 408  

Re: Drive letter assignments [Solved]

Maybe by using the disk UUIDs, (PARTUUIDs), or using labels instead of relying on the Linux enumeration system.

Offline

#3 2020-03-29 20:40:16

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: Drive letter assignments [Solved]

Hello:

Camtaf wrote:

... using the disk UUIDs, (PARTUUIDs) ...

Yes, that did it.

Camtaf wrote:

... or using labels ...

That too ...
But then I realised that a label could end up not being as unique as a UUID.

Thanks a lot for your input.

Cheers,

A.

Offline

#4 2020-03-31 20:34:16

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: Drive letter assignments [Solved]

Hello:

Altoid wrote:

Yes, that did it.

Spoke too soon ...

The problem was still there.  =^ 7
ie: Rebooting with anything storage plugged in would screw up the conky readout.

I think/guess what using UUIDs in fstab does is link the drive's UUIDs to partitions but still that leaves eventual drive letter assignments in a dynamic state, so to speak.
ie: a UUID does not get permanently linked to a drive letter.

The solution then is to point conky to the drive's UUID.

eg:

TEMPERATURES
${hr 2}
${execpi 5 sensors | grep Core | awk '{print $1 $2 $3}' | cut -c1-15}
${hr 0.3}
/dev/sda: ${execi 60 hddtemp /dev/disk/by-uuid/d6841f29-e39b-4c87-9c52-3a9c3bafe2d3 | cut -c 81-84}
/dev/sdb: ${execi 60 hddtemp /dev/disk/by-uuid/49d1369c-ed70-4543-b0ee-ef65327e101b | cut -c 83-86}
/dev/sdc: ${execi 60 hddtemp /dev/disk/by-uuid/bdf33361-5929-433e-ac7f-1a626aa6e844 | cut -c 78-81}
/dev/sdd: ${execi 60 hddtemp /dev/disk/by-uuid/c722f26d-5c9a-42a9-8c2b-6dbdf926d865 | cut -c 83-86}
/dev/sde: ${execi 60 hddtemp /dev/disk/by-uuid/ca8dbded-819d-4e2b-b017-0981a75ea718 | cut -c 101-104}

... instead of what I was using before:

TEMPERATURES
${hr 2}
${execpi 5 sensors | grep Core | awk '{print $1 $2 $3}' | cut -c1-15}
${hr 0.3}
/dev/sda: ${execi 60 hddtemp /dev/sda | cut -c 35-55}
/dev/sdb: ${execi 60 hddtemp /dev/sdb | cut -c 37-57}
/dev/sdc: ${execi 60 hddtemp /dev/sdc | cut -c 32-55}
/dev/sdd: ${execi 60 hddtemp /dev/sdd | cut -c 37-55}
/dev/sde: ${execi 60 hddtemp /dev/sde | cut -c 55-65}

Now, independently of changing my fstab to UUID (or not) now conky will run hddtemp on drives by UUID.

Cheers,

A.

Offline

Board footer