is it possible to view HDD S.M.A.R.T info from a unprivileged ct ?

lxiosjao

Member
Mar 21, 2021
64
1
13
Hello,
I would like to monitor my sata hdds from a LXC ct (web service) but I have to access S.M.A.R.T information.
Is it possible to do this from a ct ?
I dont want to install the web service on the pve host.

It would be nice if the ct don't have the right to r/w on hdd (read S.M.A.R.T info only)
Hdds are in a zpool.

I tried to add this in the /etc/pve/lxc/101.conf
Code:
lxc.cgroup.devices.allow: b 8:1 rwm
lxc.mount.entry: /dev/sde dev/sde none bind,optional,create=file



Code:
root@ct:~# smartctl -a /dev/sde
...

Probable ATA device behind a SAT layer
Try an additional '-d ata' or '-d sat' argument.
Read Device Identity failed: Permission denied
...

As you can see, smartctl can't read the device identity.
What do you think ?
Thanks
 
Last edited:
Hdds are in a zpool.
I tried to add this in the /etc/pve/lxc/101.conf
Code:
lxc.cgroup.devices.allow: b 8:1 rwm
lxc.mount.entry: /dev/sde dev/sde none bind,optional,create=file
Why even?

Either do it in privileged container or do it the proper way via nagios tools or ssh ......
 
I would run a cron job on the host which dumped the smart values into a text file that is accessible to the container.