{"id":38,"date":"2023-02-04T00:00:00","date_gmt":"2023-02-03T15:00:00","guid":{"rendered":"https:\/\/hmhr.ath.cx\/?p=38"},"modified":"2023-02-08T01:41:08","modified_gmt":"2023-02-07T16:41:08","slug":"38","status":"publish","type":"post","link":"https:\/\/hmhr.ath.cx\/?p=38","title":{"rendered":"Linux\u3067\u30db\u30c3\u30c8\u30b9\u30ef\u30c3\u30d7\u3001\u5b89\u5168\u306a\u53d6\u308a\u5916\u3057(esata)"},"content":{"rendered":"\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-ad2f72ca wp-block-group-is-layout-flex\">\n<iframe sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=deathisland-22&amp;language=ja_JP&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=as_ss_li_til&amp;asins=B00HD4K0I8&amp;linkId=d73133b5e77c4d8e80af6687f8d4d1f5\"><\/iframe>\n\n\n\n<p>\u5bb6\u306e\u30b5\u30fc\u30d0\u30de\u30b7\u30f3\u306b\u306f\u5de6\u306e\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u3092\u5165\u308c\u66ff\u3048\u3089\u308c\u308b\u30ad\u30c3\u30c8\u304c\u4ed8\u3044\u3066\u3044\u308b\u3002\u305d\u3057\u3066SATA\u306f\u30db\u30c3\u30c8\u30d7\u30e9\u30b0\u304c\u3067\u304d\u308b\u3002<br>\u30db\u30c3\u30c8\u30d7\u30e9\u30b0\u306fPC\u306e\u304c\u7a3c\u50cd\u3057\u305f\u72b6\u614b\u3067\u3082\u3001HDD\u3092\u5165\u308c\u66ff\u3048\u3089\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3060\u3002<br>PC\u306e\u96fb\u6e90\u3092\u5165\u308c\u305f\u72b6\u614b\u3067\u3001\u3053\u308c\u306bHDD\u3092\u3068\u308a\u308b\u3051\u308b\u3068\u306a\u3093\u306e\u554f\u984c\u3082\u306a\u304f\u8a8d\u8b58\u3057\u3066\u4f7f\u3048\u305f\u306e\u3060\u304c\u3001\u56f0\u3063\u305f\u3053\u3068\u306b\u6b63\u3057\u3044\u53d6\u308a\u51fa\u3057\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u304b\u3063\u305f\u3002<\/p>\n<\/div>\n\n\n\n<!--more-->\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/caedesnotes.wordpress.com\/2010\/05\/11\/shutting-down-esata-disks-under-linux\/\" target=\"_blank\">\u3053\u3053<\/a>\u306b\u5b89\u5168\u306b\u30db\u30c3\u30c8\u30ea\u30ea\u30fc\u30b9\u3059\u308b\u305f\u3081\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u66f8\u3044\u3066\u3042\u3063\u305f\u306e\u3067\u3001\u81ea\u5206\u306e\u74b0\u5883\u306b\u3082\u540c\u3058\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u3063\u305f\u3002\u4f5c\u3063\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4e0b\u306b\u8f09\u305b\u3066\u304a\u304f\u3002<br>\u3088\u3046\u306f<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\necho 1 &gt; \/sys\/block\/DEVICE\/device\/delete\n<\/pre><\/div>\n\n\n<p>\u3053\u3053\u306b\u30011\u3092\u66f8\u304d\u8fbc\u3093\u3067\u3084\u308c\u3070\u3044\u3044\u3002<br>DEVICE\u306fsda\u3084sdb\u306a\u3069\u304c\u5165\u308b\u3002<br>\u30c7\u30a3\u30b9\u30af\u5168\u4f53\u3092off\u306b\u3059\u308b\u305f\u3081\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u6307\u5b9a\u306e\u3088\u3046\u306bsdb1\u3084sda2\u306a\u3069\u672b\u5c3e\u306b\u6570\u5b57\u3092\u5165\u308c\u305a\u30c7\u30a3\u30b9\u30af\u81ea\u4f53\u3092\u6307\u5b9a\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#!\/bin\/sh\n# shutdown SATA device.\n \n#\u5f15\u6570\u304c\u306a\u3051\u308c\u3070\u30c7\u30d5\u30a9\u30eb\u30c8\u3067sdb\u3092\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\nif &#x5B; -n &quot;$2&quot; ]; then\n        DEVICE=$2\nelse\n        DEVICE=&quot;sdb&quot;\nfi\n \nif &#x5B; -z $DEVICE ]; then\n        echo &quot;device is not set.&quot;\n        exit 1\nfi\n \nDEVICE_PATH=&quot;\/sys\/block\/$DEVICE\/device\/delete&quot;\n \nif &#x5B; ! -e $DEVICE_PATH ]; then\n        echo &quot;Ivalid device&quot;\n        exit 1\nfi\n \nif &#x5B; $(mount | grep $DEVICE | wc -l) -gt 0 ]; then\n        echo &quot;Device still mounted&quot;\n        exit 1\nfi\n \necho &quot;Shuttig down $DEVICE...&quot;\necho 1 &gt; $DEVICE_PATH\necho &quot;Done.&quot;\n<\/pre><\/div>\n\n\n<p>\u5f15\u6570\u304c\u306a\u3044\u5834\u5408\u306f\u3001sdb\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067off\u306b\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<br>\u30c7\u30d0\u30a4\u30b9\u306e\u5b58\u5728\u78ba\u8a8d\u3092-e\u3067\u884c\u3044\u3001\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u3057\u3066\u7d42\u4e86\u3059\u308b\u3002<br>\u307e\u305f\u3001\u30de\u30a6\u30f3\u30c8\u4e2d\u306e\u5834\u5408\u3082\u5b9f\u884c\u3057\u306a\u3044\u3088\u3046\u306b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<br>mount\u3092\u5bfe\u8c61\u30c7\u30d0\u30a4\u30b9\u540d\u3067grep\u3057\u3001wc\u3067grep\u306e\u884c\u6570\u3092\u51fa\u529b\u3057\u7d50\u679c\u304c1\u884c\u4ee5\u4e0a\u3042\u308b\u5834\u5408\u306f\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u3068\u3057\u3066\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u3057\u3066\u7d42\u4e86\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u306e\u30c1\u30a7\u30c3\u30af\u306b\u5f15\u3063\u304b\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408\u306b\u3001\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u306b1\u3092\u66f8\u304d\u8fbc\u307f\u7d42\u4e86\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb6\u306e\u30b5\u30fc\u30d0\u30de\u30b7\u30f3\u306b\u306f\u5de6\u306e\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u3092\u5165\u308c\u66ff\u3048\u3089\u308c\u308b\u30ad\u30c3\u30c8\u304c\u4ed8\u3044\u3066\u3044\u308b\u3002\u305d\u3057\u3066SATA\u306f\u30db\u30c3\u30c8\u30d7\u30e9\u30b0\u304c\u3067\u304d\u308b\u3002\u30db\u30c3\u30c8\u30d7\u30e9\u30b0\u306fPC\u306e\u304c\u7a3c\u50cd\u3057\u305f\u72b6\u614b\u3067\u3082\u3001HDD\u3092\u5165\u308c\u66ff\u3048\u3089\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3060\u3002PC\u306e\u96fb\u6e90\u3092\u5165\u308c\u305f\u72b6\u614b\u3067\u3001\u3053\u308c\u306b &hellip; <a href=\"https:\/\/hmhr.ath.cx\/?p=38\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Linux\u3067\u30db\u30c3\u30c8\u30b9\u30ef\u30c3\u30d7\u3001\u5b89\u5168\u306a\u53d6\u308a\u5916\u3057(esata)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=38"}],"version-history":[{"count":1,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts\/38\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}