Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Made a bind mount of /usr ,normal user can't exec ..[solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
gouranga
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2005
Posts: 113

PostPosted: Sun Oct 28, 2007 8:50 am    Post subject: Made a bind mount of /usr ,normal user can't exec ..[solved] Reply with quote

Original topic wrote:
Made a bind mount of /usr ,normal user can't exec /usr/bin/

I ran out of space on my hard disk, so I decided to move a few folders and work with bind mounts.

extract /etc/fstab/:
/mnt/hdb2/home /home none bind 0 0
/mnt/hdb2/opt /opt none  bind 0 0
/mnt/hdb2/usr /usr none bind 0 0
/mnt/hdb2/portage /usr/portage none bind 0 0


Everything went smoothly, until I decided to move the /usr/ folder.
For user root everything is ok, normal users can't execute fe the command startx, and various other commands.

All the commands a normal user can't execute are in the folder /usr/bin/ (root:root rwx --- ---).

Since I copied the folder with option -r , I thought all permission would be preserved.

Anyone any thought what I did wrong and how I can solve it?


Last edited by gouranga on Thu Dec 27, 2007 7:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3943
Location: Hamburg

PostPosted: Sun Oct 28, 2007 9:19 am    Post subject: Reply with quote

Have a look for the umask option of mount.
Back to top
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 04 Nov 2004
Posts: 1083
Location: Victoria, BC, Canada

PostPosted: Sun Oct 28, 2007 3:40 pm    Post subject: Reply with quote

man 1p cp wrote:
-p Duplicate the following characteristics of each source file in
the corresponding destination file:

1. The time of last data modification and time of last access.
If this duplication fails for any reason, cp shall write a
diagnostic message to standard error.

2. The user ID and group ID. If this duplication fails for any
reason, it is unspecified whether cp writes a diagnostic
message to standard error.

3. The file permission bits and the S_ISUID and S_ISGID bits.
Other, implementation-defined, bits may be duplicated as
well. If this duplication fails for any reason, cp shall
write a diagnostic message to standard error.

If the user ID or the group ID cannot be duplicated, the file permis-
sion bits S_ISUID and S_ISGID shall be cleared. If these bits are
present in the source file but are not duplicated in the destination
file, it is unspecified whether cp writes a diagnostic message to stan-
dard error.

man 1p cp wrote:
-r Copy file hierarchies. The treatment of special files is imple-
mentation-defined.


In short, no, cp -r is not enough to preserve permissions and special modes - you need to use cp -r -p, or cp -a.
_________________
Saving the world, one kilobyte at a time.
Back to top
View user's profile Send private message
gouranga
Tux's lil' helper
Tux's lil' helper


Joined: 05 Aug 2005
Posts: 113

PostPosted: Sun Dec 09, 2007 8:07 pm    Post subject: Reply with quote

Thx for pointing out what caused my problem. I should have read the man of cp.
Now it's to late.

My /usr/ partition is working back.

/etc/fstab wrote:
/mnt/hdb2/usr /usr none bind,umask=777 0 0

Maybe this is drastic , but for now I just want things to work.

X wasn't starting up for a normal user.
After a little search, I found out the sticky bit of /usr/bin/Xorg was missing.

Quote:
chmod +s /usr/bin/Xorg


There is still a problem remaining.
I have no sound. Even as root , there is no sound.
I have tried several apps, but I get no sound.

Nothing is logged what could be wrong.

Anyone any thoughts?

update:
Quote:
By default sound is muted:
alsamixer--> pres m --> problem solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum