ProxmoxVE 4 /usr/sbin/smartctl: Permission denied

bitblue.lab

Member
Oct 7, 2015
75
0
6
I want to see smart data for hard drives but when I run smartctl -a /dev/sda it shows /usr/sbin/smartctl: Permission denied.

Tried with sudo etc but not working.
 
Cannot reproduce that, installed smartmontools via:
apt-get install smartmontools

and then your command is working just fine:

Code:
root@XXX:~# pveversion 
pve-manager/4.0-59/a1588972 (running kernel: 4.2.3-2-pve)
root@XXX:~# smartctl -a /dev/sda
smartctl 6.4 2014-10-07 r4002 [x86_64-linux-4.2.3-2-pve] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     Crucial_CT500MX200SSD1
Serial Number:    15050E8F2960
LU WWN Device Id: 5 00a075 10e8f2960
Firmware Version: MU01
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 T13/2161-D revision 4
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Sun Nov 22 23:16:41 2015 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
[...]

How did you install it? And do you run it as root?
 
Seems you are using the Proxmox VE 4.0 OVH installation template?

If yes, please open a ticket on OVH and ask why the set a custom permission - looks like a bug to me on their installation image.
 
Seems you are using the Proxmox VE 4.0 OVH installation template?

If yes, please open a ticket on OVH and ask why the set a custom permission - looks like a bug to me on their installation image.

Yes its OVH installation Template...can I change permissions by myself, because I am administrator of server and have full access to everything in Proxmox and Server with IPMI.
 
Yes its OVH installation Template...can I change permissions by myself, because I am administrator of server and have full access to everything in Proxmox and Server with IPMI.

Please open a ticket on OVH and ask why the set a custom permission.
 
Please open a ticket on OVH and ask why the set a custom permission.

This would take days until they reply...support is not fast as you think and dont want to create new troubles to get my server accessed to them with root user etc, I thought you would help me how to change permission and make a smart test because I need to check my health of my drives.
 
I tried a lot to make smartctl to work in Nodes.pm, but I always got permission denied.
So I decided to go a different path.
I created a service that gets the temperature from HDD using smartctl. The value is placed in /run/hddtemp/sda.temp.
Then in Nodes.pm I do this:

Perl:
sub read_temp {
    my ($dev) = @_;                           # e.g. 'sda'
    my $path = "/run/hddtemp/$dev.temp";
    return 'N/A' unless -e $path && -r $path;
    open my $fh, '<', $path or return 'N/A';
    my $v = <$fh>;
    close $fh;
    defined $v ? do { chomp $v; $v eq '' ? 'N/A' : $v } : 'N/A';
}

        $res->{HDDtemperatureSda} = read_temp("sda");

And in pvemanagerlib.js
Code:
        {
            itemId: 'HDDtemperatureSda',
            colspan: 2,
            printBar: false,
            title: gettext('HDD Temperature'),
            textField: 'HDDtemperatureSda',
            renderer: function(value) {
                const n = Number(value);            // value is a string
                if (Number.isInteger(n) && n > 0) {
                   myValue = value;
                } else {
                    return '/dev/sda: N/A';
                }

                return `/dev/sda: ${myValue} ℃`;
            }
        },

This is how it looks in proxmox:
proxmox.png
 

Attachments

Last edited: