Samba drive mapping

Q I can copy a file from a Linux machine running Mandrake 10.0 to a Windows directory in a partition on the same machine, ie:

cp samba_issue.txt /mnt/windows/

This works OK. I can read from, but cannot copy any files to, a Windows directory on another machine mounted using Samba, ie:

cp samba_issue.txt /mnt/pc1_DOWNLOADS/
cp: cannot create regular file '/mnt/pc1_DOWNLOADS/samba_issue.txt':
Permission denied

The same PC re-booted in WindowsMe can copy to the Windows directory on the other machine. The target Windows machine is a Windows 98SE machine and has the directories shared with no password, as I know from past experience that there are issues that I don't understand with encypted or plain text passwords not working correctly. The machines are networked together by good old-fashioned Ethernet wires, via a router. The Samba connections were set up via the Mandrake control centre, and I have checked that I don't have the 'read-only' option for the mount checked. The Samba packages I have installed are:

$ rpm -qa | egrep -i samba
My "fstab" file looks like:
/dev/hda5 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda7 /home ext3 defaults 1 2
/dev/hdc /mnt/cdrom auto umask=0,
user,iocharset=iso8859-15,codepage=850,noauto,ro,exec 0 0
none /mnt/floppy supermount dev=/
dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=iso8859-15,sync,codepage=850 0 0
//pc1/DOWNLOADS /mnt/pc1_ DOWNLOADS smbfs username=%,defaults 0 0
//pc1/MY\040DOCUMENTS /mnt/ pc1_MY-DOCUMENTS smbfs username=% 0 0
//pc1/MY\040MUSIC /mnt/pc1_MY-MUSIC smbfs username=% 0 0
//pc1/RECORDINGS /mnt/pc1_RECORDINGS smbfs username=% 0 0
/dev/hda1 /mnt/windows vfat umask=0,iocharset=iso8859-15,codepage=850 0 0
none /proc proc defaults 0 0
/dev/hda6 swap swap defaults 0 0

I don't really understand the format of this file and have not edited it by hand. I understand that it controls how drives are mapped on to your machine. My understanding is that it is the entries in one's fstab file that control the mapping of drives on the machine you are running on, and that the /etc/samba/smb.conf file controls how the machine you are on appears as a Samba server on the network. Is this correct? Any help from you to get Samba writing from the Linux Mandrake 10.0 machine to the Windows 98SE machine working would be much appreciated.

A A common problem with Samba mounts are permissions. Obviously, Windows lacks the facilities of Unix file permissions, so these are masked by Samba to replicate the sort of file Linux may expect to see. The simplest option is to add the entry 'umask=0' to the mount lines in /etc/fstab for the Windows mounts, which will allow any user to modify the files. As a more secure approach, you could create a group who can access Windows files, then use 'umask=007, gid=group', where group is the GID of the group you created. This will enable users within this group to modify files, without their having to worry about everyone else being able to do it too. man 5 fstab' is a good place to start when trying to figure out the fstab file. /etc/samba/smb.conf is purely designed for the smbd and nmbd services - modifying anything in there is not going to change the way your mounts behave.

Follow us on or Twitter

Username:   Password:
Create Account | About TuxRadar