Bug 26742 - Export available ATA/SMART features and means to turn it on/off
Summary: Export available ATA/SMART features and means to turn it on/off
Status: RESOLVED WORKSFORME
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-24 16:26 UTC by Michael Biebl
Modified: 2012-09-28 15:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Biebl 2010-02-24 16:26:45 UTC
See the referenced Debian bug report #570777

In case smart is disabled for a drive, udisks fails to read the smart values.

As discussed on IRC:

<mbiebl> I'd like your input on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570777
> <davidz> hi mbiebl
> <davidz> let me check
> <mbiebl> Is this an issue in dk-disks/udisks not correctly using libatasmart or is this a libatasmart issue
> <davidz> mbiebl: hmm
> <davidz> mbiebl: does skdump work/
> <davidz> ?
> <davidz> oh
> <davidz> running "smartctl -a on /dev/sda"
> <davidz> what does that do?
> -*- davidz looks suspiciously at the "on"
> <davidz> either way, libatasmart should be able to work without smartmontools
> <davidz> but I think the reporter is a bit confused
> <davidz> there's also the question of whether smart is enabled for the drive
> <davidz> use hdparm to find out
> <mbiebl> davidz: I assume he meant --smart=on
> <mbiebl> which explicitly turns on smart support
> <davidz> I *think* libatasmart will just turn SMART on but I can't remember if we run it at all if the drive doesn't support SMART
> <davidz> well, then maybe the bug report is something like "it would be nice if Palimpsest/GNOME told me if SMART wasn't turned on and also offered me to turn it on"
> <davidz> which is different
> <mbiebl> I guess this is basically what it is about
> <mbiebl> or libatasmart should indeed turn it on by default
> <davidz> well, it's easy to find out
> <davidz> mbiebl: I think libatasmart probably *shouldn't* just turn smart on... it's a bit too cavalier to do that
> <davidz> and we probably should have a way to turn drive features on and off
> <mbiebl> davidz: fine, having a nice gui to turn on/off smart would be fine
> <mbiebl> woult that be persistent between reboots?
> <davidz> mbiebl: I *think* so, I don't know really
> <davidz> try with hdparm?
> <davidz> and s/reboots/plug-ins/ probably
> <davidz> mbiebl: btw, recent udev versions should keep this in the udev database
> <mbiebl> davidz: I don't have smartmontools installed and it just works for me
> <mbiebl> but I did have smartmontools installed in the past
> <davidz> mbiebl: try e.g. 'udevadm info -q all -n /dev/sda |grep _ATA_FEATURE_SET_'
> <davidz> mbiebl: right, so, probably the user is just using a disk for which SMART has been disabled
> <davidz> probably by the user himself
> <davidz> most disks come with SMART enabled from the factory
> <mbiebl> yeah, I bought a new external usb hard drive
> <mbiebl> and smart just worked fine in palimpsest
> <mbiebl> davidz: will update the bug report accordingly
> <mbiebl> do you also want an upstream bug report?
> <davidz> mbiebl: so we should probably make udisks export a way to a) expose what ATA features are turned on; and b) toggle what ATA features are turned on... and then some UI in palimpsest... and some code in the gdu disk notification daemon (the one that complains about failing smart status etc)
> <davidz> mbiebl: so ideally two bug reports (one at b.fd.o, one at b.g.o)
> <davidz> mbiebl: for a): this is very easy - it's just the _ATA_FEATURE_SET_ variables... (this is actually why I added that to udev)
> <mbiebl> Ok, will file two separate bug reports
> <davidz> cool, thanks
> <mbiebl> davidz: so, for my internal hard drive I get http://paste.debian.net/61308/
> <mbiebl> and for external usb hard drive, udevadm info -q all -n /dev/sdb |grep _ATA_FEATURE_SET_ returns *nothing*
> <mbiebl> yet, palimpsest seems to correctly read the smart values for the external drive
> <davidz> mbiebl: I think udisks currently ignores the _ATA_FEATURE_SET_ values and uses libatasmart on all ATA devices
> <davidz> and libatasmart itself will/should check if the SMART feature is enabled or not
Comment 1 David Zeuthen (not reading bugmail) 2012-09-28 15:26:29 UTC
We now rely on ID_ATA_FEATURE_SET_SMART and ID_ATA_FEATURE_SET_SMART_ENABLED (see also bug 24594). For turning SMART on/off via the GUI, see this Disks bug

 https://bugzilla.gnome.org/show_bug.cgi?id=684729
 (we don't want/need a separate udisks bug for it).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.