I have a dual boot machine running Windows 7 and Open Suse 12.3
I have a Western Digital New Book world attached as a NAS device, and have been using it successfully for some years to share files with my wife, using Windows.
The device has 3 main directories, one for my wife, one for myself, and one shared between the two of us.
I now need to use it to store some subversion repos in my private directory.
I modified /etc/fstab to include the following:
//IP_Address_for_Device/alan /mnt/NAS cifs user=alan,username=alan,password=Password user,rw
Where alan is the name of the directory I want to access.
When I boot into Linux, as myself the directory is mounted as read only.
The only way I can get write access to it is to boot as root.
Hello again. Please note that there is a hidden feature on these forums that is to be used every time you post computer text (as you do above a few times). All computer text should be copied/pasted into a post between CODE tags. You get the CODE tags by clicking on the # button in the tool bar of the post editor.
When applicable also post the command you used (and the prompts at the begin and the end) in the same copy/paste. Thus everybody can see what you did and a lot more.
It could be that your user does not have permissions to the directory that is the mount point. Please show:
ls -l /mnt/NAS
And please note, you do not boot as alan or as root, but you login as such (the system is then of course already booted, maybe even two days ago). And most important: NEVER log in as root.
The owner of these files is 503 and the group is 1000. Neither are configured on your system.
In the mean time I hve looked into
(something I assume you have done before creating that fstab entry) and there it says that user= and username= are synonyms. Thus why are both there?
It also says
sets the uid that will own all files or directories on the mounted filesystem when the server does not provide ownership information. It may be specified as either a username or a numeric uid. When not specified, the default is uid 0. The mount.cifs helper must be at version 1.10 or higher to support specifying the uid in non-numeric form. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.
and more about forceuid= and gid= and forcegid=. Did you read that? And the FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS paragrpah?
I will take your advice and read up on forceuid= and gid= and forcegid=. And the FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS paragrpah? this evening.
As for both user= and username= being specified, when I installed Suse, I couldn’t get access to the NAS drive at all, and I tried several variations on the fstab entry all without success. Then I rebooted the NAS drive, and tried again, and I managed to connect with it, read only as alan, and read/write as root. I forgot to restore the fstab entry. I have now restored it to
//192.168.1.3/alan /mnt/NAS cifs user=alan
, and get the same results.
I have no idea where the 503 comes from, but as the files were created by Windows, I would assume that it a placeholder for an u(I changed my real name to Featherstonehaugh to protect my identity):)nknow Id.
Thanks for the information. I think you are mixing two things a little bit. That is uid and gid. The uid as shown is 503 and the uid belonging to the user alan is1000.
The gid as shown is 1000, but that is a different thing from the uid 1000. Both are numbered, but there is no special connection between an uid and a gid who happen to have the same number.
The gid attached to alan (1000) as the default gid is defined in your /et/passwd as 100. In the default case, 100 is the gid of group users. Check in /etc/group.
So when you want thse files handled as if you were the owner, you must force uid 1000 and gid 100 on them.
You’re almost right. I’m not mixing two things a little bit. I’m mixing two different things a LOT, caused by ingorance.:shame:
I tried adding
to /etc/fstab, but that didn’t work, so I added
I now have read/write access to the folder in both Linux and Windows, which is what I need.
Now I need to research using a credentials file to save having to supply a password, and not leaving the password in a plain text file for all to see.
Hope you are still reading these Alan. This is an area that has caused me problems as well. My nas is set up the same way as yours. I use mount.cifs directly without involving samba software on my machine. To do this on opensuse 11.4 I had to edit the mount.cifs source file and re assemble it as the samba people had added code to prevent users from using cifs directly.
As you method sounds easier and I am just about to upgrade to 12.3 could I ask if you are running samba client software?. Could you also post your fstab entries for the nas. Like you I spent hours playing with fstab and looking up all relevant man pages but nothing would work. Then I found that mount.cifs a had changed and mount.cifs.intall added. When I asked on here samba was mentioned again and again but I have no need for it having no wish for direct machine to machine sharing. It’s also very slow in some areas.
I currently mount using this command - may be of use to you if you find you still have problems.
and enter the password manually and unmount when I have finished. The command links the nas to a folder on my desktop. I then looked at kde scripting and also a qt dev package to tidy this up but too many bugs and no decent docs at the time. I had no luck adding a password file etc.
I bug reported the mount.cifs used directly problem several times and was told that people kept asking if the earlier version was secure. No one was prepared to do a full security audit so the function was crippled instead. They may have changed it again on 12.3 or perhaps you have found a way through that doesn’t involve editing the source files. My argument was that it should be possible to use cifs directly as it’s the default mode for the majority of home NAS’s. Mine will also act as a NFS server but that slows it down as it has to load 2 servers. One for CIFS and one for NFS. Using CIFS directly causes the NAS to work in exactly the same way a local disk. NFS may do the same thing as well. With other techniques I found that some applications would not read modify write from the NAS or accept files launched from it. In principle I could now launch applications held on the NAS as well. :shame:Of interest as I may try a diskless work station some time.
This gives me read/write/execute access to the folder, but I have to supply the password (which is a minor inconvenience).
I believe I may have had to visit the porperties->permissions page on the folder, and enter a uid for alan in addition to the fstab entry.
On 6/28/2013 5:56 PM, ajf2 wrote:
> No, I’m not running samba
> My /etc/fstab entry looks like
> //192.168.xxx.xxx/alan /mnt/NAS cifs username=alan,uid=alan
> This gives me read/write/execute access to the folder, but I have to
> supply the password (which is a minor inconvenience).
> I believe I may have had to visit the porperties->permissions page on
> the folder, and enter a uid for alan in addition to the fstab entry.
Have you read this HowTo/Tutorial? It is a bit long in the tooth but should still be valid as per the Credential files and
No, I haven’t read that tutorial, but I will.
At the moment, I have r/w access to the NAS drive folder, and can use kdesvn to create a new repository, and import my working tree into said repository.
However, I cannot use kdesvn to checkout from that repository. kdesvn crashes. I can however use svn to perform the checkout if I imported the repository in Linux
If I create the repository and import the working directory in Windows, then I cannot checkout anything in Linux, using kdesvn or svn. I think that Windows uses a later version of svn.
I haven’t tried using Windows to checkout from a repository created in Linux yet, but I’m beginning to think that I should look for an alternative to svn to manage my project, as the “s” in svn clearly does not mean “shared”.
I’ll start by looking at the tutorial to make sure I’m not doing anything obviously wrong, look for an older version of svn for Windows, and if I’m still having problems, will look for an alternative to svn.
I found it very easy to see if samba is involved. Just navigate directories on the nas from the desktop. Samba is very much into sharing so basically reads the entire directory structure and permissions each time one is selected this makes it rather slow going up and down the same tree compared with doing similar things on your local disc. lol! at least that area is why I think it’s slow. Fine for complex “enterprise” use really. The tutorial linked to is very much related to setting up samba.
Using cifs directly is exactly like using a local disc. I have found that the data rates are on the high side too probably down to the network route into the pc that’s connected and the kernel directly handling the protocol. It seems to looks after file locking in the same way as local files are handled - say 2 editors have opened the same file and changes made - it spots that something has changed. For my use, 3 personal user password protected directories and one open to all for passing files that is fine.
If you need to it’s shouldn’t be to difficult to load the source files and edit mount.cifs etc and re assemble them. The problem areas are commented in the source - or are on 11.4. I haven’t looked at 12.3 yet. There are other complications as well. I originally thought that I could simply write a user shell script as root and run that as a user - that has been blocked as well and I am not aware of any fixes for that aspect. It would be easier to do it that way. In principle the script could contain the password or pause to ask for it. Particularly annoying as I feel root should be able to set up machines as they want to. If some one miss uses a root user password anything might happen anyway so why add this additional protection.
An alternative should be available via mount.ntfs hopefully without any complications. The downside for me is that the doc’s on my 2 disc d-link nas point out that activating ntfs at it’s end will slow things down as it will have to run 2 servers. Not tried it but will if I have to. I believe others have done this without any complications but I haven’t nosed round the web on this subject for a couple of years. Info can be hard to find as many people seem to think samba has to be used. Refreshing my memory with a search there are mount.nfs and mount.ntfs files. The one you will probably want would be the one used for network booting. Googls does come up with info on that. I really should remember which is which really - forgive me I stay away from the low level stuff as much as possible.
My NAS drive is currently almost empty so I am unable to notice any performance differences, when browsing via the desktop, so I populated it with about 4 GB of files from Windows. When navigating through the directory using Dolphin, it was very slightly slower than if I was using a local drive. This is to be expected, as the drive is a little slow. (It took Windows over an hour to copy the 4 GB of data to the drive). I think that I can safely say that samba is not involved, especially as if I look at the properties->share, the share with Samba box is not checked.
Additionally, I have found that if I create a repository on it using kdesvn, and import a copy of a working folder, I can checkout that tree under Windows, or using svn checkout under Linux. I haven’t tried changing the files and committing the changes yet.
I just noted that you can execute from it Alan. I believe that rules Samba out using cifs remotely from Linux. Maybe my repeated bleating on the Novel bug list has achieved something. It was some time ago and the responses were not encouraging. I can understand their problem though - enterprise users.
My aim was a desktop icon that linked to the nas, mounted it and opened a dolphin window. Early KDE scripting was there but didn’t work and the qt dev apps didn’t relate to the documentation in a usable way. Also buggy. It may be better now.
I have posted what I had to do in the home built nas thread. One of the problems with the samba or kde share route was that certain applications weren’t happy with files launched from it and even less happy about saving modified files to it. This seemed to be down to running a mix of qt apps and none qt apps and possibly the way that kde handles launching now. Not helped by me being a very none pc software engineer.
Yes, I have executable privileges from the NAS, but I doubt that I would ever need them. I can’t remember if I had to give myself executable privileges or if I inherited them automatically. As I am the only user, I’m not worried about it.
I don’t have a desktop icon that links to the NAS, but I’ve never tried to install one. When I run dolphin, it shows “alan on 192.168.xxx.xxx” which I considered too complicated, so I added an entry under “places” in dolphin to give a link a shorter and more meaningful name.
I too am using Qt to develop software, and I copied a small project onto the NAS drive, rebuilt it, and debugged it (which shows that the executable privileges work).
I am not worried about security, as the only path to the NAS drive is through my router, which is set up to only recognize the MAC addresses of the computers that are connected to my home network, and to deny access to all other MAC addresses.
Right now, the only problems I have are that kdesvn cannot checkout, but I can work round that by using svn, and the incompatibilities between Windows svn and Linux svn. I need to do a lot more research and testing on this.
I am having a similar problem. It was working up until a couple of weeks ago, now it doesn’t.
when I try to mount the NAS share with
sudo mount /mnt/me
I get this in messages:
2013-08-17T14:45:48.204725-04:00 mymachine kernel: 7555.093179] CIFS VFS: Error connecting to socket. Aborting operation
2013-08-17T14:45:48.204758-04:00 mymachine kernel: 7555.093422] CIFS VFS: cifs_mount failed w/return code = -111
I can ping the NAS.
I can log in to the NAS UI.
But I cannot use CIFS.
I am running:
Distributor ID: openSUSE project
Description: openSUSE 12.3 (x86_64)
[FONT=arial][/FONT]On trying /sbin/cifs, I get the same error as above.