Unable to write to any external filesystem

I’m seem to be having a problem…

Whenever I try to write to /opt, /usr/src, or /usr/local, I get “permission denied.”

How do I fix this? The portion of the fstab for the filesystems in question is:


/dev/sda9     /opt     ext4     user,noauto,noacl     0 0
/dev/sda6     /usr/local     ext4     user,noauto,noacl     0 0
/dev/sda10     /usr/src     ext4     user,noauto,noacl,exec     0 0
/dev/sdf1     /mnt/hd2     ext4     user,noauto,noacl     0 0

and for the permissions:


drwxr-xr-x   2 root root  4096 2010-10-25 03:50 opt
drwxr-xr-x   2 root root   4096 2010-10-25 03:50 local
drwsr-sr-x   2 root users  4096 2010-11-02 13:17 src
drwxr-sr-x 2 root root 4096 2010-10-25 17:36 /mnt/hd2

And yes, I’ve tried setting the setuid/setgid bits and using the ‘suid’ fstab option, with no luck.

Any suggestions?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Are you running as ‘root’ when you try to write to those places? I’ll bet
not, which means you lack permission, and therefore permission is denied.
Why are you trying to write to those filesystems, and with what?

Good luck.

On 11/02/2010 01:36 PM, VerizonLover wrote:
>
> I’m seem to be having a problem…
>
> Whenever I try to write to /opt, /usr/src, or /usr/local, I get
> “permission denied.”
>
> How do I fix this? The portion of the fstab for the filesystems in
> question is:
>
>
> Code:
> --------------------
>
> /dev/sda9 /opt ext4 user,noauto,noacl 0 0
> /dev/sda6 /usr/local ext4 user,noauto,noacl 0 0
> /dev/sda10 /usr/src ext4 user,noauto,noacl,exec 0 0
> /dev/sdf1 /mnt/hd2 ext4 user,noauto,noacl 0 0
>
> --------------------
>
>
> and for the permissions:
>
>
> Code:
> --------------------
>
> drwxr-xr-x 2 root root 4096 2010-10-25 03:50 opt
> drwxr-xr-x 2 root root 4096 2010-10-25 03:50 local
> drwsr-sr-x 2 root users 4096 2010-11-02 13:17 src
> drwxr-sr-x 2 root root 4096 2010-10-25 17:36 /mnt/hd2
>
> --------------------
>
>
> And yes, I’ve tried setting the setuid/setgid bits and using the ‘suid’
> fstab option, with no luck.
>
> Any suggestions?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM0Gq/AAoJEF+XTK08PnB5d+8P/RtS67QsMsN/LOuNHnapSE69
XWjlLH+uWliHpTW3GOX54pm5IlZ6X39VYCbtpnI7oGgFM+Qg0U7EwsN5DNVPJOa7
Hh2sMiFuJX14RlmjVbF7c5oLEke2bz5fFh+nMkmDEeLjgcyyFKa5mnsXJfvpPbbr
9JmHKJgenTQc47ejhQPvfihwuqMNJLNrqdp5vrvAzq7UtgqG69JB7Gfg43VWOCeU
UVgorEhPgBqXKj8NbkJ3jQPfE/+2yi2JK/Pb9imRjkSkFYTWOv6UTaN/+BcFwd4U
bC3X7eFfqeH6SByNAix1zJpLPLfGKUFXFPg7P3rPrv9DQASQunqtQjQd8VDWrCWm
IflV3FhSbzM6nU4SxRvAaYbPac+sOM5CoNZeOxQC63iCBE+fZwOdV1aYnJ7Tx2dG
SCWp4DYLlc0XjFZGeJtTbJGxYqUV+K4pAr72yqx/t3odiWUF6cZkyIQFFJdLF+au
e5bhnzERX249Q8aOhKyMTOaJlyGyOr4pbdisooLnfKRCSNXTRU8E6ymEcDWtFsH0
NM988UYT2q37r5jZ37dCzg00q6iTw2vcKAbNeRvz+IClRD1DApm9Ch2vllsTwIlN
kl+cTRbyPuQqVi4uCmCQl6cl3FJ3GaUYuhpBf31vm5PnGlfgLsSypA2GQo6K+QJX
kKnlOKOKjPsahgXzwDhx
=zVkq
-----END PGP SIGNATURE-----

/opt (for Java development)
/usr/src (kernel sources, etc)
/usr/local (misc)

Can you tell me how to set the permissions correctly?

I think of it as a learning exercise. :wink:

The items that you find there by default are owned by root and are not supposed to be edited/written except by root.

You can become root at the command line by running “su” or in a GUI by running (KDE user) “kdesu dolphin” or (Gnome user) “gnomesu nautilus”.

You can install an accessible folder in a filesystem otherwise owned by root like this example:

  1. make the directory as a normal user command: sudo mkdir /usr/local/barack
  2. change owner to user barack: sudo chown barack:users /usr/local/barack

You can change the ownership of a whole filesystem tree with the command for example: sudo chown -R /path_to/treeroot_folder
But if you did that on the path /usr/src for example you could easily break the installation and have to install it again so it’s a really bad idea.

I’m curious as to why you mounted sda6, 9 and 10 in those locations, it’s very unusual, why did you do that?

On 2010-11-02 20:36, VerizonLover wrote:
>
> I’m seem to be having a problem…
>
> Whenever I try to write to /opt, /usr/src, or /usr/local, I get
> “permission denied.”

Are you root?

If you are not, you can not. Ask your system administrator why not >:-)


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)