SEARCH
ASUS Member ID
Password
Forgot password?
Join member

ASUS Support Home Location : Forum > Multimedia > O!Play HDP-R1  
  Forum  
  Topic : [Sharing]Auto mount a share at boot time New Topic
Joe
Member
Posts : 23
Level :
Tech Points : 48
From: United States
Posted:11/2/2009 1:58:00 AM # 1
This thread is listed in the Elite Posts.
I've found a method to have an NFS (or CIFS) share show up as a storage device on the Asus OPlay. The mount occurs during the boot process, so it's done automatically. Once the share is mounted it doesn't affect the usb port storage functionality.

*** I don't recommend you make any changes to your OPlay and am not responsible for any damage done to your devices. ***

IMPORTANT NOTES:
- Currently tested using firmware 1.13N

- NFS works perfectly streaming HD video over wireless-g, whereas CIFS over wireless is choppy and not watchable - would be interesting to know why?

- See no reason you can not have multiple NFS mounts.

- Most likely will have to reload hacks after every firmware upgrade

- NFS mount takes 60-90 minutes to complete - not sure why (may have to do with no portmapper on Asus(?)) - may be others can help here!

- OPlay reboots take 60-90 seconds (probably because of the NFS mount) - no remote commands work until NFS completes, however you can still telnet in.

- Concerned about the mount command not returning and possibly having it continuously active trying to connect

- The mount is persistent across power on/off (from remote control) and reboots

- Reboot occurs after power outage or typing reboot from telnet - rcS is a start-up script run ONLY at boot time

################################
Setup NFS export on Linux Server
################################
edit /etc/exports to share mount point

enable nfs in chkconfig so to start at boot

start nfs: /etc/init.d/nfs start


#########################################
Manually Setup Asus OPlay to NFS mount Linux share
#########################################
telnet in

create mount point on the OPlay by typing:
    mkdir -p /tmp/ramfs/volumes/core

then mount the share using the following command:
    mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,udp,lock core:/disk2/share /tmp/ramfs/volumes/core


####################################################
Setup Asus OPlay to mount NFS Linux share at startup
####################################################
telnet in

make a backup copy of the /usr/local/etc/rcS file

Place the following code at the very end of the /usr/local/etc/rcS file:

# My mod's to mount NFS share during bootup
# use -p so command returns w/o error if directory exists already
mkdir -p /tmp/ramfs/volumes/core
# mount takes 60-90 seconds to complete
# use & at end so to make background process and hopefully not hold up boot process
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,udp,lock core:/disk2/share /tmp/ramfs/volumes/core &

Once edit is compete - save the rcS file and pull the power to allow the Asus to reboot (which runs the start-up script rcS). Display and remote control hang for about 60-90 seconds during the mount.

The same procedure should work with CIFS (Windows share) using the appropriate parameters in the mount command, although I've not tried or tested it.

Thanks,
JoeK

  Reply Reply Quote & Reply Quote & Reply
ONG
Member
Posts : 1
Level :
Tech Points : 2
From: USA
Posted:11/3/2009 9:51:00 AM # 2
Hi Joe,

Your steps (Setup Asus OPlay to mount NFS Linux share at startup) worked fine for me. Thank you.

But, when i tried to mount NFS to multiple drives in my same NAS (DLINK DNS343), it only allow me to mount on the first drive (nas_v1)  that I specified in rcS file.

Example:
m
kdir -p /tmp/ramfs/volumes/nas_v1
mkdir -p /tmp/ramfs/volumes/nas_v2
mkdir -p /tmp/ramfs/volumes/nas_v3
mkdir -p /tmp/ramfs/volumes/nas_v4

mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,lock dlink-b64fc:/mnt/HD_a2  /tmp/ramfs/volumes/nas_v1 &

mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,lock dlink-b64fc:/mnt/HD_b2  /tmp/ramfs/volumes/nas_v2 &

mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,lock dlink-b64fc:/mnt/HD_c2  /tmp/ramfs/volumes/nas_v3 &

mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,lock dlink-b64fc:/mnt/HD_d2  /tmp/ramfs/volumes/nas_v4 &

Any advise that i can use to resolve this.

Thanks,
SP

Quote:
Author: Joe Posted: 11/2/2009 1:58:00 AM

I've found a method to have an NFS (or CIFS) share show up as a storage device on the Asus OPlay. The mount occurs during the boot process, so it's done automatically. Once the share is mounted it doesn't affect the usb port storage functionality.

*** I don't recommend you make any changes to your OPlay and am not responsible for any damage done to your devices. ***

IMPORTANT NOTES:
- Currently tested using firmware 1.13N

- NFS works perfectly streaming HD video over wireless-g, whereas CIFS over wireless is choppy and not watchable - would be interesting to know why?

- See no reason you can not have multiple NFS mounts.

- Most likely will have to reload hacks after every firmware upgrade

- NFS mount takes 60-90 minutes to complete - not sure why (may have to do with no portmapper on Asus(?)) - may be others can help here!

- OPlay reboots take 60-90 seconds (probably because of the NFS mount) - no remote commands work until NFS completes, however you can still telnet in.

- Concerned about the mount command not returning and possibly having it continuously active trying to connect

- The mount is persistent across power on/off (from remote control) and reboots

- Reboot occurs after power outage or typing reboot from telnet - rcS is a start-up script run ONLY at boot time

################################
Setup NFS export on Linux Server
################################
edit /etc/exports to share mount point

enable nfs in chkconfig so to start at boot

start nfs: /etc/init.d/nfs start


#########################################
Manually Setup Asus OPlay to NFS mount Linux share
#########################################
telnet in

create mount point on the OPlay by typing:
    mkdir -p /tmp/ramfs/volumes/core

then mount the share using the following command:
    mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,udp,lock core:/disk2/share /tmp/ramfs/volumes/core


####################################################
Setup Asus OPlay to mount NFS Linux share at startup
####################################################
telnet in

make a backup copy of the /usr/local/etc/rcS file

Place the following code at the very end of the /usr/local/etc/rcS file:

# My mod's to mount NFS share during bootup
# use -p so command returns w/o error if directory exists already
mkdir -p /tmp/ramfs/volumes/core
# mount takes 60-90 seconds to complete
# use & at end so to make background process and hopefully not hold up boot process
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,udp,lock core:/disk2/share /tmp/ramfs/volumes/core &

Once edit is compete - save the rcS file and pull the power to allow the Asus to reboot (which runs the start-up script rcS). Display and remote control hang for about 60-90 seconds during the mount.

The same procedure should work with CIFS (Windows share) using the appropriate parameters in the mount command, although I've not tried or tested it.

Thanks,
JoeK


  Reply Reply Quote & Reply Quote & Reply
Joe
Member
Posts : 23
Level :
Tech Points : 48
From: United States
Posted:11/3/2009 8:51:00 PM # 3
Hi SP,

I've successfully added a second NFS mount w/o any issues on my OPlay. I did the second mount from the command line, but shouldn't make difference if comes from the rcS startup script.

Some things to check:

-  run the mount from OPlay command line and see if you get any error message

- my mounts take about 60-90 seconds to complete - do yours? If so, did you give it enough time to complete. You can type "ps -el" and see if the mount command is in the process list on the OPlay

- telnet into the OPlay and type "mount" (w/o any arguments) and see what's mounted.

Pls report back when successful.

Thanks,
Joe

  Reply Reply Quote & Reply Quote & Reply
Joe
Member
Posts : 23
Level :
Tech Points : 48
From: United States
Posted:11/13/2009 8:25:00 AM # 4
Changing my NFS mount command option to "nolock" fixed the 60-90sec delay I was experiencing. Now the mount command returns immediately. I updated to original post.

Joe

  Reply Reply Quote & Reply Quote & Reply
Wzl
Member
Posts : 9
Level :
Tech Points : 2
From: CAN
Posted:11/15/2009 2:34:00 AM # 5
UPDATE: I saw in another post that people were adding cifs mounts at the bottom of the /usr/local/etc/dvdplayer/script/run_tail script, so I tried that, and it's working now. 

-------------

How can I check that the rcS file is executing correctly?

The mkdir commands seems to execute successfully, however the mount commands aren't working.  If I manually run them on the command line, that works.

Here's the section I have at the bottom of /usr/local/etc/rcS

# My mod's to mount NFS share during bootup
# use -p so command returns w/o error if directory exists already
mkdir -p /tmp/ramfs/volumes/tv_shows
mkdir -p /tmp/ramfs/volumes/movies
# mount takes 60-90 seconds to complete
# use & at end so to make background process and hopefully not hold up boot process
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,udp,nolock 192.168.0.188:/d/tv_shows /tmp/ramfs/volumes/tv_shows &
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,udp,nolock 192.168.0.188:/d/movies /tmp/ramfs/volumes/movies &

  Reply Reply Quote & Reply Quote & Reply
Tony
Member
Posts : 2
Level :
Tech Points : 0
From: CAN
Posted:12/5/2009 1:54:00 AM # 6
I am also trying to mount my NFS shares from the NAS drive and I'm stuck.

My 2 NFS mounts from my 2 hard drives inside the NAS are as follows:

\\192.168.0.10\Shared_Video1
\\192.168.0.10\Shared_Video2

where

192.168.0.10 is the IP for my NAS
Shared_Video1 = name of 1st hard drive in NAS
Shared_Video2 = name of 2nd hard drive in NAS

I first tried to manually mount one drive first

mkdir -p /tmp/ramfs/volumes/Shared_Video1
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,udp,nolock 192.168.0.10:/Shared_Video1 /tmp/ramfs/volumes/Shared_Video1 &

But it gives me the following error:

/usr/local/etc # mount: RPC: Unable to receive; errno = Connection refused
mount: nfsmount failed: Bad file descriptor
mount: Mounting 192.168.0.10:/Shared_Video1 on /tmp/ramfs/volumes/Shared_Video1 failed: Bad file descriptor

What am I doing wrong in the mount command?

  Reply Reply Quote & Reply Quote & Reply
Joe
Member
Posts : 23
Level :
Tech Points : 48
From: United States
Posted:12/5/2009 6:51:00 AM # 7
Hi Tony,

Try mounting with a much simpler command.

For example:
mount -t nfs -o nolock 192.168.0.10:/Shared_Video1 /tmp/ramfs/volumes/Shared_Video1

It may not like one of the options (i.e. nfsvers=3)

Joe

  Reply Reply Quote & Reply Quote & Reply
Joe
Member
Posts : 23
Level :
Tech Points : 48
From: United States
Posted:12/5/2009 9:49:00 AM # 8

Quote:
Author: Tony Posted: 12/5/2009 8:38:00 AM

mount -t nfs -o nolock 192.168.0.10:/Shared_Video1 /tmp/ramfs/volumes/Shared_Video1

but it gave the following error:

mount: 192.168.0.10:/Shared_Video1 failed, reason given by server: Permission denied
mount: nfsmount failed: Bad file descriptor
mount: Mounting 192.168.0.10:/Shared_Video1 on /tmp/ramfs/volumes/Shared_Video1 failed: Bad file descriptor




AFAIK, your mount command looks fine. I'd recommend checking the settings on your NAS device, especially since the OPlay is complaining about permissions (as highlighted above). Is your NAS setup to allow the OPlay to access it as an NFS share?

  Reply Reply Quote & Reply Quote & Reply
jpgeek
VIP Member
Posts : 34
Level :
Tech Points : 48
From: United States
Posted:12/16/2009 5:37:00 AM # 9

I recently upgraded to 1.17 hoping it was better than 1.13 which I had to downgrade to 1.11 due to bugs.  I'm not sure 1.17 is better but I'm trying to stick it out since I know how to hack the box and can setup my mounts manually bypassing the troublesome network and PnP stuff.

1.17 no longer executes run_tail from the writable /usr/local/etc/dvdplayer/script but rather looks to the RO location at /etc/dvdplayer/script.  So the original post where you have to modify the rcS is now my only option.  This is a very dangerous file to mess with b/c one wrong move the box can be rendered unusable.  So I add one line at the end after backing rcS up to minimize my exposure and have it execute my personal mount script below.  Good luck and be careful.

logon to ASUS as root

cd /usr/local/etc
cp rcS rcS.sav
vi rcS
move to the last row and insert

. /usr/local/etc/my_mounts 1>/tmp/rcS.log 2>&1

save your changes "ZZ"

Now create your own script called my_mounts:

cd /usr/local/etc
vi my_mounts
insert the following rows

set -x
#sleep 10
LOGFILE="/tmp/my_mounts.log"
MEDIA_SERVER="//143.166.27.102"
rm $LOGFILE
mkdir -p /tmp/ramfs/volumes/Movies 1>>$LOGFILE 2>&1
mkdir -p /tmp/ramfs/volumes/Pictures 1>>$LOGFILE 2>&1
mkdir -p /tmp/ramfs/volumes/Music 1>>$LOGFILE 2>&1
mkdir -p /tmp/ramfs/volumes/My_Video_Projects 1>>$LOGFILE 2>&1
umount /tmp/ramfs/volumes/Movies
umount /tmp/ramfs/volumes/Pictures
umount /tmp/ramfs/volumes/Music
umount /tmp/ramfs/volumes/My_Video_Projects
mount -t cifs -o username="guest",password="" $MEDIA_SERVER/Video2 /tmp/ramfs/volumes/Movies 1>>$LOGFILE 2>&1
mount -t cifs -o username="guest",password="" $MEDIA_SERVER/Pictures /tmp/ramfs/volumes/Pictures 1>>$LOGFILE 2>&1
mount -t cifs -o username="guest",password="" $MEDIA_SERVER/napster /tmp/ramfs/volumes/Music 1>>$LOGFILE 2>&1
mount -t cifs -o username="guest",password="" $MEDIA_SERVER/My_Video_Collection /tmp/ramfs/volumes/My_Video_Projects 1>>$LOGFILE 2>&1
set +x

 

Save the file “ZZ”

chmod 700 my_mounts

Test execute my_mounts before reboot

. /usr/local/etc/my_mounts

  Reply Reply Quote & Reply Quote & Reply
Tedesco
Member
Posts : 3
Level :
Tech Points : 0
From: CAN
Posted:12/17/2009 10:31:00 AM # 10
Hi, Thanks for this guide.

I have followed this to a T, and when I go to run the command ./usr/local/etc/my_mounts, I get the following message

-sh: ./usr/local/etc/my_mounts: not found

but, if I browse to /usr/local/etc/ and do a ls -l, I get:

-rwx------ 1 root root 476 Dec 16 09:17 my_mounts

Also, if I type: cat my_mounts, I get:

/usr/local/etc # cat my_mounts
set -x
#sleep 10
LOGFILE="/tmp/my_mounts.log"
MEDIA_SERVER="//192.168.1.102"
rm $LOGFILE
mkdir -p /tmp/ramfs/volumes/MOVIES >>$LOGFILE 2>&1
mkdir -p /tmp/ramfs/volumes/TV >>$LOGFILE 2>&1
umount /tmp/ramfs/volumes/MOVIES
umount /tmp/ramfs/volumes/TV
mount -t cifs -o username="guest",password="" $MEDIA_SERVER/Volume_1/MOVIES /tmp/ramfs/volumes/MOVIES 1>>$LOGFILE 2>&1
mount -t cifs -o username="guest",password="" $MEDIA_SERVER/Volume_1/TV /tmp/ramfs/volumes/TV 1>>$LOGFILE 2>&1
set +x

Any clues? I have very limited linux experience, so I am embarassed that it might be something really simple. Your help is appreciated.

  Reply Reply Quote & Reply Quote & Reply
1 2 3 4 5 6 7 8 9  Next  Last
Previous Topic:: Next Topic
Feedback for our Website ModeratorModerator: New Topic Related FAQ Related FAQ Forum Home Forum Home
Forum Model :
Legal Information | Privacy Policy | Sitemap | Contact Us | ASUS Global
  ©ASUSTeK Computer Inc. All rights reserved.