Operating System - Linux
1753822 Members
9341 Online
108805 Solutions
New Discussion юеВ

Re: Cannot write/modify files with nfs and samba client

 
Samuel_22
Advisor

Cannot write/modify files with nfs and samba client

Hi,

My configuration:

- 2 PCs, one server (desktop) and one laptop.
- Connected with a 10/100 network.
- SuSE 8.2 pro on both machines.
- The desktop has also two FAT32 windows partitions defined, with office files.
- nfs & nis services defined and configured.
- A network user accound defined on the server.
- The /home/MyUserAccount defined on the server to be accessed through the network by the laptop.
- Samba client defined on the server to access the windows FAT32 drives.
- The /windows/... drives defined to be accessed through the network by the laptop.

Everything is running well (connection with MyUserAccount from the laptop with a remote /home directory, working with documents, which are on the server linux file system) except modifying files (linux or windows), which are on the FAT32 windows drives of my server, but only if I access them from my laptop. I can work on them from my server. I use the same user account with both PCs.

Is there any special configuration parameter to allow write/modify/delete rights on remote (nfs) windows drives ?
Do I have to configure samba or nfs ?
Why do I have no problem to access thoses windows files when I work on the server ?

I hope my problem description is enough understandable...

Thanks for help.

Sam.
7 REPLIES 7
Alexander Chuzhoy
Honored Contributor

Re: Cannot write/modify files with nfs and samba client

I hope I got your problem right...
you said:"Why do I have no problem to access thoses windows files when I work on the server ?"
because you don't have to pass trough the nfs restrictions.
Now for the syntax:
usually you should edit /etc/exports file like this:
/directory ip(permissions)
when:
between the ip and the permissions shoud be NO space.
For example to give a station 10.10.10.10 permission for r/w access for a folder name /data
/data 10.10.10.10/32(rw)
you can also specify (rw,no_root_squash)

in permission if you want your laptop's root
to access file on NFS server as local root.
Jairo Campana
Trusted Contributor

Re: Cannot write/modify files with nfs and samba client

use samba and configure directory with option
see:
http://www.tldp.org/HOWTO/SMB-HOWTO.html#toc6
legionx
Stuart Browne
Honored Contributor

Re: Cannot write/modify files with nfs and samba client

Ok, getting confused.

You say that both are using SuSE, yes?

How are you using 'Samba' for the FAT32 drives if they are local? Aren't you just 'mount -tvfat /dev/hdaX /mount/point' ?

What mount commands are you using on both machines ? What's your /etc/exports look like no the server, and what usernames are being used?
One long-haired git at your service...
Samuel_22
Advisor

Re: Cannot write/modify files with nfs and samba client

Hello !Thanks for your answers. Here is some information in the attachment. I'm not very familar with the editor of the forum and I couldn't put line breaks where I'd liked to. Someone has a hint for me?Thanks !Sam.
Steven E. Protter
Exalted Contributor

Re: Cannot write/modify files with nfs and samba client

Stuart makes an excellent point.

If the drive is local, you don't need nfs or samba to access it.

Trying to run the client and the server of either protocol on the same diskstop is a recipe for bad testing results.

If you have a choice between nfs and samba, go with samba, because nfs doesn't encrypt the data prior to letting it go on the network. Thats a security issue.

Next, check the /etc/passwd files of both machines.

The numeric uid of the user in question should be the same to insure there is no problem in accessing files between the two machines.

The reason you have no problem with the windows files when you work on the server is unless you've locked down permissions, you can access ANY files on the server as almost ANY user.

On the server, you can mount the windows drives locally and set permissions with chmod and chown.

If this or other posts have been helpful, please assign points.

SEP
forums ettiquette:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=140137
http://66.34.90.71/ITRCForumsEtiquette/


Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: Cannot write/modify files with nfs and samba client

Ok. On the laptop, where are you mounting 'server:/windows/E/' to (locally) ?

After mounting it, what are the permissions on the files (ls -l ) ?

It's looking like the permissions on those files are restricting the user you are using on the laptop from writing to them.

I think you can force given permissions on files mounted off a Fat32 partition. This usually requires modifying /etc/fstab, with options like:

uid=501,gid=501,umask=022

(see 'man 8 mount' for details, under the 'fat' section).
One long-haired git at your service...
Samuel_22
Advisor

Re: Cannot write/modify files with nfs and samba client

Hi !

Thanks for your messages. They were very useful and interesting, but I couldn't solve my problem yet.

Alexander: I checked the /etc/exports configuration file :
/windows/E/ *(rw,root_squash,sync)
These parameters were generated by the SuSE graphical tool to configure my nfs server. I don't know the meaning of the sync option.

Stuart: Yes I use SuSE 8.2 pro on both machines.
The FAT32 drives I'd like to access are on the server. When I access them from the server, they are local and I don't use the nfs service. When I access them from my laptop, they are remote and I think I have to use nfs (maybe there are other solutions I don't know).
I don't know the commands, which have been used to mount the FAT32 drives. SuSE did the job automatically when I installed the system.
I use the same userid if I work on the server or on the laptop. The userid is defined on the server and I use it with nis when I work on the laptop.

Stuart: Yes, I have a /windows/E on my laptop, which correspond to the /windows/E of my server, with nfs. I checked the permessions. -rwxrwxr-x for a test file. The permissions are the same if I look on the server or on the laptop.

Another strange thing: when I work with my laptop on a server FAT32 drive, I can create a folder, but not a file and I cannot modify a file ("Writing error. Impossible to write in the file" --> message in an Open Office.org file).

I know this problem is complex and difficult to explain and I do my best to be as clear as I can. Thanks.

Samuel.