[SWLUG] SAMBA not allowing me to write
Jonathan Wright
jonathan at netwrker.co.uk
Tue Jan 8 01:49:10 UTC 2008
Stephen Constantinou wrote:
> Dear All
>
> I am using my laptop that only has Mandriva 2008 on it and I am having
> some difficulty configuring SAMBA so that I can write to the XP HDD of
> the PC. I can mount the file system, browse it but not write to it.
>
> I have mounted the file system inside my home directory:
> /home/stephanos/dell/. The icon shows the folder with a red plug on it.
> ls -l reveals
> drwxr-xr-x 1 root root 4096 2008-01-07 21:00 dell/
>
> I have tried to use chmod (as root of course) to change the file
> permissions:
> [root at localhost stephanos]# chmod a=rw- /home/stephanos/dell
> [root at localhost stephanos]#
>
> [root at localhost stephanos]# ls -l reveals
> drwxr-xr-x 1 root root 4096 2008-01-07 21:00 dell/
Windows file-systems (I'm assuming here the type is vfat, as Linux/Unix
cannot write to NTFS file-systems at the moment and it's tied in with
the Registry and UUIDs created through Windows) don't have the same
permissions system as Linux.
Fat/Fat32 is the worst, and in fact has none. But, as Linux requires
them, but default they're set to the person mounting (which in almost
all cases is the root user). However, you can modify this with the mount
command.
For example, the uid= and gid= options allow you to set the IDs of the
user and groups when it mounts. Look through your /etc/passwd and
/etc/group files for your uid and uid vales (they're numbers, not
names), or run 'ls -nda .' in your home directory:
jonathan on jonathan [ ~ ] --> ls -lad .
drwxr-xr-x 67 jonathan users 4096 2008-01-07 15:24 .
jonathan on jonathan [ ~ ] --> ls -nad .
drwxr-xr-x 67 1000 100 4096 2008-01-07 15:24 .
My uid is 1000 and gid is 100.
You can also use the umask, dmask or fmask options to change the
permissions levels of all files & folders, just folders or just files
respectivly.
So, 002 will give read & write access to both users and groups rather
than just users.
Combining it all, you should be able to do this:
mount /dev/drive -t vfat -o uid=1000,gid=100,umask=002 /mnt/directory
Anyway, hope that helps! :)
--
Jonathan Wright
e: jonathan at netwrker.co.uk
w: http://netwrker.co.uk/
cat /dev/random
» you never know, you may see something you like!
(sent from home...)
More information about the Swlug
mailing list