Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smart commands act on root partition not root device #1206

Closed
phillxnet opened this Issue Mar 6, 2016 · 4 comments

Comments

Projects
None yet
1 participant
@phillxnet
Copy link
Member

phillxnet commented Mar 6, 2016

When gathering smart info the partition device name for root is used rather than the base device name.
This is due to the exception made for root, when installed on a partition (default), of storing the partition name rather than the base device name ie sda3 rather than sda. Rather than loose this information we could make the smart routines robust to these calls. Note that mostly these partition rather than base device calls function as expected. However in some instances when calling smartctl on a device's partition we loose information eg:

/usr/sbin/smartctl -l selftest -l selective /dev/sdc3
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-4.3.3-1.el7.elrepo.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
Device does not support Self Test logging

and we have a return code of 4 (via $?)

Where as if we use the base device name of sdc:

/usr/sbin/smartctl -l selftest -l selective /dev/sdc
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-4.3.3-1.el7.elrepo.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sdc: Unknown USB bridge [0x0781:0x5580 (0x010)]
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

we have a generic return code of 1 (via $?) and in the second instance we have helpful info on what is wrong and a suggestion on what to try which would be nice not to loose.

These examples were as a result of an install to a SanDisk Extreme USB 3.0 which as the second example suggests, requires custom smartctl options (-d sat as it goes); but with the current call to partition this is not surfaced. Hence the suggestion we move to calling only on base devices.

I am currently looking into this issue and hope to make some more progress tomorrow (UK).

I am considering this issue as a precursor to #1079 as if sorted then the suggestion that additional custom smart options may be required will be surfaced.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 7, 2016

smart device name wrapper function rockstor#1206
Takes a device name, ie base device or partition and returns the
first match found in lsblk by way of finding the base device. This
leaves base devices as is and partition devices translated to their
base device which can help to provide better smart command
error reporting.
@phillxnet

This comment has been minimized.

Copy link
Member Author

phillxnet commented Mar 7, 2016

I am currently working on this issue.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 7, 2016

user smart device name wrapper for all smart calls rockstor#1206
This helps with consistency and opens up the possibility to
have a name translation layer ie for 3ware controller twl*
smart devices. Also removes false positive smart capability
announcement ie smart apparently available with sda3 but
doesn't actually provide useful info but sda gives helpful log
entry as to problem but no announcement of availability.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 7, 2016

@phillxnet

This comment has been minimized.

Copy link
Member Author

phillxnet commented Mar 7, 2016

Turns out this issue was also providing false positives of smart availability when no useful info was actually available without custom smart options.

@phillxnet

This comment has been minimized.

Copy link
Member Author

phillxnet commented Mar 8, 2016

A parsing issue I'm sorting while here is that of inadvertent smart value trimming when values contain a ": " in the Identity tab (from smartctrl -H --info devname):
The following two values show the result:

In smartctl database [for details use
SATA 3.0, 6.0 Gb/s (current

when they should read:

In smartctl database [for details use: -P show]
SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 8, 2016

change smart identity tab info parser rockstor#1206
Fix bug in parser where second ": " in line would cause
smart values not to be displayed. Also limit char count
to 64 as db model allows max of 64 chars.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 8, 2016

remove logging used in this issue rockstor#1206
Plus some minor comment changes.

schakrava added a commit that referenced this issue Mar 15, 2016

Merge pull request #1212 from phillxnet/1206_smart_commands_act_on_ro…
…ot_partition

smart commands act on root partition not root device #1206
@phillxnet

This comment has been minimized.

Copy link
Member Author

phillxnet commented Mar 15, 2016

Closing as fixed by merged pr #1212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.