LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hard Drive Write Access Problems. Chmod not Working. (https://www.linuxquestions.org/questions/linux-newbie-8/hard-drive-write-access-problems-chmod-not-working-666465/)

Mutch 08-30-2008 08:58 AM

Hard Drive Write Access Problems. Chmod not Working.
 
Hi!

I have just installed Clarkconnect 4.3 to be my home server. It has a 750gig hard drive which i am trying to share and mount to /media.

I have it sharing fine but i can't get write access to the drive. when i do
chmod -R 777 /media
as root, the permissions change to drwxr-xr-x . I can't seem to figure out why?

Thanks in advance.

cyclepathology 08-30-2008 12:52 PM

Quote:

Originally Posted by Mutch (Post 3264494)
Hi!

I have just installed Clarkconnect 4.3 to be my home server. It has a 750gig hard drive which i am trying to share and mount to /media.

I have it sharing fine but i can't get write access to the drive. when i do
chmod -R 777 /media
as root, the permissions change to drwxr-xr-x . I can't seem to figure out why?

Thanks in advance.

You've got a 750 GB drive. Did you partition it? Did you put a file system on it? What kind of file system did you use? Did you mount the file system? How?

Mutch 08-30-2008 05:42 PM

Quote:

Originally Posted by cyclepathology (Post 3264610)
You've got a 750 GB drive. Did you partition it? Did you put a file system on it? What kind of file system did you use? Did you mount the file system? How?

I used one big Fat32 partition for the whole drive.
And its mounted at /media.

Samotnik 08-30-2008 05:47 PM

You say you tried to share it. How did you do it?

jschiwal 08-30-2008 05:50 PM

You can't use chmod or chown on a fat32 filesystem. The filesystem doesn't save Linux permissions. Since you have it mounted on /media/, is it automounted? An option in properties for the drive icon (in kde at least) will allow you to change how a device is mounted.

If not, use the "uid", "gid", "dmask" and "fmask" mount options to change the permissions en mass when the device is mounted. See the man mount page.

--
For a Linux filesystem, if you are using Samba, then also check the smb.conf file and its share definition.
If this is a globally writable file, and you see a line in the Global section like:
map to guest = Bad User

and a line in the service defintion like:
usershare allow guests = Yes

then make sure that the user "nobody" has access to the directory.

If you use "Security = User" instead, then create a user account for each Windows user and use "sudo /usr/bin/smbpasswd -a <USERNAME>" to add a samba user and the user's password. Also check the permissions on the server's directory being shared. To allow each user to write to the share, but protect a file from being deleted by a non-owner, then set the sticky bit on the directory.
For example,
sudo mkdir /usr/srv/music
sudo chown root.root /srv/samba/music
sudo chmod a=rwxt /srv/samba/music

It is up to the file owner whether they want to make a file read only protecting it from being overwritten or modified.

More information and countless variations can be found in the "Samba 3 by Example" and "Samba 3 HOWTO & Reference" from the samba-doc package or from their web site.

--

If you are sharing an external drive, reformatting it in a Linux native filesystem will allow more granular user & permissions control.

Mutch 08-30-2008 07:39 PM

Quote:

Originally Posted by jschiwal (Post 3264805)
You can't use chmod or chown on a fat32 filesystem. The filesystem doesn't save Linux permissions. Since you have it mounted on /media/, is it automounted? An option in properties for the drive icon (in kde at least) will allow you to change how a device is mounted.

If not, use the "uid", "gid", "dmask" and "fmask" mount options to change the permissions en mass when the device is mounted. See the man mount page.

This answered my question! Thanks!

I added umask=000 to fstab and that made everything work! :)


All times are GMT -5. The time now is 05:01 AM.