SMART and settings unavailable in gnome-disks


#1

My external drive is awesome now that it is unlocked, photos are saved to multiple drives, and it’s used as a backup, except now I notice that it will not spin down. It spins constantly and the fan is starting to change tone. I don’t think it is meant to spin so much. :sweat_smile:

gnome-disks shows the drive SMART test greyed out and settings are unavailable also
Model is: WD MyBook 4TB

I’ve formatted it to Ext4 (overwriting with zeros) already so I don’t really want to spend the time to backup my backups and then reformat it again.

How do I make it sleep?


#2

I’ve found a lot of more recently sold external hard drives don’t support SMART. They usually are the newer type of hard drive with the USB connection directly on the hard drive circuit board instead of having a SATA connection and a SATA to USB adapter as part of the drive enclosure. I don’t know if this is the cause or just a correlation, however. Most new WD drives I’ve seen are this type, I assume since it’s cheaper for them.


#3

Interesting. This one was purchased in 2016. I haven’t ever opened the case, but I think it is USB to SATA inside there. This guy on youtube shelled one similar to mine but I don’t think its is the exact model.

I’m more concerned with adjusting settings of the drive. I want to be able to tell it to spin down after 30min - 1 hour of non-use.

My model is: WDBFJK0040HBK-NESN


#4

I’ve been under the impression for years that reading SMART data from external USB drives were caused by some under the hood changes. This AskUbuntu question has some suggestions to temporarily (or permanently) omit a kernel module that might be the cause for inaccessible SMART data (possibly the drive settings too) via GNOME Disks.

However, GNOME Disks itself has some many years old bug reports on the matter (#1540110, #1464077 and #1092900) so I’ve assumed it’s just the GUI that incorrectly greys out the options for USB drives.

GSmartControl is another GUI dedicated for SMART testing. I haven’t got a USB drive at hand to test, but if this works (or works under sudo) then that confirms it’s just the GUI, not the kernel or hardware.

For editing the drive settings, GNOME Disks would just be writing configuration files, so you could use a command line tool to do the job. hdparm looks like it will do the trick:


#5

Thank you for the links.

Here is my output of sudo hdparm -S 240 /dev/sdc

/dev/sdc:
setting standby to 240 (20 minutes)
SG_IO: bad/missing sense data, sb[]: f0 00 01 00 50 40 f0 0a 80 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

What is the comment on the sense data missing all about?

I then ran sudo hdparm -I /dev/sdc | grep level
There was no output for the command. I guess I will knowif it worked in 20 minutes.


#6

OK it seems that sudo hdparm -S 240 /dev/sdc does work well in setting the drive to sleep after 20 minutes. and adding this did also spin down the drive after rebooting:

command_line {
hdparm -S 240 /dev/disk/by-uuid/eb4a0932-3430-4b04-b633-9d10458f73f2
}

…But then Ubuntu went through a few updates and now the drive will not sleep unless I enter the first code I listed manually. The edit I made is still in the .conf file. Can anyone explain how I might fix this issue?

Here is my /etc/hdparm.conf

## This is the default configuration for hdparm for Debian.  It is a
## rather simple script, so please follow the following guidelines :)
## Any line that begins with a comment is ignored - add as many as you
## like.  Note that an in-line comment is not supported.  If a line
## consists of whitespace only (tabs, spaces, carriage return), it will be
## ignored, so you can space control fields as you like.  ANYTHING ELSE
## IS PARSED!!  This means that lines with stray characters or lines that
## use non # comment characters will be interpreted by the initscript.
## This has probably minor, but potentially serious, side effects for your
## hard drives, so please follow the guidelines.  Patches to improve
## flexibilty welcome.  Please read /usr/share/doc/hdparm/README.Debian for
## notes about known issues, especially if you have an MD array.
##
## Note that if the init script causes boot problems, you can pass 'nohdparm'
## on the kernel command line, and the script will not be run.
##
## Uncommenting the options below will cause them to be added to the DEFAULT
## string which is prepended to options listed in the blocks below.
##
## If an option is listed twice, the second instance replaces the first.
##
## /sbin/hdparm is not run unless a block of the form:
##      DEV {
##         option
##         option
##         ...
##      }
## exists.  This blocks will cause /sbin/hdparm OPTIONS DEV to be run.
## Where OPTIONS is the concatenation of all options previously defined
## outside of a block and all options defined with in the block.

# -q be quiet
quiet
# -a sector count for filesystem read-ahead
#read_ahead_sect = 12
# -A disable/enable the IDE drive's read-lookahead feature
#lookahead = on
# -b bus state
#bus = on
# -B apm setting
#apm = 255
# -B apm setting when on battery
#apm_battery = 127
# -c enable (E)IDE 32-bit I/O support - can be any of 0,1,3
#io32_support = 1
# -d disable/enable the "using_dma" flag for this drive
#dma = off
# -D enable/disable the on-drive defect management
#defect_mana = off
# -E cdrom speed
#cd_speed = 16
# -k disable/enable the "keep_settings_over_reset" flag for this drive
#keep_settings_over_reset = off
# -K disable/enable the drive's "keep_features_over_reset" flag
#keep_features_over_reset = on
# -m sector count for multiple sector I/O
#mult_sect_io = 32
# -P maximum sector count for the drive's internal prefetch mechanism
#prefetch_sect = 12
# -r read-only flag for device
#read_only = off
# -R Enable/Disable Write-Read-Verify, on to enable (R1), off to disable (R0)
# write_read_verify = off
# -s Turn on/off power on in standby mode
# poweron_standby = off
# -S standby (spindown) timeout for the drive
#spindown_time = 24
# -u interrupt-unmask flag for the drive
#interrupt_unmask = on
# -W Disable/enable the IDE drive's write-caching feature
#write_cache = off
# -X IDE transfer mode for newer (E)IDE/ATA2 drives
#transfer_mode = 34
# -y force to immediately enter the standby mode
#standby
# -Y force to immediately enter the sleep mode
#sleep
# -Z Disable the power-saving function of certain Seagate drives
#disable_seagate
# -M Set the acoustic management properties of a drive
#acoustic_management
# -p Set the chipset PIO mode
# chipset_pio_mode
# --security-freeze Freeze the drive's security status
# security_freeze
# --security-unlock Unlock the drive's security
# security_unlock = PWD
# --security-set-pass Set security password
# security_pass = password
# --security-disable Disable drive locking
# security_disable
# --user-master Select password to use
# user-master = u
# --security-mode Set the security mode
# security_mode = h

# Root file systems.  Please see README.Debian for details
# ROOTFS = /dev/hda

## New note - you can use straight hdparm commands in this config file
## as well - the set up is ugly, but it keeps backwards compatibility
## Additionally, it should be noted that any blocks that begin with
## the keyword 'command_line' are not run until after the root filesystem
## is mounted.  This is done to avoid running blocks twice.  If you need
## to run hdparm to set parameters for your root disk, please use the
## standard format.

#Samples follow:
#First three are good for devfs systems, fourth one for systems that do
#not use devfs.  The fifth example uses straight hdparm command line
#syntax.  Any of the blocks that use command line syntax must begin with
#the keyword 'command_line', and no attempt is made to validate syntax.
#It is provided for those more comfortable with hdparm syntax.

#/dev/discs/disc0/disc {
#	mult_sect_io = 16
#	write_cache = off
#	spindown_time = 240
#}

#/dev/discs/disc1/disc {
#	mult_sect_io = 32
#	spindown_time = 36
#	write_cache = off
#}

#/dev/cdroms/cdrom0 {
#	dma = on
#	interrupt_unmask = on
#	io32_support = 0
#}

#/dev/hda {
#	mult_sect_io = 16
#	write_cache = off
#	dma = on
#}

command_line {
    hdparm -S 240 /dev/disk/by-uuid/eb4a0932-3430-4b04-b633-9d10458f73f2 
}