找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
楼主: kik***

粒子云内置硬盘休眠唤醒重置问题的解决方案

[复制链接]
发表于 2019-12-25 12:34 | 显示全部楼层
感谢楼主的付出撸力
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-12-26 20:42 来自手机 | 显示全部楼层
本帖最后由 afio 于 2019-12-27 15:33 编辑

大神的这个帖子有用,我照着这个设置弄了之后复制了200g过去都没有吊盘,以前复制十几个g就掉盘。但是休眠唤醒的时候还是经常不能挂载,有的挂载为sdb sdc,我觉得大神再研究一下这个问题就完美了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-2 17:32 | 显示全部楼层
谢谢楼主分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-3 09:10 | 显示全部楼层
K大,我照着你的教程操作了一下,果然神器啊。感谢你的付出。现在只是smb 可道云等,ftp怎么操作有没有教程?盼复谢谢。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-19 11:13 | 显示全部楼层
期待大神出更好能支持休眠的固件。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-2-29 08:17 | 显示全部楼层
本帖最后由 elo1111 于 2020-2-29 13:15 编辑

我用这个 script, 每十分钟跑一下, 支持休眠。

hdspindown.sh

  1. #!/bin/bash
  2. # This script looks for recent disk access, and if nothing has changed, puts /dev/"drive" into spindown mode.
  3. # This should be used only is the hdparm power management function is not working.
  4. # Call this script with cron or manually as desired
  5. #
  6. #https://superuser.com/questions/651880/force-spin-down-of-external-hard-drive-on-linux-raspberry-pi
  7. #
  8. readonly SCRIPT_NAME=$(basename $0)
  9. # Change which drive this script looks at by changing the drive variable below:
  10. drive="sda"
  11. #
  12. isMounted    () { findmnt -rno SOURCE,TARGET "$1" >/dev/null;} #path or device
  13. isDevMounted () { findmnt -rno SOURCE        "$1" >/dev/null;} #device only
  14. isPathMounted() { findmnt -rno        TARGET "$1" >/dev/null;} #path   only
  15. #
  16. log() {
  17.   echo "$@"
  18.   logger -p user.notice -t $SCRIPT_NAME "$@"
  19. }
  20. #
  21. if isDevMounted "/dev/$drive1"; then
  22.    echo "device is mounted"
  23. else
  24.    log "device is not mounted"
  25.    reboot
  26. fi
  27. if isMounted "/dev/disk/by-label/*****Data*****"; then
  28.    echo "disk is mounted"
  29. else
  30.    log "disk is not mounted"
  31. #   reboot   
  32. fi
  33. #
  34. if (hdparm -C /dev/$drive |grep -q "standby") then
  35.   log "Disk is standing by"
  36.   exit 0
  37. fi
  38. if (netstat -ano|grep 8200|grep -q "ESTABLISHED") then
  39.   log "MiniDLNA is in-use"
  40.   exit 0
  41. fi
  42. if (netstat -ano|grep 139|grep -q "ESTABLISHED") then
  43.   log "Samba is in-use"
  44.   exit 0
  45. fi
  46. #
  47. if (netstat -ano|grep -q "ESTABLISHED") then
  48.   log "Some ports are in-used"
  49.   (netstat -ano|grep "ESTABLISHED") 2>&1 | (log)
  50. fi
  51. #
  52. if [ $(smartctl -a /dev/$drive | grep -c "Self-test routine in progress") = 1 ]; then
  53.    log "Smart test in progress"
  54.    exit 0
  55. fi
  56. #
  57. current=`date`
  58. caller=$(ps ax | grep "^ *$PPID" | awk '{print $NF}')
  59. filename="/tmp/diskaccess.txt"
  60. if [ -f "$filename" ]; then
  61.     stat_old=`cat "$filename" | tr -dc "[:digit:]"`
  62.     stat_new=`cat /sys/block/"$drive"/stat | tr -dc "[:digit:]"`
  63.     if [ "$stat_old" == "$stat_new" ]; then
  64.         stat="0"
  65.         log "The disk hasn't been used; spinning down /dev/$drive"
  66.         log $stat_old
  67.         hdparm -y /dev/$drive > /dev/null
  68.     else
  69.         stat="1"
  70.         log $stat_old
  71.         log $stat_new
  72.         log "The drive has been used..."
  73.         echo $stat_new > $filename
  74.     fi
  75. else
  76.     log "/tmp/diskaccess.txt file does not exist; creating it now."
  77.     log $stat_new > $filename
  78. fi
  79. echo $stat " - " $drive " - " $current " - by: " $caller >> /tmp/diskaccesslog.txt
复制代码


我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 11:53

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表