挂载NAS 文档_第1页
挂载NAS 文档_第2页
挂载NAS 文档_第3页
挂载NAS 文档_第4页
挂载NAS 文档_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、用于路由器的CPU类型为Atheros WiSOC based Hardware的。如果第一分区小,第二分区大,就将以下所有的代码中的sda1和sda2互换位置或者分区的时候,直接把第一分区分为大数据区,第二区分为小数据区,直接运行以下代码。Optware + MiniDLNA + Transmission 13-OCT-2013 - Build 22118 Update 22-OCT-2013: Thanks to "snoop86" Please read the following instructions before taking a

2、ny action. That will be good for you getting used to them. - 0. Hardware and Prerequisites - 0.0 TP-Link WDR3600-N600 - v1.1: Have DD-WRT v24-sp2 (07/24/13) std - build 22118 flashed and working 0.1 PuTTY and WinSCP: Google, download and make them ready for use 0.2 King

3、ston 16GB - DT101/G2: Create two partitions on the USB thumbdrive, using MiniTool Partition Wizard for example. 0.2.1 First Partition - Partition Size : 14 GB (unallocated space) - File System : NTFS - Create As : Primary - Partition Label: Data (or whatever label you want)&

4、#160;0.2.2 Second Partition - Partition Size : 100 MB - File System : NTFS - Create As : Primary - Partition Label: Optware (or whatever label you want) 0.3 DD-WRT Web Interface 0.3.1 Enable SSH (SSHd): Services > Services > Secure Shell 0.3.2 Enable Samba Sh

5、aring: Services > NAS 0.4 Router: stick the USB thumbdrive on router and reboot it. 0.5 Wait few seconds. Then make sure both mnt/sda1 and mnt/sda2 are mounted on the router and shared by Samba (from DD-WRT Web Interface) - 1. Optware - 1.1 Run the following line-by-

6、line, using PuTTY: 以下到大红字之前,不再需要改动sda1和sda2Code:cd /tmp/mnt/sda2touch optware.enable cd /tmp/mnt/sda1 mkdir etc opt root useful touch optware.enable chmod 755 etc opt root mkdir opt/lib chmod 755 opt/lib cp -a /etc/* /tmp/mnt/sda1/etc/ sleep 15 mount

7、 -o bind /tmp/mnt/sda1/etc /etc mount -o bind /tmp/mnt/sda1/opt /jffs cd /tmpwget /attitude_adjustment/12.09/ar71xx/generic/packages/libc_-1_ar71xx.ipkwget /attitude_adjustment/12.09/ar71xx/generic/packages/opkg_618-3_ar71xx.ipk

8、ipkg install libc_-1_ar71xx.ipk opkg_618-3_ar71xx.ipk You should see: Quote:Connecting to (77:80) libc_-1_ar71 100% |*| 217k 0:00:00 ETA Connecting to (77:80) opkg_618-6_ar71xx.ip 100% |*|

9、 57322 0:00:00 ETA ERROR: File not found: /usr/local/lib/ipkg/lists/whiterussian You probably want to run ipkg update' ERROR: File not found: /usr/local/lib/ipkg/lists/non-free You probably want to run ipkg update' ERROR: File not found: /usr/local/lib/ipkg/lists/bac

10、kports You probably want to run ipkg update' /bin/ipkg: line 1184: sort: not found Unpacking libc.Done. Configuring libc.Done. ERROR: File not found: /usr/local/lib/ipkg/lists/whiterussian You probably want to run ipkg update' ERROR: File not found: /usr/lo

11、cal/lib/ipkg/lists/non-free You probably want to run ipkg update' ERROR: File not found: /usr/local/lib/ipkg/lists/backports You probably want to run ipkg update' /bin/ipkg: line 1184: sort: not found Unpacking opkg.Done. Configuring opkg.Done. Code:1. cat

12、> /etc/opkg.conf << EOF src/gz snapshots /attitude_adjustment/12.09/ar71xx/generic/packages dest root /opt dest ram /opt/tmp lists_dir ext /opt/tmp/var/opkg-lists EOF umount /jffs mount -o bind /tmp/mnt/sda1/root /tmp/root m

13、ount -o bind /tmp/mnt/sda1/opt /opt export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib' opkg update (或者运行opkg -f /etc/opkg.conf update,注意如果以后还要运行其他的软件包,与之类似的命令是opkg -f /etc/opkg.conf install xxxxx)You should see: Quote:Downloading 

14、/snapshots/trunk/ar71xx/packages/Packages.gz. Updated list of available packages in /opt/tmp/var/opkg-lists/snapshots. Code:cat > /tmp/mnt/sda1/root/.profile << EOF export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib:/opt/usr/local/lib' export PATH='/

15、sbin:/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/usr/bin:/usr/sbin:/opt/usr/local/bin' export PS1='03301;31muh 03301;34mw $ 03300m' export TERMINFO='/opt/usr/share/terminfo' EOF 1.2 Paste the following on DD-WRT Web interface, Administration - Commands

16、. Click "Save Startup". Code:#! /bin/sh sleep 10  if -f /mnt/sda2/optware.enable ; then   if -f /mnt/sda1/optware.enable ; then    mount -o bind /tmp/mnt/sda1/etc /etc    sleep 1    mount -o bind /tmp/mnt/sda1/root

17、/tmp/root    sleep 1    mount -o bind /tmp/mnt/sda1/opt /opt    sleep 2 mount -o bind /tmp/mnt/sda1/opt /jffssleep 2  else    exit   fi  else   exit  fi  if -d /opt/usr ; then 

18、;  export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'   export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'  else   exit  fi 1.3 Reboot the router. 1.4 Using PuTTY, you should see a

19、 colorful prompt (in red and blue). Run the following: Code:opkg update 一般到这一步之前,nas就已经恢复了!You should see: Quote:Downloading /snapshots/trunk/ar71xx/packages/Packages.gz. Updated list of available packages in /opt/tmp/var/opkg-lists/snapshots. 

20、;- 2. MiniDLNA - 2.1 Preventing "Segmentation fault" error (Part 1/2): 2.1.1 Run the following, using PuTTY: Code:cd /tmp wget /backfire/10.03/ar71xx/packages/libc_-42_ar71xx.ipk opkg install libc_-42_ar71xx.ipk&

21、#160;2.2 Run the following, using PuTTY: Code:opkg update opkg install minidlna You should see: Quote:Installing minidlna (1.0.25-1) to root. Downloading /snapshots/trunk/ar71xx/packages/minidlna_1.0.25-1_ar71xx.ipk. Installing libpthread

22、 (-1) to root. Downloading /snapshots/trunk/ar71xx/packages/libpthread_-1_ar71xx.ipk. . . . Installing libuuid (2.21.2-1) to root. Downloading /snapshots/trunk/ar71xx/packages/libuuid_2.21.2

23、-1_ar71xx.ipk. Configuring libjpeg. Configuring libpthread. Configuring libogg. Configuring libexif. Configuring libflac. Configuring libvorbis. Configuring libuuid. Configuring libsqlite3. Configuring zlib. Configuring libbz2. Configuring libff

24、mpeg-mini. Configuring libid3tag. Configuring minidlna. Code:touch /tmp/mnt/sda1/minidlna.enable touch /tmp/mnt/sda2/minidlna.enable mkdir -p /tmp/mnt/sda1/dlna/Pictures mkdir -p /tmp/mnt/sda1/dlna/Music mkdir -p /tmp/mnt/sda1/dlna/Videos rm /opt/etc/config/mi

25、nidlna 2.3 You need to create a new /opt/etc/config/minidlna.conf file, with WinSCP, using the following content: Code:#port for HTTP (descriptions, SOAP, media transfer) traffic port=8200 # network interface to bind to (this is the only interface that will serve files) netw

26、ork_interface=br0 # set this to the directory you want scanned. # * if have multiple directories, you can have multiple media_dir= lines # * if you want to restrict a media_dir to a specific content type, you # can prepend the type, followed by a comma, to the directory: # +

27、 "A" for audio (eg. media_dir=A,/home/jmaggard/Music) # + "V" for video (eg. media_dir=V,/home/jmaggard/Videos) # + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures) media_dir=A,/mnt/sda1/dlna/Music media_dir=V,/mnt/sda1/dlna/Videos media

28、_dir=P,/mnt/sda1/dlna/Pictures # set this if you want to customize the name that shows up on your clients friendly_name=Media Server # set this if you would like to specify the directory where you want MiniDLNA to store its database and alb db_dir=/mnt/sda1/dlna #/mnt/tmp/mi

29、nidlna # this should be a list of file names to check for when searching for album art # note: names should be delimited with a forward slash ("/") album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg# set this to no to

30、disable inotify monitoring to automatically discover new files # note: the default is yes inotify=yes # set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO enable_tivo=no # set this to strictly adhere to DLNA standards. # * This

31、will allow server-side downscaling of very large JPEG images, # which may hurt JPEG serving performance on (at least) Sony DLNA products. strict_dlna=no # default presentation url is http address on port 80 presentation_url=:8200/ # notify interval in second

32、s. default is 895 seconds. notify_interval=895 # serial and model number the daemon will report to clients # in its XML description serial=12345678 model_number=1 2.4 Preventing "Segmentation fault" error (Part 2/2): 2.4.1 Run the following, using PuTTY:&

33、#160;Code:cd /tmp wget /snapshots/trunk/ar71xx/packages/libc_-1_ar71xx.ipk opkg install libc_-1_ar71xx.ipk You should see: Quote:Upgrading libc on root from -42 to -1. Removing obsolete file /opt/lib/libnsl.so.0.

34、0;Removing obsolete file /opt/lib/libnsl-.so. Removing obsolete file /opt/lib/ld-uClibc-.so. Removing obsolete file /opt/lib/libdl-.so. Removing obsolete file /opt/lib/libutil-.so. Removing obsolete file /opt/lib/libm-.so. Removing obs

35、olete file /opt/lib/libresolv.so.0. Removing obsolete file /opt/lib/libresolv-.so. Removing obsolete file /opt/lib/libuClibc-.so. Removing obsolete file /opt/lib/libcrypt-.so. Configuring libc. 2.5 Test it, running the following, using PuTTY: Cod

36、e:minidlna -f /opt/etc/config/minidlna.conf -R You should see your DLNA client (e.g. Samsung TV) connected to your router in seconds. 2.6 Paste the following on DD-WRT Web interface, Administration - Commands. Click "Save Startup". Code:#! /bin/sh sleep 6  if

37、-f /mnt/sda1/optware.enable ; then   if -f /mnt/sda2/optware.enable ; then    mount -o bind /tmp/mnt/sda2/etc /etc    sleep 1    mount -o bind /tmp/mnt/sda2/root /tmp/root    sleep 1    mount -o bind /tmp/mnt/sda2/o

38、pt /opt    sleep 2   else    exit   fi  else   exit  fi  if -d /opt/usr ; then   export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'   export PATH='/opt/bin:/opt/usr/bin

39、:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'   if -f /tmp/mnt/sda1/minidlna.enable ; then    sleep 2    minidlna -f /opt/etc/config/minidlna.conf -R   else    exit   fi  else   exit 

40、60;fi 2.7 Reboot the router. You should see your DLNA client (e.g. Samsung TV) connected to your router in 60 seconds. - 3. Transmission - 3.1 Run the following, using PuTTY: Code:cd /tmp wget /snapshots/trunk/ar71xx/packages/transmi

41、ssion-daemon_2.82-1_ar71xx.ipk wget /snapshots/trunk/ar71xx/packages/transmission-web_2.82-1_ar71xx.ipk opkg install transmission-daemon_2.82-1_ar71xx.ipk sleep 10 opkg install transmission-web_2.82-1_ar71xx.ipk sleep 10 transmission-daemon

42、60;sleep 20 killall transmission-daemon 3.2 Edit the existing /tmp/mnt/sda2/root/.config/transmission-daemon/settings.json file, with WinSCP, using the following content: Code:     "alt-speed-down": 50,     "alt-speed-enabled": false,&

43、#160;    "alt-speed-time-begin": 540,     "alt-speed-time-day": 127,     "alt-speed-time-enabled": false,     "alt-speed-time-end": 1020,     "alt-speed-up": 50,    

44、 "bind-address-ipv4": "",     "bind-address-ipv6": ":",     "blocklist-enabled": true,     "blocklist-url": "    "cache-size-mb": 2,     "dht-e

45、nabled": true,     "download-dir": "/tmp/mnt/sda1/dlna/Videos",     "download-limit": 100,     "download-limit-enabled": 1,     "download-queue-enabled": true,     "

46、download-queue-size": 5,     "encryption": 2,     "idle-seeding-limit": 30,     "idle-seeding-limit-enabled": false,     "incomplete-dir": "/tmp/root/Downloads",     &quo

47、t;incomplete-dir-enabled": false,     "lpd-enabled": false,     "max-peers-global": 35,     "message-level": 2,     "peer-congestion-algorithm": "",     "peer-limit-

48、global": 240,     "peer-limit-per-torrent": 60,     "peer-port": 25000,     "peer-port-random-high": 65535,     "peer-port-random-low": 49152,     "peer-port-random-on-start&q

49、uot;: false,     "peer-socket-tos": "default",     "pex-enabled": true,     "port-forwarding-enabled": true,     "preallocation": 1,     "prefetch-enabled": 0, 

50、    "queue-stalled-enabled": true,     "queue-stalled-minutes": 30,     "ratio-limit": 2,     "ratio-limit-enabled": false,     "rename-partial-files": true,     &qu

51、ot;rpc-authentication-required": true,     "rpc-bind-address": "",     "rpc-enabled": true,     "rpc-password": "guest",     "rpc-port": 9091,     "

52、rpc-url": "/transmission/",     "rpc-username": "guest",     "rpc-whitelist": "192.168.1.*",     "rpc-whitelist-enabled": false,     "scrape-paused-torrents-enabled"

53、: true,     "script-torrent-done-enabled": false,     "script-torrent-done-filename": "",     "seed-queue-enabled": false,     "seed-queue-size": 10,     "speed-limit-dow

54、n": 100,     "speed-limit-down-enabled": false,     "speed-limit-up": 100,     "speed-limit-up-enabled": false,     "start-added-torrents": true,     "trash-original-torrent-f

55、iles": false,     "umask": 18,     "upload-limit": 200,     "upload-limit-enabled": 1,     "upload-slots-per-torrent": 14,     "utp-enabled": true  3.3 Tests: 3.3.1 Run the following, using PuTTY: Code:export TRANSMISSION_WEB_HOME='/opt/usr/share/transmission/web/' transmission-daemon 3.3.2 Access http:/192.168

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论