LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-14-2012, 01:29 AM   #1
k84834
Member
 
Registered: Aug 2012
Posts: 142

Rep: Reputation: Disabled
I done chown for a directory but i haven't permission to go in it !!!


I have below problem:

root@UBUNTU-32bit:~# chown -v lfs /mnt/lfs/tools
ownership of `/mnt/lfs/tools' retained as lfs
root@UBUNTU-32bit:~# chown -v lfs /mnt/lfs/tools/build
ownership of `/mnt/lfs/tools/build' retained as lfs
root@UBUNTU-32bit:~# chown -v lfs /mnt/lfs/tools/build
ownership of `/mnt/lfs/tools/build' retained as lfs
root@UBUNTU-32bit:~# su - lfs
lfs@UBUNTU-32bit:~$ cd /mnt/lfs/tools
bash: cd: /mnt/lfs/tools: Permission denied
lfs@UBUNTU-32bit:~$ cd /mnt/lfs/tools/build
bash: cd: /mnt/lfs/tools/build: Permission denied
lfs@UBUNTU-32bit:~$

why I haven't permission ?!!!!
 
Old 08-14-2012, 01:46 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
What is the filesystem used that is mounted on /mnt/lfs/? Is it mounted read only, or a foreign filesystem such as fat32? If the filesystem is corrupt, the kernel will change access to read only to prevent further corruption.

What does `ls -d /mnt/lfs/ /mnt/lfs/tools' show for the ownership and permissions? If root is denied x access to /mnt/lfs/ then it can't enter to change /mnt/lfs/tools/.

Last edited by jschiwal; 08-14-2012 at 01:52 AM.
 
Old 08-14-2012, 01:59 AM   #3
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
file system is : /dev/sdb1 Type: ext4 mount point : /mnt/lfs

and

root@UBUNTU-32bit:/home/user# ls -d /mnt/lfs/ /mnt/lfs/tools
/mnt/lfs/ /mnt/lfs/tools
root@UBUNTU-32bit:/home/user#

I change mount point of this file system manually in fstab ( I add this new partition to fstab) and change /etc/mtab file from

"/dev/sdb1 /media/new Volume\040Volume ext4 rw,nosuid,nodev,uhelper=udisks 0 0
gvfs-fuse-daemon /root/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev 0 0
/dev/sdb1 /mnt/lfs ext4 rw 0 0" to " /dev/sdb1 /mnt/lfs\040Volume ext4 rw,nosuid,nodev,uhelper=udisks 0 0
gvfs-fuse-daemon /root/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev 0 0
/dev/sdb1 /mnt/lfs ext4 rw 0 0"

maybe problem is from these changes !!!!!

Last edited by k84834; 08-14-2012 at 02:27 AM.
 
Old 08-14-2012, 02:33 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
Sorry, use `ls -ld' for the long listing.

Also use the `mount' command to list how the partition is mounted. Or check /etc/mtab.

You don't edit mtab. It is updated by the kernel to list how filesystems are mounted.

Last edited by jschiwal; 08-14-2012 at 02:35 AM.
 
Old 08-14-2012, 02:41 AM   #5
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
root@UBUNTU-32bit:/# ls -ld /mnt/lfs/ /mnt/lfs/tools
drwx------ 3 user user 4096 Aug 13 11:57 /mnt/lfs/
drwxr-xr-x 5 lfs root 4096 Aug 13 14:15 /mnt/lfs/tools
root@UBUNTU-32bit:/#


root@UBUNTU-32bit:/etc# mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
gvfs-fuse-daemon on /home/user/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=user)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sdb1 on /mnt/lfs type ext4 (rw)
root@UBUNTU-32bit:/etc#

Last edited by k84834; 08-14-2012 at 02:43 AM.
 
Old 08-15-2012, 08:06 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
The owner of /mnt/lfs/tools is already lfs.
The verbose option is simply telling you there was no change.

The owner:group of /mnt/lfs is user:user. The permissions are rwx------. So the lfs user can't enter lfs.
 
Old 08-15-2012, 11:50 AM   #7
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
You might want to change the owner of the mount point to lfs as well, and the permissions too
Code:
chown -v lfs /mnt/lfs
chmod 755 /mnt/lfs
 
Old 08-18-2012, 12:02 AM   #8
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
thank you every body for good replies
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What would be the best way to regularly chown a directory of files? daweefolk Linux - General 6 01-19-2011 04:34 PM
How to chown of folder...ie-/home directory cbjhawks SUSE / openSUSE 2 12-21-2010 08:48 AM
Freecom FSG3 - SU permission denied when attempting chmod or chown Disco181 Linux - General 1 04-29-2010 03:50 AM
Directory based 'sudo chown' rights? TheYanster Linux - Security 11 11-09-2009 02:49 PM
chown delegation to user in some directory Bogdan Linux - Security 3 02-22-2007 04:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration