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
Tedesco
Member
Posts : 3
Level :
Tech Points : 0
From: CAN
Posted:12/17/2009 10:09:00 PM # 11
ok, so I went to the root of the server and the command worked ... but now, this is the error

/ # ./usr/local/etc/my_mounts
+ LOGFILE=/tmp/my_mounts.log
+ MEDIA_SERVER=//192.168.1.102
+ rm /tmp/my_mounts.log rm: cannot remove `/tmp/my_mounts.log': No such file or directory
+ mkdir -p /tmp/ramfs/volumes/MOVIES
+ mkdir -p /tmp/ramfs/volumes/TV
+ umount /tmp/ramfs/volumes/MOVIES umount: Couldn't umount /tmp/ramfs/volumes/MOVIES: Invalid argument
+ umount /tmp/ramfs/volumes/TV umount: Couldn't umount /tmp/ramfs/volumes/TV: Invalid argument
+ mount -t cifs -o username=guest,password= //192.168.1.102/Volume_1/MOVIES /tmp/ramfs/volumes/MOVIES
+ mount -t cifs -o username=guest,password= //192.168.1.102/Volume_1/TV /tmp/ramfs/volumes/TV
+ set +x
/ #

I get the error from the logfile as this is the first time I ran the script, but I don't see the problem with the umount command. Any ideas?

  Reply Reply Quote & Reply Quote & Reply
Joe
Member
Posts : 23
Level :
Tech Points : 48
From: United States
Posted:12/17/2009 11:35:00 PM # 12

Quote:
Author: Tedesco Posted: 12/17/2009 10:09:00 PM

ok, so I went to the root of the server and the command worked ... but now, this is the error

/ # ./usr/local/etc/my_mounts
+ LOGFILE=/tmp/my_mounts.log
+ MEDIA_SERVER=//192.168.1.102
touch $LOGFILE     (this will create the file it doesn't exist and avoid the error in the next line)
rm $LOGFILE          (better syntax)
+ rm /tmp/my_mounts.log rm: cannot remove `/tmp/my_mounts.log': No such file or directory This is not a problem. The error occurred because the log file probably didn't exist. The script author decided to remove any previous log file.  Use:  rm $LOGFILE and touch $LOGFILE
+ mkdir -p /tmp/ramfs/volumes/MOVIES
+ mkdir -p /tmp/ramfs/volumes/TV
+ umount /tmp/ramfs/volumes/MOVIES umount: Couldn't umount /tmp/ramfs/volumes/MOVIES: Invalid argument Really don't think you need this line. Personally I'd remove it.
+ umount /tmp/ramfs/volumes/TV umount: Couldn't umount /tmp/ramfs/volumes/TV: Invalid argument
Really don't think you need this line. Personally I'd remove it
+ mount -t cifs -o username=guest,password= //192.168.1.102/Volume_1/MOVIES /tmp/ramfs/volumes/MOVIES
+ mount -t cifs -o username=guest,password= //192.168.1.102/Volume_1/TV /tmp/ramfs/volumes/TV
+ set +x
/ #

I get the error from the logfile as this is the first time I ran the script, but I don't see the problem with the umount command. Any ideas?
Response's are inline above (in red).

Joe

  Reply Reply Quote & Reply Quote & Reply
Tedesco
Member
Posts : 3
Level :
Tech Points : 0
From: CAN
Posted:12/18/2009 1:29:00 AM # 13
Thanks! This all seems to now execute fine, but when I view the my_mounts.log file, this is what I see:

mount: Mounting //192.168.1.102/Volume_1/MOVIES on /tmp/ramfs/volumes/MOVIES failed: No such device or address
mount: Mounting //192.168.1.102/Volume_1/TV on /tmp/ramfs/volumes/TV failed: No such device or address

Hardware: DLink DNS-323
IP of NAS: 192.168.1.102
IP of O!Play: 192.168.1.15


I can easily browse to my network throught he o!play, but I cannot get the mount to load the files. The o!play has mounted folders (TV and MOVIES) but there is no content -- I presume that is because it could not connect to the drive through the network.

In case this helps, when I am in the NETWORK menu on the O!Play I have to select /WORKGROUP/ then /DLINK-00EF32/ then /Volume_1/ then /MOVIES/

Any help would be appreciated.

  Reply Reply Quote & Reply Quote & Reply
Joe
Member
Posts : 23
Level :
Tech Points : 48
From: United States
Posted:12/18/2009 6:46:00 AM # 14
Telnet in and type "mount" on the command line and it will tell you what's mounted. Try executing your script from the command line to see if everything works.

For me, I had to put a sleep command in my script otherwise my mount commands don't work after a reboot. I think the sleep is necessary in my case because the network needs time to start(?).

Joe

  Reply Reply Quote & Reply Quote & Reply
bucarr
VIP Member
Posts : 14
Level :
Tech Points : 8
From: United States
Posted:12/18/2009 11:08:00 AM # 15

Using the info posted here, I've successfully mounted 3 NFS shares from my FreeBSD file server and can watch movies with ease.

Thanks to all who contributed to making this work.

Bucky

  Reply Reply Quote & Reply Quote & Reply
DK
Member
Posts : 1
Level :
Tech Points : 0
From: Austria
Posted:12/21/2009 3:47:00 AM # 16
Is it possible to Mount a drive which has SPACES in the Directory Name e.g. "Videos Summer 2009" on the Asus O!Play

  Reply Reply Quote & Reply Quote & Reply
mrbalky
Member
Posts : 3
Level :
Tech Points : 1
From: USA
Posted:1/1/2010 2:38:00 AM # 17
I don't think the mount command will take paths on cifs shares like that.  You would only be able to use //192.168.1.102/Volume_1.  But the o!play will traverse symlinks just fine, so I created symlinks in /tmp/ramfs/volumes to target directories instead.  Coincidentally, I use the same kind of structure you do, movies and television.  In short, you mount the remote file system, then create as many symlinks as you want.

So I took jpgeek's script (thanks!) and made a few tweaks into this new script, saved as /usr/local/etc/mountAndLink.sh.  The script allows you to mount a cifs filesystem, then create all of your symlinks in one command.

Here I need to make the disclaimer that, while it's working for me, this script is provided as-is, no guarantees, not responsible for damage, etc.:

# usage
if [ $# -lt 6 ]; then
  echo "usage:   mountAndLink.sh <server name> <share name> <userid> <password> <shortcut name> <path on share> [<shortcut name 2> <path 2> ...]"
  exit 1
fi

# o!play directories
MOUNT_POINT_ROOT=/usr/local/etc/mnt
LINKS_DIR=/tmp/ramfs/volumes

# Make the mount point name out of the file server name
MEDIA_SERVER="$1"
SHARE_NAME="$2"
USERID="$3"
PASSWORD="$4"

# Shift away the positional parameters, leaving the shortcut/path pairs left
shift 4

# Make the mount point if it doesn't exist; verify that it's
# a directory and not a file
MOUNT_POINT="$MOUNT_POINT_ROOT/$MEDIA_SERVER"
if [ -f "$MOUNT_POINT" ]; then
   echo "$MOUNT_POINT is a file"
   exit 1
fi

if [ ! -d "$MOUNT_POINT" ]; then
   mkdir -p $MOUNT_POINT
   if [ $? -ne 0 ]; then
      echo "making $MOUNT_POINT failed"
      exit 1
   fi
fi

# See if something's already mounted on the mount point
mount | grep "$MOUNT_POINT" > /dev/null
if [ $? -eq 0 ]; then
   echo "Already mounted on $MOUNT_POINT"
else
   # mount the file server
   echo mount -t cifs -o username=\"$USERID\",password=\"$PASSWORD\" \"//$MEDIA_SERVER/$SHARE_NAME\" \"$MOUNT_POINT\"
   mount -t cifs -o username="$USERID",password="$PASSWORD" "//$MEDIA_SERVER/$SHARE_NAME" "$MOUNT_POINT"
   if [ $? -ne 0 ]; then
      echo "mounting file server failed"
      exit 1
   fi
fi

# do the links
while [ $# -gt 1 ]
do
   TARGET_DIR="$MOUNT_POINT$2"
   SYMLINK_NAME="$LINKS_DIR/$1"
  
   if [ ! -d "$TARGET_DIR" ]; then
      echo "Path on share is not a directory: $TARGET_DIR"
   else
      echo ln -s "$TARGET_DIR" "$SYMLINK_NAME"
      ln -s "$TARGET_DIR" "$SYMLINK_NAME"
      if [ $? -ne 0 ]; then
         echo Failed to link "$SYMLINK_NAME" to "$TARGET_DIR"
      fi
   fi
   shift 2
done

# And if there's anything left over on the command line, show one last error
if [ $# -ne 0 ]; then
   echo "Shortcut name without target directory: '$1'"
fi

The script takes many parameters.   The first 4 are server name/ip, share name, auth user, auth password.  After that, it takes shortcut name and target directory name in pairs

So in your case, you would invoke the script like this (assuming "guest" and no password):
/usr/local/etc/mountAndLink.sh 192.168.1.102 Volume_1 guest "" MOVIES /MOVIES TV /TV
You should then be able to see MOVIES and TV in your "storage" screen.

In my case, I have a third directory pointing to my DVD ISO images.  I created a second script /usr/local/etc/mountServers.sh:
/usr/local/etc/mountAndLink.sh 192.168.1.51 video guest "" movies /video/movies television /video/television iso /iso

It's confusing, I know, but I have a share on the server called video, with iso and video on that share, and directories movies and television inside the video directory.  (I need to reorganize, but...)

This second script will be where I put another call to mountAndLink if/when I get another file server.

Finally, I've added a call to mountServers as the last line in my rcS file:

sleep 30
/usr/local/etc/mountServers.sh >/tmp/mountServers.out 2>/tmp/mountServers.err
HTH.

  Reply Reply Quote & Reply Quote & Reply
Walt
VIP Member
Posts : 5
Level :
Tech Points : 4
From: USA
Posted:1/2/2010 11:26:00 AM # 18
Thanks for the mountandlink script. It does exactly what I want it to do, and it works perfectly. I call mine from the /usr/local/etc/rcS script as:

sleep 30
. /usr/local/etc/mountandlink 192.168.1.5 500GB "" "" MOVIES /MOVIES 1>/tmp/mountandlink.log 2>&1

The IP address is a Belkin N+ Wireless Router that I only use as an access point and to put a couple large disks on my network.

The "500GB" is the name of the USB drive where I keep my movies.

As I said, works like a charm! Thank you very much!

  Reply Reply Quote & Reply Quote & Reply
nik0las
VIP Member
Posts : 1
Level :
Tech Points : 0
From: Spain
Posted:1/23/2010 1:28:00 AM # 19
Hi all,
I have my ASUS with NFS and work fine.
I count as I have done so if it helps you.

Environment:
- NAS: DNS323 with firwarwe 1.6 + funflug + NFS -- NAS ip:192.168.1.122 -- Share NFS:/mnt/HDMedia (I have yet to migrate to version 1.8 beta)
- Switch Ethernet: D-Link DGS-1008D GIGABIT
- Media Player 1: ASUS O!PLAY with firmware 1.17P
- Media Player 2: Tvix 6500

Steeps:
- Plug USB Stick in ASUS
- Telnet ASUS (password root)
- Edit rcS: vi /usr/local/etc/rcS
- Add this:
mkdir -p /tmp/ramfs/volumes/REDNAS
mount -t nfs -o intr,nfsvers=3,rsize=32768,wsize=32768,hard,tcp,nolock 192.168.1.122:/mnt/HDMedia  /tmp/ramfs/volumes/REDNAS/

Notes:
- The mount command is the same as the first post but changing the "lock" to "nolock". With ithis change the Asus starts immediately
- Before my mount command was this:
mount -t nfs -o nolock 192.168.1.122:/mnt/HDMedia /tmp/ramfs/volumes/REDNAS/  (more simple)
But I had to change it because I put my network and DNS323 from 100 Mbps to 1000Mbps (1 Gigabit) and the reproduction of the films was not smooth and with cuts
-
Although I also have access by CIFS, do not use it because with a high bitrate 1080p movies gives problems

Regards

  Reply Reply Quote & Reply Quote & Reply
frostiex
VIP Member
Posts : 6
Level :
Tech Points : 4
From: CAN
Posted:1/23/2010 6:28:00 AM # 20
My mount script is confirmed working...but is is not being excuted via the rcS file. Anyone know why? I am running 1.18N thanks

  Reply Reply Quote & Reply Quote & Reply
First  Prev  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.