{"id":3643,"date":"2022-05-21T23:37:56","date_gmt":"2022-05-21T14:37:56","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=3643"},"modified":"2022-11-21T15:17:53","modified_gmt":"2022-11-21T06:17:53","slug":"sleepe-the-usb-hdd-hd-idle","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2022\/05\/21\/sleepe-the-usb-hdd-hd-idle\/","title":{"rendered":"USB-HDD\u3092\u30b9\u30ea\u30fc\u30d7\u3055\u305b\u308b(hd-idle)"},"content":{"rendered":"<div class=\"paragraph\">\n<p>\u6700\u8fd1USB\u63a5\u7d9a\u306eUSB HDD\u306e\u71b1\u304c\u5c11\u3057\u6c17\u306b\u306a\u308a\u307e\u3059\uff0e\u901a\u5e38\u6642\u306f\u5009\u5eab\u7684\u306b\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u30a2\u30a4\u30c9\u30eb\u3067\u3059\uff0e\u30a2\u30a4\u30c9\u30eb\u304c\u4e00\u5b9a\u6642\u9593\u7d9a\u3044\u305f\u3089\u30b9\u30ea\u30fc\u30d7\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3067\u304d\u305f\u3088\u306a\u3068 <code>hdparm -S<\/code> \u3092\u53e9\u3044\u3066\u307f\u307e\u3057\u305f\u304c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304c\u975e\u5bfe\u5fdc\u306e\u3088\u3046\u3067\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo hdparm -S 60 \/dev\/sdb\n\n\/dev\/sdb:\n setting standby to 60 (5 minutes)\nSG_IO: bad\/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><code>hd-idle<\/code> \u3092\u4f7f\u3046\u3068\u30b9\u30ea\u30fc\u30d7\u3059\u308b\u3088\u3046\u306b\u51fa\u6765\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"http:\/\/hd-idle.sourceforge.net\/\">Hard Disk Idle Spin-Down Utility<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Debian\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u5c0e\u5165\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo apt install hd-idle<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><code>\/etc\/default\/hd-idle<\/code> \u3092\u7de8\u96c6\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3059\uff0e\u3053\u3053\u3067\u306f\u5bfe\u8c61\u306e\u30c7\u30a3\u30b9\u30af\u306e <code>\/dev\/sdb<\/code> \u304b\u3089 <code>sdb<\/code> \u3092\uff0c\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u3092 <code>300<\/code> (\u79d2) \u3092\u6307\u5b9a\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo git -C \/etc diff \/etc\/default\/hd-idle\ndiff --git a\/default\/hd-idle b\/default\/hd-idle\nindex 57eb964..1c1bedb 100644\n--- a\/default\/hd-idle\n+++ b\/default\/hd-idle\n@@ -9,7 +9,7 @@\n # and systemv scripts\n # properly update HD_IDLE_OPTS in order to star hd-idle\n\n-HD_IDLE_OPTS=\"-h\"\n+HD_IDLE_OPTS=\"-i 0 -a sdb -i 300\"\n\n # hd-idle command line options\n # Options are:<\/pre>\n<\/div>\n<\/div>\n<blockquote><p>\n\u305d\u306e\u5f8c\u30c7\u30d0\u30a4\u30b9\u540d(\/dev\/sdb)\u304b\u3089uuid\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\uff0e<\/p>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ lsblk -f \/dev\/sdb # sdb\u306euuid\u3092\u78ba\u8a8d\nNAME                                        FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT\nsdb                                         crypto_LUKS 1           ac5b8484-4b26-4967-b336-f63c408bb17d                \n\u2514\u2500luks-ac5b8484-4b26-4967-b336-f63c408bb17d ext4        1.0   export   95c61e04-e22b-4f0f-9af8-2c3d96b0b179    3.5G   100% \/media\/matoken\/export<\/pre>\n<\/div>\n<div class=\"content\">\n<pre>$ sudo git -C \/etc diff \/etc\/default\/hd-idle\ndiff --git a\/default\/hd-idle b\/default\/hd-idle\nindex 1c1bedb..73dbc52 100644\n--- a\/default\/hd-idle\n+++ b\/default\/hd-idle\n@@ -9,7 +9,7 @@\n # and systemv scripts\n # properly update HD_IDLE_OPTS in order to star hd-idle\n \n-HD_IDLE_OPTS=\"-i 0 -a sdb -i 300\"\n+HD_IDLE_OPTS=\"-i 0 -a 95c61e04-e22b-4f0f-9af8-2c3d96b0b179 -i 900\"\n \n # hd-idle command line options\n # Options are:<\/pre>\n<div><\/div>\n<\/div>\n<\/div>\n<\/blockquote>\n<div class=\"paragraph\">\n\u8d77\u52d5\u3057\u307e\u3059\uff0e<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo service hd-idle start\n$ ps -ef| grep -i hd-i\nroot     3468122       1  0 23:24 ?        00:00:00 \/usr\/sbin\/hd-idle -i 0 -a sdb -i 300<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3053\u308c\u30675\u5206\u5bfe\u8c61\u306ehdd\u304c\u5229\u7528\u3055\u308c\u306a\u304b\u3063\u305f\u3089\u30b9\u30ea\u30fc\u30d7\uff0c\u305d\u306e\u3054\u5229\u7528\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u81ea\u52d5\u7684\u306b\u30b9\u30d4\u30f3\u30a2\u30c3\u30d7\u3057\u3066\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre>$ lsusb | grep ATA\nBus 001 Device 008: ID 1bcf:0c31 Sunplus Innovation Technology Inc. SPIF30x Serial-ATA bridge\n$ dpkg-query -W hd-idle\nhd-idle 1.05+ds-2\n$ lsb_release -dr\nDescription:    Debian GNU\/Linux 11 (bullseye)\nRelease:        11\n$ arch\nx86_64<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1USB\u63a5\u7d9a\u306eUSB HDD\u306e\u71b1\u304c\u5c11\u3057\u6c17\u306b\u306a\u308a\u307e\u3059\uff0e\u901a\u5e38\u6642\u306f\u5009\u5eab\u7684\u306b\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u30a2\u30a4\u30c9\u30eb\u3067\u3059\uff0e\u30a2\u30a4\u30c9\u30eb\u304c\u4e00\u5b9a\u6642\u9593\u7d9a\u3044\u305f\u3089\u30b9\u30ea\u30fc\u30d7\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3067\u304d\u305f\u3088\u306a\u3068 hdparm -S \u3092\u53e9\u3044\u3066\u307f\u307e\u3057\u305f\u304c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304c\u975e\u5bfe\u5fdc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[658,7,6],"tags":[168,722],"class_list":["post-3643","post","type-post","status-publish","format-standard","hentry","category-bullseye","category-debian-linux","category-linux","tag-usb","tag-usb-hdd"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=3643"}],"version-history":[{"count":2,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3643\/revisions"}],"predecessor-version":[{"id":3781,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3643\/revisions\/3781"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=3643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=3643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=3643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}