PDA

Bekijk de volledige versie : mount NAS on asus wl500gp



tex
28-11-2011, 22:11
Hallo to everybody, does anyone know how to mount a NAS HD connected to the wl500gp with Oleg firmware? This is why i have to add a directory on the NAS to the share folders of twonky server or minidlna configuration page. The NAS has IP 192.168.1.168 and the folder i want to share is /public/media. On the NAS web page this folder is mounted in /mnt/ide4/public/media.
Thank for your kind help

!gm
28-11-2011, 23:25
well the webpage of your Kraun speaks of a share... but what protocol?
samba? (no, don't think so, cause you allready tried smbmount as suggested by wpte :cool: )

is it nfs? (recommended for such cross device-mounting things)

mount -t nfs HOSTIP:/PATH /MOUNTPOINT

wpte
29-11-2011, 00:03
ok you did:

mount -t smbfs -o //GIGABIT-NAS2/public/media /mnt/protected/storage

does the directory exist?

mkdir -p /mnt/protected/storage
Also, it might be better to use the ip, that way you don't have to relay on domain names which may or may not be resolved:

mount -t smbfs -o //192.168.1.168/public/media /mnt/protected/storage

if you execute lsmod you can however conclude you (most likely) don't have smbfs loaded up.
You should find the modules.tar.gz for your firmware revision.
if you've just downloaded from the google-code page you can get them here: http://code.google.com/p/wl500g/downloads/list
I include a modules.tar.gz with my builds as well (link in my signature).
The file you look for is called smbfs.ko, it can be found in */kernel/fs/smbfs/ inside the archive.

place it somewhere on your router and you can insmod it.

insmod /file/location/of/smbfs.ko

after that mount should work fine, since at this point your router will suddenly understand smb file system:D

tex
29-11-2011, 21:51
@!gm the file server on the NAS has a flag to enable NFS settings. If i follow your mount instruction i get the following


[admin@hd asus root]$ mount -t nfs 192.168.1.168:/public/media /mnt/protected/St
orage
mount: 192.168.1.168:/public/media failed, reason given by server: Permission denied
mount: mounting 192.168.1.168:/public/media on /mnt/protected/Storage failed: Bad file descriptor
Maybe it's a problem of username and password...but i don't know where put them. In any case in the share management page i put the flag to "grant access to all" and added 192.168.1.1 to "allowable IP".
Bad file descriptor...i don't know!!!

@WPTE
The folder /mnt/protected/storage exists and i can access it from my computer..
Your suggestion has always the same answer

[admin@hd asus root]$ mount -t smbfs -o 192.168.1.168:/public/media /mnt/protect
ed/Storage
mount: can't find /mnt/protected/Storage in /etc/fstab

If i type lsmod

[admin@hd asus root]$ lsmod
Tainted: P
usb-storage 63112 3
sd_mod 12900 6
scsi_mod 72736 2 [usb-storage sd_mod]
videodev 8752 0 (unused)
printer 12500 0 (unused)
ehci-hcd 28740 0 (unused)
usb-uhci 27412 0 (unused)
usbcore 78888 1 [usb-storage printer ehci-hcd usb-uhci]
ip_nat_ftp 3072 0 (unused)
ip_conntrack_ftp 4472 1
wl 897336 0 (unused)
et 29280 0 (unused)
igs 14436 0 (unused)
emf 18576 0 [igs]
I downloaded the file from google "modules-1.9.2.7-d-r2624.tgz" (your archive starts from 2907) but i'm not able to transfer it to the router, open the archive and do all the rest...i'm so sorry but my knowledge of Linux is very very low...

!gm
30-11-2011, 01:18
Maybe it's a problem of username and password...but i don't know where put them.


you are root on the router, but your nas is likely configured to map the root user to nobody and that is done for security reasons.

you can either mount the nfs share with any other user or export your share with the no_root_squash option (thats done on your nas)

you may read here http://www.tldp.org/HOWTO/NFS-HOWTO/


"not able to transfer it to the router" - there are several ways, what about wget? ;)

tex
30-11-2011, 07:40
i can only access to NAS web page and there is only possibility of enable/disable NFS. No configuring page.. no possibility to access with putty or to enable telnet/ssh on web page!:mad:
Samba is enabled also...there is a samba log file

wpte
30-11-2011, 22:21
I downloaded the file from google "modules-1.9.2.7-d-r2624.tgz" (your archive starts from 2907) but i'm not able to transfer it to the router, open the archive and do all the rest...i'm so sorry but my knowledge of Linux is very very low...

no worries!;)

you could open it with 7-zip on your pc if you want.

but this will do the trick on your router:

cd /mnt/
wget http://wl500g.googlecode.com/files/modules-1.9.2.7-d-r2624.tgz
#untar it:
tar zxvf ./modules-1.9.2.7-d-r2624.tgz
rm ./modules-1.9.2.7-d-r2624.tgz
you have a wl-500 router with the regular (d) firmware?

now you will have the directory /mnt/lib/ and find the file I told you about: smbfs.o (for kernel 2.4, kernel 2.6 uses .ko files)
just insmod the file like I explained and try again:)

for password protected shares try it this way:

mount -t smbfs //servername/sharename /mountdirectory -o username=myusername,password=mypassword
:)

tex
01-12-2011, 10:26
Thank you for your help, but i fell so near to the solution of my problem, but i can't reach it!!!! I've done insmod of smbfs.o (kernel is 2.4) thank's to your advise, but the result of mount is always the same

mount -t smbfs -o 192.168.1.168:/public/media /mnt/protec
t/Storage
mount: can't find /mnt/protect/Storage in /etc/fstab
There is no way to mount directly the NAS HD in the fstab like /opt and /mnt?
I'm so sorry of all the time i let you loose!

!gm
01-12-2011, 11:36
mkdir -p /mnt/protect/Storage

did you miss that? ^



There is no way to mount directly the NAS HD in the fstab like /opt and /mnt?
I'm so sorry of all the time i let you loose!

Sure you can do that:

thats the line. But make sure, that the mountpoint exists!!!

//192.168.1.168:/public/media /mnt/protect/Storage smbfs username=xxx,password=xxx 0 0

wpte
01-12-2011, 11:48
Thank you for your help, but i fell so near to the solution of my problem, but i can't reach it!!!! I've done insmod of smbfs.o (kernel is 2.4) thank's to your advise, but the result of mount is always the same

There is no way to mount directly the NAS HD in the fstab like /opt and /mnt?
I'm so sorry of all the time i let you loose!

hmm... not sure what that problem is...
I tried it in a different way. Instead of smbfs I used cifs to mount. cifs.o can also be found in the same fs (filesystem) directory as smbfs.o. please insmod it before doing this;)

I came across this nice site: http://opensuse.swerdna.org/susesambacifs.html
which explains how to do it.

when I try it, I do get an error:

mount -t cifs -o guest //192.168.2.1/share /tmp/mnt/samba
mount: mounting //192.168.2.1/share on /tmp/mnt/samba failed: Invalid argument

but guess what, df says it's mounted, plus I can browse files in /tmp/mnt/samba :D

it also explains how to do it in fstab. for that you have to place the cifs.o file in your flashfs space tho, since you can't read a file from a drive that isn't mounted:)

for example if you copy the cifs.o file like this:

cp /place/of/cifs.o /tmp/local/sbin/
after that, you can change your pre-mount:

vi /tmp/local/sbin/pre-mount
by entering this line directly after #! /bin/sh (on a new line obviously):

insmod /tmp/local/sbin/cifs.o

if you save the file now, and save the flashfs:

flashfs save
flashfs commit
flashfs enable

it should be done, after a reboot things will be mounted from your fstab:)

tex
01-12-2011, 12:35
@ !gm
The folder /mnt/protect/Storage exists and /mnt is correctly mounted in fstab. I can access it from windows and trough Putty. So i don't understand that error message!

@WPTE
This option looks nice, i'll try as soon as i go back home. The insmod procedure is the same of smbfs, just change the file? What i would like to try is the permanent way in the fstab, so after putting the insmod of cifs.o in pre-mount i must vi the fstab and add a line like this

//192.168.1.168/public/media /mnt/protected/Storage cifs guest,_netdev 0 0
all this after checking if the system works in the temporary way....
I will try tonight
thank you

tex
02-12-2011, 21:30
This is a summary of what i've done.
insmod cifs.o
[
admin@hd asus root]$ insmod /mnt/lib/modules/2.4.37.11/kernel/fs/cifs/cifs.o
[admin@hd asus root]$
no error messages...
create new folder

[admin@hd asus root]$ mkdir -p /mnt/protected/share
[admin@hd asus root]$
mount

[admin@hd asus root]$ mount -t cifs -o guest //192.168.1.168/public/media/Video
/film /mnt/protected/share
mount: mounting //192.168.1.168/public/media/Video/film on /mnt/protected/share failed: Invalid argument
The only difference from your line is that you put tmp/mnt/share (must i put tmp before /mnt/protected/share ??
Same error like WPTE (invalid argument), but exploring the /mnt/protected/share folder from my pc, it is empty...
And this is my df
[
admin@hd asus root]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 3072 3072 0 100% /
/dev/root 3072 3072 0 100% /
tmpfs 15024 500 14524 4% /tmp
/dev/discs/disc0/part2
16010232 631996 14564948 5% /opt
/dev/discs/disc0/part3
464210468 13670452 450540016 3% /mnt
[admin@hd asus root]$
nothing seem different from before...:(
My router had been configured loading Headstart II with RAAS image disabling some feature in /opt/etc/init.d (because was too slow)


DK70mysqld
DS45php
DS58proftpd
DS70mysqld
DS80busybox_httpd
DS80lighttpd
DS90mediatomb
rc.unslung
S05syslogd
S10xinetd
S10cron
S60transmission
S90twonkymedia
S80samba
Maybe i've disabled some feature necessary for what i want to do???

wpte
02-12-2011, 21:56
I'm not sure you can create a mount inside a mounted thingy...
try creating a mount in /tmp/mnt/
so /tmp/mnt/mymount for example.

also are you sure it's not protected by a password?

tex
03-12-2011, 12:02
[admin@hd asus root]$ mount -t cifs -o guest //192.168.1.168/public/media/Video/
film /tmp/mnt/protected/share
mount: mounting //192.168.1.168/public/media/Video/film on /tmp/mnt/protected/share failed: No such file or directory
Quite disapponted!!!

!gm
03-12-2011, 13:41
try the --verbose argument for detailed information

http://linux.die.net/man/8/mount.cifs

wpte
03-12-2011, 16:15
Quite disapponted!!!

yeah, but it's not the same error message is it?
this error message shows that you have not created the directories on your router...

Also another point, I might have completely overlooked (silly me)
you're not trying to mount a share but a directory in a share.
In samba you can create several shares, in this case //192.168.1.168/public is your share, try to mount that.

tex
04-12-2011, 23:01
After many hours this is the only thing that seems to work but with this error, after insmod smbfs.o


smbmount //192.168.1.168/public /mnt/protected/storage
INFO: Debug class all level = 1 (pid 27792 from pid 27792)
Password:
Anonymous login successful
cannot mount on /mnt/protected/storage: Stale NFS file handle
smbmnt failed: 1
this is

showmount -e 192.168.1.168
Export list for 192.168.1.168:
/mnt/md1/backup *
/mnt/usb4/backup *
/mnt/usb3/backup *
/mnt/usb2/backup *
/mnt/usb1/backup *
/mnt/ide4/backup *
/mnt/ide3/backup *
/mnt/ide2/backup *
/mnt/ide1/backup *
/mnt/ide4/public (everyone)

!gm
05-12-2011, 11:46
don't mix NFS and CIFS

showmount - show mount information for an NFS server

http://linux.about.com/library/cmd/blcmdl8_showmount.htm


but as you can see, the exportlist contains the directory, you want to mount...


mount -t nfs 192.168.1.168:/mnt/ide4/public /mnt/protected/storage

tex
05-12-2011, 15:14
i already tried that mount. Before mkdir -p tmp/mnt/protected/share
then

[admin@hd asus root]$ mount -t nfs //192.168.1.168:/mnt/ide4/public tmp/mnt/protected/share
mount: RPC: Timed out
mount: mounting //192.168.1.168:/mnt/ide4/public on /tmp/mnt/protected/share failed: Bad file descriptor

Maybe the problem here is this?

insmod /mnt/lib/modules/2.4.37.11/kernel/fs/nfs/nfs.o
insmod: unresolved symbol rpc_wake_up_task
In another post i've read that i need to insmod 2 more modules (sunrpc.o and lockd.o) but one of them isn't in the file i downloaded for my firmware version....so again at the beginning!!!!!
And after this try, the folder /mnt/protected/share and /storage/ disappeared from the computer...

!gm
05-12-2011, 16:13
modules-1.9.2.7-d-r2624.tgz\.\lib\modules\2.4.37.11\kernel\fs\lockd

and

modules-1.9.2.7-d-r2624.tgz\.\lib\modules\2.4.37.11\kernel\net\sunrp c

tex
05-12-2011, 22:12
Nothing to do...the answer is always the same

insmod /mnt/lib/modules/2.4.37.11/kernel/fs/nfs/nfs.o
mount -t nfs //192.168.1.168:/mnt/ide4/public /mnt/protected/share
mount: RPC: Timed out
mount: mounting //192.168.1.168:/mnt/ide4/public on /mnt/protected/share failed: Bad file descriptor

!gm
06-12-2011, 00:29
you insmodded the other two kernel modules, before the nfs module?

tex
06-12-2011, 07:01
you insmodded the other two kernel modules, before the nfs module?

yes, thank you for telling me where sunrpc was... i insmmod before sunrpc then lockd and finally correctly nfs.o (without errors). The error RPC: timed out arrives after some time (30-40 sec)

Also in another post they didn't success in mounting nsf filesystem of NAS http://wl500g.info/showthread.php?t=21280 and used smbmount http://wl500g.info/showthread.php?t=21280 That's why i tried smbmount getting the error i told you before...

smbmount //192.168.1.168/public /mnt/protected/storage
INFO: Debug class all level = 1 (pid 27792 from pid 27792)
Password:
Anonymous login successful
cannot mount on /mnt/protected/storage: Stale NFS file handle
smbmnt failed: 1
and after this the /mnt/protected/storage disappeared when exploring from windows PC

!gm
06-12-2011, 11:45
ähhhm on your NAS, try disabling NFS or remove the export

at least you should check error messages on your NAS als well :rolleyes:

Did you ever google such errors?

tex
06-12-2011, 14:28
No hope with NFS and CIF.
Disabled NFS in the NAS, insmod smbfs.o, this is the last error.....

smbmount //192.168.1.168/public /mnt/protected/share
INFO: Debug class all level = 1 (pid 257 from pid 257)
Password:
Anonymous login successful
Can't write mount entrysmbmnt failed: 1

tex
07-12-2011, 18:28
:(Last informations about this too long post. After that i will renounce...

some log information taken from NAS

crond 2.3.2 dillon, started, log level 8
^MStarting pid 1785, console /dev/console: '/sbin/getty'
samba working on NAS

smbd version 3.0.25a started.
disable NFS in NAS web-interface

NFS: NFS Server disabled OK
try to smbmount from ASUS

[admin@hd asus root]$ smbmount //192.168.1.168/public /mnt/protected/NAS
INFO: Debug class all level = 1 (pid 15345 from pid 15345)
Password:
Anonymous login successful
cannot mount on /mnt/protected/NAS: Stale NFS file handle
smbmnt failed: 1
and this is log from NAS

hd asus (192.168.1.1) connect to service public initially as user guest-share (uid=7002, gid=7001) (pid 1992)
hd asus (192.168.1.1) closed connection to service public
:(