找回密码
 立即注册

QQ登录

只需一步,快速开始

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

在lingbaoboy大神的帮助下,终于在CC15.05.1纯净版成功挂载USB移动硬盘,谢谢

  [复制链接]
 楼主| 发表于 2017-8-6 08:21 | 显示全部楼层
本帖最后由 jiyuquan 于 2017-8-9 08:25 编辑
tomery 发表于 2017-8-5 19:51
楼主,你这个2009年的脚本已经过时了,这个脚本有bug,openwrt官方已经更新到2015版了,详情见我的帖子

谢谢


需要安装blkid和hdparm
  • #!/bin/sh
  • # Copyright (C) 2015 OpenWrt.org
  • # 0 yes blockdevice handles this - 1 no it is not there
  • blkdev=`dirname $DEVPATH`
  • basename=`basename $blkdev`
  • device=`basename $DEVPATH`
  • skip=`block info | sed 's/\(.*\): .*/\1/' | grep -q $device ; echo $?`
  • path=$DEVPATH
  • if [ $basename != "block" ] && [ -z "${device##sd*}" ] && [ $skip -eq 1 ]; then
  •         islabel=`blkid /dev/$device | grep -q LABEL ; echo $?`
  •         if [ $islabel -eq 0 ] ; then
  •                 mntpnt=`blkid /dev/$device |sed 's/.*LABEL="\(.*\)" UUID.*/\1/'`
  •         else
  •                 mntpnt=$device
  •         fi
  •         case "$ACTION" in
  •                 add)
  •                         mkdir -p /export/$mntpnt
  •                         # Set APM value for automatic spin down
  •                         /sbin/hdparm -B 127 /dev/$device
  •                         # Try to be gentle on solid state devices
  •                         mount -o rw,noatime,discard /dev/$device /export/$mntpnt
  •                 ;;
  •                 remove)
  •                         # Once the device is removed, the /dev entry disappear. We need mountpoint
  •                         mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
  •                         umount -l $mountpoint
  •                 ;;
  •         esac
  • fi


点评

#!/bin/sh # Copyright (C) 2015 OpenWrt.org # 0 yes blockdevice handles this - 1 no it is not there blkdev=`dirname $DEVPATH` basename=`basename $blkdev` device=`basename $DEVPATH` skip=`bloc  详情 回复 发表于 2017-8-8 19:02
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-8-8 19:02 | 显示全部楼层
本帖最后由 tomery 于 2017-8-8 19:04 编辑

我帖子里的搞错了,已经更正过来了,以2015版为准,
需要安装blkid和hdparm
  1. #!/bin/sh

  2. # Copyright (C) 2015 OpenWrt.org

  3. # 0 yes blockdevice handles this - 1 no it is not there
  4. blkdev=`dirname $DEVPATH`
  5. basename=`basename $blkdev`
  6. device=`basename $DEVPATH`
  7. skip=`block info | sed 's/\(.*\): .*/\1/' | grep -q $device ; echo $?`
  8. path=$DEVPATH

  9. if [ $basename != "block" ] && [ -z "${device##sd*}" ] && [ $skip -eq 1 ]; then
  10.         islabel=`blkid /dev/$device | grep -q LABEL ; echo $?`
  11.         if [ $islabel -eq 0 ] ; then
  12.                 mntpnt=`blkid /dev/$device |sed 's/.*LABEL="\(.*\)" UUID.*/\1/'`
  13.         else
  14.                 mntpnt=$device
  15.         fi

  16.         case "$ACTION" in
  17.                 add)
  18.                         mkdir -p /export/$mntpnt
  19.                         # Set APM value for automatic spin down
  20.                         /sbin/hdparm -B 127 /dev/$device
  21.                         # Try to be gentle on solid state devices
  22.                         mount -o rw,noatime,discard /dev/$device /export/$mntpnt
  23.                 ;;
  24.                 remove)
  25.                         # Once the device is removed, the /dev entry disappear. We need mountpoint
  26.                         mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
  27.                         umount -l $mountpoint
  28.                 ;;
  29.         esac
  30. fi
复制代码


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

使用道具 举报

发表于 2017-9-17 15:53 | 显示全部楼层
厉害 收藏我试试
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-12-15 15:09 | 显示全部楼层
好用!谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-20 14:14 | 显示全部楼层
教程很简洁好懂 good
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-26 12:42

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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