How to mount NAS device

Hi,

I’m trying to mount my NAS device via NFS with suse 11.1, but up to now it failed.

The NAS does support NFS, but it requires a UID and a user name and up to now I could not figure out the correct nfs mount options for that.

If I just make mount 192.168.0.2:/nas1 /mnt a get the error message “mount.nfs: access denied by server while mounting 192.168.0.2:/nas1”. So can somebody please tell me the correct options for user name and user id which the mount should use. And, preferable the correct entry for the etc/fstab file to make this mount being executed automatically during startup.

I studied the mount(8) and nfs manpages several times, but I do still have no idea how to make it.

Thanks,

Volker

The brand and model of your NAS, it’s not a big secret is it?

If it as it seems, you have console access to the NAS, why not look at its log files to see why it doesn’t like the mount request?

On NFS, the uid and gid of the connecting user should match with the IDs on the server.

It’s not a secret, it’s a simple Claxan NAS200 running with original firmware based on some Linux OS. But I do not have console access, this would be available only with some other firmware.
There is not so much documentation about the NAS, but it requires the Remote UID, the IP-address and netmask and the mapping user name. So normally we should not need a console access, but need to know how to send the UID and user name to the NAS via mount command or /etc/fstab entry.

Volker

Actually you are root when doing the mount, but I do not want to mount the NAS with UID 0, maybe it does not work either.

In my office we do have a NFS client for Windows in order to mount our Solaris server with appropriate user and group IDs, so this should work with with Linux too, but how?

Volker

Does the NAS allow annonymous connections with Windows PCs? If so, you can do it annonymously with Linux as well. Here are some How-toos.

Samba: HowTo Mount a CIFS Network Share [AKA Map Network Drive] in openSUSE 11 plus FAQs

I use the following command in fstab to mount my NAS with no problems.

//192.168.0.2/Volume_1/ /NAS cifs guest,_netdev 0 0

You will have to have CIFs and PAM installed. Using guest, it won’t require you to create a Samba user, so it does simplify things a bit.

If it does require a user name, you will have to create a user in Linux and then create that user in the Samba client.

As an added note, you may find that you have to add a little bash script to the Autostart folder so that it will mount the drive every time you log in. I had to do this and used the following script.

#!/bin/bash
/bin/sleep 10
/bin/mount -a

I named it mount.sh and made it executable. Then I went into YAST SUDO and connected it to my user account and set an alias to root with no password, so that it would run automatically with no user input from me. You have to be root to mount a drive, so this part makes it work well.

The NAS does not allow an anonymous login, but I can access it with Netbios / Samba, same as for Windows PCs. However, I found that the Samba login via Linux is not very convenient as I need to provide the login credentials every time an application does access the NAS folder. E.g. I start doplhin file manager and open the NAS folder, then I have to provide a valid user name and password, then I browse with doplhin for some MP3s and click on one one of them, the MP3 player is started and asks again for my user name and password. Same for other applications or if you close and restart dolphin again. This is not very convenient and, by the way, the Amarok player does not work at all when the files come from the NAS, I need to copy them to the local hard disk first, which is also not very convenient.

Anyway, in my opinion it should be better to use NFS as the NAS does support this and any UNIX system does it too. Usually you do not need to provide UID and GID for the mount among UNIX systems, but maybe the NAS requires it due to the fact that the whole thing is designed to work for Windows, Apple and UNIX systems.

Why do I not see some mount options which allow me to provide a specific user ID or user name for the NAS? It seems that there are such options, but not for NFS devices. >:(

Volker

If the user’s creditials are specified in /etc/fstab, then it should not ask for a user/password.

How can I specify user name and password in the /etc/fstab file for Samba connections?

Volker

Follow the link I posted above. Swerdna has a wealth of information there.

So, on this NAS, if you connect to it with Windows, you have to give it a username and password? My D-Link NAS will do this too, but only once it has been changed from the default.

You can’t “send” a UID like in CIFS/SMB. The way NFS works the mount is done, and then the UIDs have to match at each end to be the “owner”. Although there is a UID map facility. You’ll have to figure out how to create the directory with the right owner at the NAS end to have permissions on it. But you still have to do the mount as root, although you can use the “users” option in mount to delegate this capability to the users.

Ok, I’ll check it.

I created same user accounts on the NAS as well as on Windows and Linux PCs (and my old OS/2 PC), including passwords. With Samba it does work, but on Linux I’d still prefer NFS if possible.

Volker

OK, then the big question is what the NAS does expect if it does ask for a “Remote UID” for the NFS shares?

With the information from Swerdna it should be possible to mount the NAS shares with CIFS, meaning Samba. I’ll try it, but I still do not understand what the NAS developpers have done on their side. Maybe I need to ask them to understand how they did intend to use the NFS connections on the Claxan NAS.

Volker

NFS emulates a filesystem with ownership info on objects and this info comes from the native filesystem on the server.

I suppose you have tried the obvious? That is, to make the top directory world writable, then as the intended account, create a subdirectory. This should then get owned by the intended account. Below that you can then create all the objects you need.

Incidentally it looks like Claxan is (or at least was) using FOSS in their devices since they were charged with GPL violation a few years ago but cleaned up their act. So if they are still using FOSS in your model it ought to be possible to see what they have done.

GPL Violations homepage - Declaration to Cease and desist from ARP DATACON GmbH

Hmm, I do not know how this should work.
With the Claxan original firmware you can setup one root directory which is used as share name too, that’s all, in fact that’s probably not a directory but the share name only. Then you can specify user and group settings for that share. There is no way to create sub-directories with different user or group settings, at least I would not know how to make it. Of course I could try to make that share writeable for everyone, but I think even that is not supposed to be done.

Then, on the NFS settings page, you must setup the remote UID, an IP address with netmask and a mapping user name. That’s it. As the error message from the NAS is “access denied”, I must assume that IP-address and netmask are OK.

For me still the big question is, how the guys from Claxan or ARP Datacon intended to use that share by NFS clients, either it is too easy for me or I just did not yet get the key point.

By the way, the NAS200 seems not to be affected by the GPL license violation.

Volker

Ok so what if you make the remote UID the same as the intended user’s UID on the client side, can you mount it (as root) and use it from that user? If you get access denied when mounting, then the UID hasn’t come into play yet. What about the netmask, is this specified as a quad or as a prefix length? Did you get that right? (There is another brand of NAS where the help message about the netmask is ambiguous.)

What about documentation is there any? Any Claxan forums on the Net?

The IP-address and netmask are given as 192.168.0.3/24. Actually I would expect to write 192.168.0.0/24 but the NAS does not allow that.
The documentation is quite poor, and from the Claxan forum I did not get help up to now. It seems that most of those guys installed an alternative firmware on the NAS, but this is not what I intend to do.

Volker

Well 192.168.0.0 is a network address, so if you want to specify the NAS’s IP address and netmask in one string, then 192.168.0.3/24 would be the way.

I suspect the mount failed because of wrong address rather than UID issues. UID comes into play only after the mount has succeeded.

You’re mixing up some things: the IP-address I mentioned is not that one on the Linux PC but the definition on the NAS side. I have to specify which computers are allowed to mount the share of the NAS. And therefore it would be better if I could specify a whole network IP address rather than a specific one. Assume the Linux PC is on DHCP, how should I tell my NAS, make single entries for all IP-addresses of the DHCP range?
Anyway, I’ll double check that.

Volker