徒然なるままのブログ。日記とも言う。

2010年8月23日月曜日

考えたらこれだとスピンダウンしないのかもしれない。

DD-WRT化したWZR-HP-G300NH。



考えたら使ってないときはNASHDDのスピンダウン(省電力)をさせたほうが良いのかなと思いそれの設定にチャレンジ。



hdparmもしくはsdparmを使うはず。

これってディスクを /dev/hda か /dev/sda で認識するかの違いで使い分けるもんだと思ってる。ではDD-WRT化したWZR-HP-G300NHでは何と認識しているか?





root@DD-WRT / $ df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/root 11520 11520 0 100% /

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /mnt

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /etc

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /tmp/root

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /opt



予想外。

なので両方いれてみることにした。



root@DD-WRT /mnt $ opkg update

Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages//Packages.gz.

Inflating http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages//Packages.gz.

Updated list of available packages in /tmp/var/opkg-lists/snapshots.



root@DD-WRT /mnt $ opkg install sdparm

Installing sdparm (1.04-1) to root...

Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages//sdparm_1.04-1_ar71xx.ipk.

Installing kmod-scsi-generic (2.6.32.16-1) to root...

Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages//kmod-scsi-generic_2.6.32.16-1_ar71xx.ipk.

Installing kernel (2.6.32.16-1) to root...

Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages//kernel_2.6.32.16-1_ar71xx.ipk.

Configuring kernel.

Configuring kmod-scsi-generic.

/opt//usr/lib/opkg/info/kmod-scsi-generic.postinst: .: line 3: can't open /etc/functions.sh

Configuring sdparm.

Collected errors:

* pkg_run_script: postinst script returned status 2.

* opkg_configure: kmod-scsi-generic.postinst returned 2.

root@DD-WRT /mnt $ sdparm

one or more device names required

Usage: sdparm [--all] [--clear=STR] [--command=CMD] [--dbd] [--defaults]

[--dummy] [--flexible] [--get=STR] [--help] [--hex] [--inquiry]

[--long] [--num-desc] [--page=PG[,SPG]] [--quiet] [--save]

[--set=STR] [--six] [--transport=TN] [--vendor=VN] [--verbose]

[--version] DEVICE [DEVICE...]



sdparm --enumerate [--all] [--inquiry] [--long] [--page=PG[,SPG]]

[--transport=TN] [--vendor=VN]

where:

--all | -a list all known fields for given device

--clear=STR | -c STR clear (zero) field value(s)

--command=CMD | -C CMD perform CMD (e.g. 'eject')

--dbd | -B set DBD bit in mode sense cdb

--defaults | -D set a mode page to its default values

--dummy | -d don't write back modified mode page

--enumerate | -e list known pages and fields (ignore device)

--flexible | -f compensate for common errors, relax some checks

--get=STR | -g STR get (fetch) field value(s)

--help | -h print out usage message

--hex | -H output in hex rather than name/value pairs

--inquiry | -i output INQUIRY VPD page(s) (def: mode page(s))

--long | -l add description to field output

--num-desc | -n report number of mode page descriptors

--page=PG[,SPG] | -p PG[,SPG] page (and optionally subpage) number

[or abbrev] to output, change or enumerate

--quiet | -q suppress device vendor/product/revision string line

--save | -S place mode changes in saved page as well

--set=STR | -s STR set field value(s)

--six | -6 use 6 byte SCSI mode cdbs (def: 10 byte)

--transport=TN | -t TN transport protocol number [or abbrev]

--vendor=VN | -M VN vendor (manufacturer) number [or abbrev]

--verbose | -v increase verbosity

--version | -V print version string and exit



View or change SCSI mode page fields (e.g. of a disk or CD/DVD drive)



root@DD-WRT / $ opkg install hdparm

Installing hdparm (9.27-1) to root...

Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages//hdparm_9.27-1_ar71xx.ipk.

Configuring kmod-scsi-generic.

/opt//usr/lib/opkg/info/kmod-scsi-generic.postinst: .: line 3: can't open /etc/functions.sh

Configuring hdparm.

Collected errors:

* pkg_run_script: postinst script returned status 2.

* opkg_configure: kmod-scsi-generic.postinst returned 2.

root@DD-WRT / $ hdparm



hdparm - get/set hard disk parameters - version v9.27, by Mark Lord.



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)

--fallocate Create a file without writing data to disk

--fibmap Show device extents (and fragmentation) for a file

--fwdownload Download firmware file to drive (EXTREMELY DANGEROUS)

--fwdownload-mode3 Download firmware using min-size segments (EXTREMELY DANGEROUS)

--fwdownload-mode3-max Download firmware using max-size segments (EXTREMELY DANGEROUS)

--fwdownload-mode7 Download firmware using a single segment (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

--trim-sector-ranges Tell SSD firmware to discard unneeded data sectors: lba:count ..

--trim-sector-ranges-stdin Same as above, but reads lba:count pairs from stdin

--verbose Display extra diagnostics from some commands

--write-sector Repair/overwrite a (possibly bad) sector directly on the media (VERY DANGEROUS)



intallでエラーが出たもののとりあえず導入できた。



まずはhdparmから

root@DD-WRT / $ hdparm -y /dev/discs/disc0/part1



/dev/discs/disc0/part1:

issuing standby command

HDIO_DRIVE_CMD(standby) failed: Invalid exchange



だめか。

ではsdparm

root@DD-WRT / $ sdparm --command=stop /dev/discs/disc0/part1

/dev/discs/disc0/part1: Hitachi HDS721010CLA332

root@DD-WRT / $



sdparmって止まったかどうか分かんないんだよな。

勘としては止まってなさげな気がする。







考えたら

root@DD-WRT / $ df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/root 11520 11520 0 100% /

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /mnt

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /etc

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /tmp/root

/dev/discs/disc0/part1

961432072 263310400 649283672 29% /opt



/dev/discs/disc0はNAS用のディスクエリア+OpenWrtで導入したシステムの導入先で使ってるんだから止まるわけないか。

そうか、システムエリアだけUSBメモリとか別ディスクに突っこみ、スリープさせたいディスクと分けなきゃだめか。USBハブ買ってきてやるか。



.......まてよ、USBメモリってext3とかでフォーマットできるのか?やったことねえや。






0 件のコメント:

コメントを投稿