I am using dio and hddtemp widgets (Vicious
) to display IO rate and hard drive temperature. The problem is that I have to change the input device name every time I reboot the computer, because the order in which the devices are added during booting is arbitrary. This results in device names like /dev/sda and /dev/sdb switching around on each boot for the same hard drive. This is usually solved by using UUID in other scenarios. I am wondering, is there solution to this problem for aswsome vicious widgets?
Asked
Active
Viewed 200 times
1

RNA
- 146,987
- 15
- 52
- 70
1 Answers
0
You can use the symlinks in /dev/disk/by-uuid/
for this. Something like the following could work:
handle = io.popen("readlink /dev/disk/by-uuid/abc-def-geh")
disk = handle:read("*all"):match("sd[a-zA-Z0-9]*")
handle:close()
This should give you the name of the device in the variable disk
.

Uli Schlachter
- 9,337
- 1
- 23
- 39
-
this is a nice solution! – RNA Oct 12 '13 at 05:18