cifs

All about firmwares for routers. Support for RouterTech firmwares is here too.
User avatar
cicala
Regular
Regular
Posts: 47
Joined: Sun Nov 26, 2006 2:08 pm

cifs

Post by cicala » Thu Jun 07, 2007 2:50 pm

hello, and thanx again for the endless work...
i got some questions about mounting cifs

Code: Select all

    Syntax:
       mount -t cifs /<anything> <mountpoint> -o user=MyWindowsLoginName,pass=MyWindowsPassword,unc=//<server_ipaddress>/<share_name>
    Example:
    mount -t cifs /blah /cifs -o user=freddy,pass=ddyfre,unc=//192.168.1.3/scratch_drive
    This will give you read/write access (at "/cifs/") to the shared directory: "192.168.1.3/scratch_drive"
following this info im trying to mount my samba share on the router with:

Code: Select all

mount -t cifs /share /cifs -o user=username,pass=userpass,unc=//192.168.1.2/home/username/share 
but i keep getting

Code: Select all

mount: Mounting /share on /cifs failed: Invalid argument
obviously //192.168.1.2/home/username/share is mountable and i can access it from another pc using windoz...
the share and samba server are on a ubuntu machine connected via cable to the router and the router is in the host.allow list...

also i was wondering if the minix partition is deleted on reboot (when not unmounted) that means that its useless in case of a power failure? or does the data loss refer to everything that was written after the last mount/unmount?

last: could someone help in making a script to put in the router in order to shorten the env string for mounting cifs... due to the character limit of the adam2 env (64?)
User avatar
SyBorg
Ex RouterTech Team
Ex RouterTech Team
Posts: 1621
Joined: Mon Apr 17, 2006 4:09 pm
Location: Berkshire
Contact:

Re: cifs

Post by SyBorg » Thu Jun 07, 2007 4:00 pm

Not played with cifs so not able to comment. I assume though that /share was created on the router? Why not use /cifs as this mount point was created for the purpose?
cicala wrote: also i was wondering if the minix partition is deleted on reboot (when not unmounted) that means that its useless in case of a power failure? or does the data loss refer to everything that was written after the last mount/unmount?
For minix, the partition is not deleted on reboot but, as you said, data can be lost if there is a change since the last successful umount. This means the partition is useful for storing user scripts etc but any dynamic data written to it has a fair chance of vanishing.
We learn something every day, and lots of times it’s that what we learned the day before was wrong.
—Bill Vaughan
User avatar
SyBorg
Ex RouterTech Team
Ex RouterTech Team
Posts: 1621
Joined: Mon Apr 17, 2006 4:09 pm
Location: Berkshire
Contact:

Re: cifs

Post by SyBorg » Thu Jun 07, 2007 4:06 pm

SyBorg wrote:Not played with cifs so not able to comment. I assume though that /share was created on the router? Why not use /cifs as this mount point was created for the purpose?
.
Ignore this. I reread the syntax :D
We learn something every day, and lots of times it’s that what we learned the day before was wrong.
—Bill Vaughan
User avatar
cicala
Regular
Regular
Posts: 47
Joined: Sun Nov 26, 2006 2:08 pm

Post by cicala » Thu Jun 07, 2007 4:23 pm

tnx SyBorg
wonderful... then ill use the minix fs since all i needed was to execute a script... and there will be no character limit problems...

although just for curiosity if someone has more info to give on cifs it would be appreciated

cicala
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Post by mstombs » Thu Jun 07, 2007 4:45 pm

I can check later but this is what worked with a development firmware for me

Code: Select all

/var # mount -t cifs /gpl /cifs -o user=user,pass=pass,unc=//192.168.1.3/user
which mapped to the linux path /home/user/gpl on my samba machine.

I cannot be too sure how I set samba up but I know there is a samba user as well as linux user. When I login from windows the directory defaults to /home/user
Last edited by mstombs on Thu Jun 07, 2007 6:38 pm, edited 1 time in total.
User avatar
cicala
Regular
Regular
Posts: 47
Joined: Sun Nov 26, 2006 2:08 pm

Post by cicala » Thu Jun 07, 2007 6:21 pm

mstombs wrote:I can check later but this is what worked with a development firmware for me

Code: Select all

/var # mount -t cifs /gpl /cifs -o user=user,pass=pass,unc=//192.168.1.3/user
which mapped to the linux path /home/user/gpl on my samba machine.

I cannot be too sure how I set samba up but I know there is a samba user as well as linux user. When I login from windows the directory defaults to /home/user
YESSSSS
it works 8)

Code: Select all

mount -t cifs /share /cifs -o user=username,pass=userpass,unc=//192.168.1.2/username
where the directory is actually on 192.168.1.2/home/username/share
and the smb.conf reads:

Code: Select all

[username]
path = /home/username/share
comment = lince
available = yes
browsable = yes
public = yes
writable = no
also worked for:

Code: Select all

mount -t cifs /samba /cifs -o user=username,pass=userpass,unc=//192.168.1.2/samba
where smb.conf reads:

Code: Select all

[samba]
   path = /media/tmp1/share/samba
   comment = samba
   public = yes
   guest ok = yes
   writable = yes
   wide links = no
so i guess the trick is to have the string as follows:

Code: Select all

mount -t cifs /"name of the directory" /cifs -o user=username,pass=userpass,unc=//192.168.1.2/"name in [ ] in smb.conf"
tnx mstombs... u made my day ;)
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Post by mstombs » Thu Jun 07, 2007 6:38 pm

Glad to be of service!

I set up samba some months ago using a gui - where do I find my working smb.conf file? Guess I could grep for it...

What are you going to use the cifs directory for? I got it working, thought "that's nice" but haven't used it since!
User avatar
cicala
Regular
Regular
Posts: 47
Joined: Sun Nov 26, 2006 2:08 pm

Post by cicala » Thu Jun 07, 2007 7:11 pm

i have smb.conf in /etc/samba/smb.conf

i was going to use the cifs for the startup script.. but now i think ill use minix :)

but ill store the different dsp and other utilities that can be usefull... so the router can run them ;)

actually we could make a really small kernel now and have everything run from the cifs... so more mem for the router :idea:

well.. guess its just cool to have it ... lol ...
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12066
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Post by thechief » Thu Jun 07, 2007 7:38 pm

I am putting together a repository of AR7 binaries (GNU coreutils, fileutils, inetutils, bash, microperl, snort, clamav, etc) which could be run from a cifs share. Some are working fine at the moment, while others (e.g., snort) still need some work. Perhaps one day I will start releasing the repository (with all disclaimers as usual).
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Post by mstombs » Thu Jun 07, 2007 7:59 pm

Is the startup order of RT 2.3 OK to be able to link and use cifs mounted DSL dsp/atm drivers, there's quite a few of them around!
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12066
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Post by thechief » Thu Jun 07, 2007 8:20 pm

mstombs wrote:Is the startup order of RT 2.3 OK to be able to link and use cifs mounted DSL dsp/atm drivers, there's quite a few of them around!
The cifs module is built into the kernel, and so gets loaded early enough. However, unless the init scripts are edited to mount the shared resource at a much earlier stage, then there is no way to load a dsp/atm driver from a cifs resource. And even if you could do it, I am not sure what performance impact it would have on the system. Cifs resources are not the fastest around.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
User avatar
cicala
Regular
Regular
Posts: 47
Joined: Sun Nov 26, 2006 2:08 pm

Post by cicala » Fri Jun 08, 2007 9:00 am

well... if u need a tester... ;)
User avatar
studioeng
Experienced
Experienced
Posts: 454
Joined: Mon Oct 23, 2006 11:59 pm
Location: Dorset, England
Contact:

Re: cifs

Post by studioeng » Wed Sep 02, 2009 4:22 pm

I'm sorry guys, I've been trying at this for the best part of an hour and I can't get my head round it.

I'm trying the command:
mount -t cifs /share /cifs -o user=user,pass=pass,unc=//server_ip/share

All I get is:
mount: mounting /share on /cifs failed: Invalid argument

Another error I get is:
mount: can't find /cifs in /etc/fstab

Believe me I have tried all sorts of combinations and all give me these errors.

/etc/samba/smb.conf:
[share]
comment = Timestamp Folder
path = /home/share
read only = no
create mask = 0777
directory mask = 0777
browseable = no

I'm sure I'm blatantly missing something stupid, please help :(
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12066
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: cifs

Post by thechief » Thu Sep 03, 2009 10:48 am

I think you'd better post an example of the command line that you are using. It works perfectly fine here (Ubuntu). This is a copy of th relevant part of my smb.conf
[cifs]
comment = Test CIFS
path = /home/user1/cifs
writeable = yes
; browseable = yes
guest ok = yes
And this is the example command line

Code: Select all

mount -t cifs blah /cifs -o user=user1,pass=pass1,unc=//192.168.1.55/cifs
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
User avatar
studioeng
Experienced
Experienced
Posts: 454
Joined: Mon Oct 23, 2006 11:59 pm
Location: Dorset, England
Contact:

Re: cifs

Post by studioeng » Thu Sep 03, 2009 11:26 am

Thanks for replying Chief.

I had another go at it, created a new user and samba share and it worked. I went back to the original and that started to work ... Very weird.
Maybe all it takes is to make yourself look stupid and then it works perfectly :lol:
Post Reply