Page 1 of 1

HDPARM and SDPARM Selectable

PostPosted: Tue Jan 13, 2015 9:39 am
by eng_murat
I see that hdparm is used to spin down the external HDDs. But some PATA/SATA-2-USB converters have problems with it. Would it be possible to have sdparm and hdparm selectable for each HDD? Where shoul I look to add this feature?

Re: HDPARM and SDPARM Selectable

PostPosted: Tue Jan 13, 2015 10:03 am
by Jocko
Fvdw will look at this point.

But remember, the default disk behaviour should be to spin down itself and we added this feature only for old or not usual disk.

So I don't think that we add a feature in the web-interface where you can select a specific tool for each disk but maybe easier to change the binary where it may swap the used tool if the disk does not spin down with the first tool.

Re: HDPARM and SDPARM Selectable

PostPosted: Tue Jan 13, 2015 8:18 pm
by eng_murat
I've tried to compile and run my patched hdparm but it seems so that you are using somehow a differently compiled system. This patched hdparm is working with my JMicro USB2SATA/PATA converter on another rpi and is able to spin down the connected HDDs. Would it be possible to compile it for me? Else the version which does not include the patch does not spin down the HDDs, this is something that is not acceptable as I do not want to kill my HDDs. Would you please help me to compile this?

Re: HDPARM and SDPARM Selectable

PostPosted: Tue Jan 13, 2015 10:55 pm
by fvdw
here you go

ps I did not apply any patch as I assume you already have patched it, I just have run "make"
ps 2 in the firmware we use version 9.28
Code: Select all
root@fvdwsl-5big2:/share/1000/fvdw/hdparm-9.15 # ./hdparm -h

hdparm - get/set hard disk parameters - version v9.15

Usage:  hdparm  [options] [device] ..

Options:
 -a   get/set fs readahead
 -A   get/set the drive look-ahead flag (0/1)
 -b   get/set bus state (0 == off, 1 == on, 2 == tristate)
 -B   set Advanced Power Management setting (1-255)
 -c   get/set IDE 32-bit IO setting
 -C   check drive power mode status
 -d   get/set using_dma flag
 -D   enable/disable drive defect management
 -E   set cd/dvd drive speed
 -f   flush buffer cache for device on exit
 -F   flush drive write cache
 -g   display drive geometry
 -h   display terse usage information
 -H   read temperature from drive (Hitachi only)
 -i   display drive identification
 -I   detailed/current information directly from drive
 -k   get/set keep_settings_over_reset flag (0/1)
 -K   set drive keep_features_over_reset flag (0/1)
 -L   set drive doorlock (0/1) (removable harddisks only)
 -M   get/set acoustic management (0-254, 128: quiet, 254: fast)
 -m   get/set multiple sector count
 -N   get/set max visible number of sectors (HPA) (VERY DANGEROUS)
 -n   get/set ignore-write-errors flag (0/1)
 -p   set PIO mode on IDE interface chipset (0,1,2,3,4,...)
 -P   set drive prefetch count
 -q   change next setting quietly
 -Q   get/set DMA queue_depth (if supported)
 -r   get/set device  readonly flag (DANGEROUS to set)
 -R   obsolete
 -s   set power-up in standby flag (0/1) (DANGEROUS)
 -S   set standby (spindown) timeout
 -t   perform device read timings
 -T   perform cache read timings
 -u   get/set unmaskirq flag (0/1)
 -U   obsolete
 -v   defaults; same as -acdgkmur for IDE drives
 -V   display program version and exit immediately
 -w   perform device reset (DANGEROUS)
 -W   get/set drive write-caching flag (0/1)
 -x   obsolete
 -X   set IDE xfer mode (DANGEROUS)
 -y   put drive in standby mode
 -Y   put drive to sleep
 -Z   disable Seagate auto-powersaving mode
 -z   re-read partition table
 --dco-freeze      freeze/lock current device configuration until next power cycle
 --dco-identify    read/dump device configuration identify data
 --dco-restore     reset device configuration back to factory defaults
 --direct          use O_DIRECT to bypass page cache for timings
 --drq-hsm-error   crash system with a "stuck DRQ" error (VERY DANGEROUS)
 --fibmap          show device extents (and fragmentation) for a file
 --fibmap-sector   show absolute LBA of a specfic sector of a file
 --fwdownload      Download firmware file to drive (EXTREMELY DANGEROUS)
 --idle-immediate  idle drive immediately
 --idle-unload     idle immediately and unload heads
 --Istdin          read identify data from stdin as ASCII hex
 --Istdout         write identify data to stdout as ASCII hex
 --make-bad-sector deliberately corrupt a sector directly on the media (VERY DANGEROUS)
 --prefer-ata12    use 12-byte (instead of 16-byte) SAT commands when possible
 --read-sector     read and dump (in hex) a sector directly from the media
 --security-help   display help for ATA security commands
 --verbose         display extra diagnostics from some commands
 --write-sector    repair/overwrite a (possibly bad) sector directly on the media (VERY DANGEROUS)

root@fvdwsl-5big2:/share/1000/fvdw/hdparm-9.15 #

Re: HDPARM and SDPARM Selectable

PostPosted: Wed Jan 14, 2015 10:26 am
by eng_murat
Thank you very much, this solved my problem.

Re: HDPARM and SDPARM Selectable

PostPosted: Wed Jan 14, 2015 10:39 am
by Jocko
Hi eng_murat,

Can you please explain why you need version 9.15 instead of version 9.28 ?

Or do you find only the wanted patch for version 9.15 ?

In this case, can give where do you find the patch.

Re: HDPARM and SDPARM Selectable

PostPosted: Wed Jan 14, 2015 7:05 pm
by eng_murat
This is because I found the patch for that specific version. Patch and details about the issue can be found in the following link: http://sourceforge.net/p/hdparm/patches/17/.

Re: HDPARM and SDPARM Selectable

PostPosted: Wed Jan 14, 2015 8:34 pm
by fvdw
seems the patch can be ported to newer versions

Re: HDPARM and SDPARM Selectable

PostPosted: Wed Jan 14, 2015 9:36 pm
by eng_murat
If it can be done than it would be greate actually.