General NAS-Central Forums

Welcome to the NAS community
It is currently Fri May 26, 2017 3:47 am

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Sun Jan 01, 2017 4:59 pm 
Offline

Joined: Sun Jan 01, 2017 4:41 pm
Posts: 4
I'm trying to get my NSA-325v2 to see some Windows CIFS (Samba) shares. As recommended in http://forum.nas-central.org/viewtopic.php?f=249&t=18155 I used slacker to install mz:zyxel_modules-2. 6.31.8-arm-4.txz and then attempted to mount the remote Windows share (which I can see easily from other Linux boxes):
Code:
mkdir test
mount -t cifs -o user=***,password=*** //192.168.1.10/Docs test

The mount command works just fine, and gives sensible, expected error messages if I get it wrong, so I'm confident it's doing something. However, when I try to look at the mounted share:
Code:
ls test

I just get this rather cryptic error message:
Code:
ls: cannot open directory test: Value too large for defined data type

I've tried this with various different shares on various possible mount points, always with the same result. dmesg says nothing at all about it.

Anyone got any good ideas about what I might have forgotten? Thanks in advance!


Top
 Profile  
 
PostPosted: Mon Jan 02, 2017 7:17 am 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2231
You don't need mz:zyxel_modules-2. 6.31.8-arm-4.txz, because cifs.ko is built-in in NSA3** series kernel, but you can leave it installed. Regarding your error, it looks like old version bug. Try to update the following packages first:
Code:
slacker -UaA br2:{util-linux,ncurses,readline,uClibc-solibs,gcc-solibs,zlib}

Then re-try to mount again.


Top
 Profile  
 
PostPosted: Mon Jan 02, 2017 5:24 pm 
Offline

Joined: Sun Jan 01, 2017 4:41 pm
Posts: 4
Quote:
cifs.ko is built-in in NSA3** series kernel

I don't think that is correct. It certainly was not present in my NAS-325v2 rev.4.80; I don't know whether it appeared in the 4,81 upgrade.

However, I'm now very much thrown off the scent by the very confusing behaviour of MetaRepository. It changes the behaviour of package management in a bizarre way, and while trying to load other packages I've now apparently borked my NAS, with the disks marked as "Inactive" in the web interface (which still works). Restoring a configuration file doesn't seem to help. So it's probably a factory reset.

Very soon I'll be junking the NAS in favour of some small Linux box that I can control properly.


Top
 Profile  
 
PostPosted: Mon Jan 02, 2017 7:58 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2231
jona59 wrote:
I don't think that is correct.

Well, thinking and knowing are two different things.
jona59 wrote:
It certainly was not present in my NAS-325v2 rev.4.80

What makes you so sure? You do know how to check, if the CIFS support was built in kernel or as external module or it was disabled at all, don't you?
You should check your NAS kernel config first, imho.


Top
 Profile  
 
PostPosted: Mon Jan 02, 2017 8:44 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 584
Just because of my curiosity, I also tried to connect an smb share to my nas, but is says an error:

Code:
root@NSA320S:~# mount -t cifs //192.168.1.241/Downloads /tmp/test
mount: wrong fs type, bad option, bad superblock on //192.168.1.241/Downloads,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)

       In some cases useful info is found in syslog - try
       dmesg | tail or so.


And the dmesg:

Code:
[    0.000000]  CIFS VFS: cifs_mount failed w/return code = -22


Which is interesting, because my PCs sees this share... And it is a public share, So I don't think, I have to pass any user argunment (like guest). :roll:

BTW: I have an NSA320S and I Can see, the CIFS is built-in on my box/kernel.

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Mon Jan 02, 2017 10:23 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2231
Make sure that you can browse it first from NAS:
Code:
smbclient -L 192.168.1.241

and then
Code:
smbclient \\\\192.168.1.241\\Downloads

Lastly mount it:
Code:
mount -t cifs //192.168.1.241/Downloads /tmp/test -o username=guest,noexec,iocharset=utf8

Username is required even for public (everyone has full access) shares. It can be empty as well, but again only for "public" shares.


Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 11:29 am 
Offline

Joined: Sun Jan 01, 2017 4:41 pm
Posts: 4
barmalej2 wrote:
Well, thinking and knowing are two different things.
which is why I said "I think" :)
barmalej2 wrote:
jona59 wrote:
It certainly was not present in my NAS-325v2 rev.4.80
What makes you so sure?
Perhaps I should have said "certainly was not available". I had no idea that built-in kernel modules could be disabled. What's certain is that I couldn't "mount -t cifs". So I guess the built-in module was disabled. How should I enable it?
barmalej2 wrote:
You do know how to check, if the CIFS support was built in kernel
No, I don't. "lsmod" tells me only about the external modules, as far as I can see.


Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 12:27 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2231
CIFS support can be implemented in kernel several ways:
1. Enabled, which means it is built-in kernel feature and you will not be able to load external cifs.ko, because all symbols are already loaded.
2. Not enabled. Here I meant disabled CIFS at all actually. Hardly can imagine system without it.
3. Built as external module cifs.ko.

Built-in kernel modules can't be disabled, I "think". At least it is unknown to me.
I might be wrong, but I "think", that your NAS always had CIFS support as built-in feature since first firmware release up till now. I have checked kernel configs of 4.61 and 4.70 releases. So you don't need any external modules to load for CIFS support and even so it will fail to load.

BTW. Have you tried example from mine post above? Notice the difference between user= and username=


Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 1:22 pm 
Offline

Joined: Sun Jan 01, 2017 4:41 pm
Posts: 4
Bottom line: I did the library updates you suggested, and now I have it working. Very many thanks.

The catastrophic failure I mentioned was just a very, very unlucky coincidence: one of the two HDs in my RAID1 array happened to fail while I was doing the tests. I don't know exactly what failed, but the NAS was inoperable until I removed the failed disk. I didn't notice this at first because the NAS box normally lives at the back of a closet. The Zyxel GUI is remarkably unhelpful in this situation, simply showing the whole RAID array as "Inactive" with no options to fix it and no indication that it's one of the two disks that has failed, and it wasn't until I saw the red front panel LED that I realized what was going on.

Anyway, your prod to me to check your example "mount" command was useful in a surprising way...
barmalej2 wrote:
BTW. Have you tried example from mine post above? Notice the difference between user= and username=
Well.... I thought I had. (Note, I use "mount" all the time on other boxes, so nothing you showed was any surprise.) But I kept getting "is not a valid block device" errors... UNTIL I took off the trailing slash on the share path. I didn't know that mattered... I guess I must have always "just got it right" in the past, more by luck than judgement.

Once again, thanks for the insights.


Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 4:41 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2231
You are welcome.
I pasted example on purpose. Mine mount output was the same as MrDini pasted:
Code:
mount: wrong fs type, bad option, bad superblock on //192.168.1.241/Downloads,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)

       In some cases useful info is found in syslog - try
       dmesg | tail or so.


Untill I changed 'user=' to 'username='. Then CIFS share mounted successfully. Don't know, if it is mount version specific and related or anything else.
I have already prepared cifs-utils package, which has mount.cifs utility. One of the benefits comparing with mount: more understandable output in case of CIFS mounting errors. Though not uploaded to repo yet. Repository update is planned on weekend, when I will finish adapting packages requirements for new ffp package manager.


Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 5:38 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 584
Cool! As Your brain built-in magic crystal ball ;) mentioned, when I pass the username option, it works! :o

Wow, this is really nice!

Ps:
barmalej2 wrote:
I have already prepared cifs-utils package, which has mount.cifs utility. One of the benefits comparing with mount: more understandable output in case of CIFS mounting errors. Though not uploaded to repo yet. Repository update is planned on weekend, when I will finish adapting packages requirements for new ffp package manager.


Sounds good! Can you compile the smbmount binary? Because the smbmount is a bit better way I think, and if I clearly remember, it Can resolve hostnames while the mount not... Hmm, and the slapt command. You are indulging Your guests! :D

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 9:08 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2231
smbmount has been deprecated in favor of mount.cifs. It is no longer maintained since 2008 and development has been focused on CIFS protocol in the kernel.
mount.cifs (I think smbmount too) can resolve hostnames only if you have local DNS server. In most cases it can be your router. You need to specify it as first DNS server in the first row of /etc/resolv.conf:
Quote:
nameserver Your.Router.IP.Address
nameserver ISP.DNS.IP.1
nameserver ISP.DNS.IP.2

Mounting with mount.cifs is identical to mount:
Code:
mount.cifs //target.server.hostname/sharename /local/mountpoint/dir -o username=noname,password=wtf,noexec,iocharset=utf8

P.S. If you have static IP address of target.server, then you can add it with hostname to /etc/hosts, instead of modifying /etc/resolv.conf


Top
 Profile  
 
PostPosted: Tue Jan 03, 2017 9:35 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 584
I have a DNS server on my another server machine. This is the default DNS server, and the other DNS addresses are disabled on my network. Here, I have some entries with my devices ending with .local.

But the mount Can only attach the IP address based smb servers. If I try to attach a share with rpi.lab.local (it comes from my DNS "config", So it is a domain), or raspberrypi-lab (it is a hostname), it gives me an error like I pasted at the past... :(

The smbclient Can handle it, and the smbmount which is available on my Debian desktop Can Do it too...

So will try to recompile the cifs-utils package, and see how does it works! :)

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group