[smartmontools-support] smartctl questions (newbie)

Carlos E. R. robin.listas at telefonica.net
Mon Apr 26 12:41:11 CEST 2021


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Content-ID: <7c7fd588-7ccd-8bb8-25c4-6cdc5243ab99 at Telcontar.valinor>


El 2021-04-24 a las 13:45 +0200, Michael via Smartmontools-support escribió:

> |$ smartctl -t short /dev/sdb smartctl 7.2 2020-12-30 r5155
> [x86_64-linux-4.19.0-16-amd64] (local build) Copyright (C) 2002-20,
> Bruce Allen, Christian Franke, www.smartmontools.org Smartctl open
> device: /dev/sdb [SAT] failed: Permission denied |

I suppose there is a line wrap problem in your email, the output would 
rather be:

$ smartctl -t short /dev/sdb
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-4.19.0-16-amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org Smartctl
open device: /dev/sdb [SAT] failed: Permission denied


These things are important with computers ;-)


> thought maybe needed to use sudo, and the output was:

Yes, you need sudo or being root.

>
> |$ sudo smartctl -t short /dev/sdb smartctl 7.2 2020-12-30 r5155
> [x86_64-linux-4.19.0-16-amd64] (local build) Copyright (C) 2002-20,
> Bruce Allen, Christian Franke, www.smartmontools.org Read Device
> Identity failed: scsi error unsupported scsi opcode A mandatory SMART
> command failed: exiting. To continue, add one or more '-T permissive'
> options. |
>
> Am I missing something? Why the test showed access denied in my external
> drive? I'm not that familiar with Linux, so thought it better to ask
> before doing something stupid. Can someone guide me in the right
> direction, please?

The first attempt failed because you were not root and so you did not have 
permission.

You can check yourself that you do not have permission:

cer at Telcontar:~> ls -l /dev/sdb
brw-rw---- 1 root disk 8, 16 Apr 19 23:45 /dev/sdb
cer at Telcontar:~>

You will see something like that. It reads that the user "root" has read 
and write permission, and so does the group "disk" (no, belonging to that 
group is not a good idea). The rest of the "world" has no permission at 
all.


The second failed because the hard disk has problems communicating.
As the error message tells you, you can try:

sudo smartctl -t short -T permissive /dev/sdb

or even:

sudo smartctl -t short -T permissive -T permissive  /dev/sdb


- -- 
Cheers,
        Carlos E. R.
        (from openSUSE 15.2 x86_64 at Telcontar)
-----BEGIN PGP SIGNATURE-----

iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYIaYxxwccm9iaW4ubGlz
dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVAToAniDY16E1yLVpXXyvcDjp
Y/13A09pAJ9oMjSQ6qI3xDXq75esuTMiezZYSg==
=qT3D
-----END PGP SIGNATURE-----


More information about the Smartmontools-support mailing list