Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-14-2010, 09:01 PM
|
#1
|
|
Member
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225
Rep:
|
du says "cannot read directory" and "permission denied", but I have rwx permissions
I am running Karmic. du is giving me errors for folders in my home directory. The errors say "cannot read directory" and "permission denied". But I have rwx permission on those folders. I get the same errors when running du as root.
Here is a session demonstrating the error and that I do have access to the folders.
Code:
rsyring@antec:~/programs$ du -sh
du: cannot read directory `./netbeans-6.8/ruby2': Permission denied
du: cannot read directory `./netbeans-6.8/etc': Permission denied
du: cannot read directory `./netbeans-6.8/bin': Permission denied
du: cannot read directory `./javapwsafe': Permission denied
du: cannot read directory `./mprime': Permission denied
96M .
rsyring@antec:~/programs$ chown -R rsyring:rsyring javapwsafe/
rsyring@antec:~/programs$ man chmod
rsyring@antec:~/programs$ chmod u+rX -R javapwsafe/
rsyring@antec:~/programs$ du -sh
du: cannot read directory `./netbeans-6.8/ruby2': Permission denied
du: cannot read directory `./netbeans-6.8/etc': Permission denied
du: cannot read directory `./netbeans-6.8/bin': Permission denied
du: cannot read directory `./javapwsafe': Permission denied
du: cannot read directory `./mprime': Permission denied
96M .
rsyring@antec:~/programs$ ls -l
total 12
drwxr-xr-x 3 rsyring rsyring 4096 2010-03-12 23:28 javapwsafe
drwxr-xr-x 2 rsyring rsyring 4096 2010-01-18 11:14 mprime
drwxr-xr-x 9 rsyring rsyring 4096 2010-02-19 23:33 netbeans-6.8
rsyring@antec:~/programs$ touch javapwsafe/
rsyring@antec:~/programs$ du -sh
du: cannot read directory `./netbeans-6.8/ruby2': Permission denied
du: cannot read directory `./netbeans-6.8/etc': Permission denied
du: cannot read directory `./netbeans-6.8/bin': Permission denied
du: cannot read directory `./javapwsafe': Permission denied
du: cannot read directory `./mprime': Permission denied
96M .
rsyring@antec:~/programs$ touch ./javapwsafe/
This is really confusing...thank you for your help in advance.
|
|
|
|
04-14-2010, 10:27 PM
|
#2
|
|
Member
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Vector Linux
Posts: 945
Rep:
|
Maybe they're links to other directories or files on your system.
|
|
|
|
04-14-2010, 10:33 PM
|
#3
|
|
Member
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225
Original Poster
Rep:
|
Quote:
Originally Posted by mark_alfred
Maybe they're links to other directories or files on your system.
|
Thanks, but I don't think that is the case. `ls -l` does not show a symlink.
|
|
|
|
04-14-2010, 11:21 PM
|
#4
|
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
The contents determine the permissions too, not just who owns the directories. You don't list the contents so we are guessing.
|
|
|
|
04-14-2010, 11:56 PM
|
#5
|
|
Member
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225
Original Poster
Rep:
|
Quote:
Originally Posted by smoker
The contents determine the permissions too, not just who owns the directories. You don't list the contents so we are guessing.
|
As noted above, I recursively chowned and chmoded one of the directories, so I don't think its a problem with the contents in the directory. But one example:
Code:
rsyring@antec:~/programs$ ls -l javapwsafe/
total 176
drwxr-xr-x 2 rsyring rsyring 4096 2010-03-12 23:28 lib
-rw-r--r-- 1 rsyring rsyring 9174 2010-02-15 07:50 LICENSE
-rw-r--r-- 1 rsyring rsyring 154662 2010-02-15 07:50 PasswordSafeSWT.jar
-rwxr-xr-x 1 rsyring rsyring 6877 2010-02-15 07:50 pwsafe.sh
Something interesting is that it happens even with an new & empty directory:
Code:
rsyring@antec:~/programs$ mkdir test
rsyring@antec:~/programs$ du -h --max-depth=1
du: cannot read directory `./netbeans-6.8/ruby2': Permission denied
du: cannot read directory `./netbeans-6.8/etc': Permission denied
du: cannot read directory `./netbeans-6.8/bin': Permission denied
96M ./netbeans-6.8
du: cannot read directory `./test': Permission denied
4.0K ./test
du: cannot read directory `./javapwsafe': Permission denied
4.0K ./javapwsafe
du: cannot read directory `./mprime': Permission denied
4.0K ./mprime
|
|
|
|
04-15-2010, 12:14 AM
|
#6
|
|
ELF Statifier author
Registered: Oct 2007
Posts: 648
Rep: 
|
Quote:
Originally Posted by mrtwice
As noted above, I recursively chowned and chmoded one of the directories, so I don't think its a problem with the contents in the directory. But one example:
Code:
rsyring@antec:~/programs$ ls -l javapwsafe/
total 176
drwxr-xr-x 2 rsyring rsyring 4096 2010-03-12 23:28 lib
-rw-r--r-- 1 rsyring rsyring 9174 2010-02-15 07:50 LICENSE
-rw-r--r-- 1 rsyring rsyring 154662 2010-02-15 07:50 PasswordSafeSWT.jar
-rwxr-xr-x 1 rsyring rsyring 6877 2010-02-15 07:50 pwsafe.sh
Something interesting is that it happens even with an new & empty directory:
Code:
rsyring@antec:~/programs$ mkdir test
rsyring@antec:~/programs$ du -h --max-depth=1
du: cannot read directory `./netbeans-6.8/ruby2': Permission denied
du: cannot read directory `./netbeans-6.8/etc': Permission denied
du: cannot read directory `./netbeans-6.8/bin': Permission denied
96M ./netbeans-6.8
du: cannot read directory `./test': Permission denied
4.0K ./test
du: cannot read directory `./javapwsafe': Permission denied
4.0K ./javapwsafe
du: cannot read directory `./mprime': Permission denied
4.0K ./mprime
|
Strange. Did you try to run du as root ?
Another suggestions: run du under srrace and try fsck. May be something wrong with filesystem
|
|
|
|
04-15-2010, 12:29 AM
|
#7
|
|
Member
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225
Original Poster
Rep:
|
Quote:
Originally Posted by Valery Reznic
Strange. Did you try to run du as root ?
Another suggestions: run du under srrace and try fsck. May be something wrong with filesystem
|
I get the same errors when running du as root.
I will have to look into srrace, I already did an fsck.
|
|
|
|
04-15-2010, 12:33 AM
|
#8
|
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
Where is the programs directory ?
I know it's in your home but is it mounted from somewhere else (samba share, usb stick etc) ?
what happens with du -sh ~
Last edited by smoker; 04-15-2010 at 12:34 AM.
|
|
|
|
04-15-2010, 12:46 AM
|
#9
|
|
Member
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225
Original Poster
Rep:
|
Quote:
Originally Posted by smoker
Where is the programs directory ?
I know it's in your home but is it mounted from somewhere else (samba share, usb stick etc) ?
what happens with du -sh ~
|
Its just a normal folder.
Code:
rsyring@antec:~$ du -sh ~
du: cannot read directory `/home/rsyring/programs/netbeans-6.8/ruby2': Permission denied
du: cannot read directory `/home/rsyring/programs/netbeans-6.8/etc': Permission denied
du: cannot read directory `/home/rsyring/programs/netbeans-6.8/bin': Permission denied
du: cannot read directory `/home/rsyring/programs/test': Permission denied
du: cannot read directory `/home/rsyring/programs/javapwsafe': Permission denied
du: cannot read directory `/home/rsyring/programs/mprime': Permission denied
du: cannot read directory `/home/rsyring/.autotest_images': Permission denied
du: cannot read directory `/home/rsyring/mnt': Permission denied
du: cannot read directory `/home/rsyring/.vim': Permission denied
du: cannot read directory `/home/rsyring/.dropbox': Permission denied
du: cannot read directory `/home/rsyring/.yolk': Permission denied
du: cannot read directory `/home/rsyring/dev': Permission denied
du: cannot read directory `/home/rsyring/.pyNeighborhood': Permission denied
du: cannot read directory `/home/rsyring/.gnome2': Permission denied
du: cannot read directory `/home/rsyring/.passwordsafe': Permission denied
du: cannot read directory `/home/rsyring/.bundle': Permission denied
du: cannot read directory `/home/rsyring/Documents': Permission denied
du: cannot read directory `/home/rsyring/.openoffice.org': Permission denied
du: cannot read directory `/home/rsyring/.dropbox-dist': Permission denied
du: cannot read directory `/home/rsyring/.gconf': Permission denied
du: cannot read directory `/home/rsyring/Komodo-Edit-5': Permission denied
du: cannot read directory `/home/rsyring/.gnome2_private': Permission denied
du: cannot read directory `/home/rsyring/.mozilla': Permission denied
du: cannot read directory `/home/rsyring/.unison': Permission denied
du: cannot read directory `/home/rsyring/.update-notifier': Permission denied
du: cannot read directory `/home/rsyring/.adobe': Permission denied
du: cannot read directory `/home/rsyring/tmp': Permission denied
du: cannot read directory `/home/rsyring/.dropbox-dist-new': Permission denied
du: cannot read directory `/home/rsyring/.local': Permission denied
du: cannot read directory `/home/rsyring/Audio': Permission denied
du: cannot read directory `/home/rsyring/.wapi': Permission denied
du: cannot read directory `/home/rsyring/.netbeans': Permission denied
du: cannot read directory `/home/rsyring/.pyrenamer': Permission denied
du: cannot read directory `/home/rsyring/Downloads': Permission denied
du: cannot read directory `/home/rsyring/Videos': Permission denied
du: cannot read directory `/home/rsyring/.ri': Permission denied
du: cannot read directory `/home/rsyring/Dropbox': Permission denied
du: cannot read directory `/home/rsyring/backups': Permission denied
du: cannot read directory `/home/rsyring/.vmware': Permission denied
du: cannot read directory `/home/rsyring/.gegl-0.0': Permission denied
du: cannot read directory `/home/rsyring/.gstreamer-0.10': Permission denied
du: cannot read directory `/home/rsyring/.nbi': Permission denied
du: cannot read directory `/home/rsyring/.thunderbird': Permission denied
du: cannot read directory `/home/rsyring/.nautilus': Permission denied
du: cannot read directory `/home/rsyring/.AbiSuite': Permission denied
du: cannot read directory `/home/rsyring/.mozilla-thunderbird': Permission denied
du: cannot read directory `/home/rsyring/.filezilla': Permission denied
du: cannot read directory `/home/rsyring/.update-manager-core': Permission denied
du: cannot read directory `/home/rsyring/.tortoisehg': Permission denied
du: cannot read directory `/home/rsyring/nb_projects': Permission denied
du: cannot read directory `/home/rsyring/.rvm': Permission denied
du: cannot read directory `/home/rsyring/vmware': Permission denied
du: cannot read directory `/home/rsyring/.purple': Permission denied
du: cannot read directory `/home/rsyring/.config': Permission denied
du: cannot read directory `/home/rsyring/.svnqt': Permission denied
du: cannot read directory `/home/rsyring/.VirtualBox': Permission denied
du: cannot read directory `/home/rsyring/.gem': Permission denied
du: cannot read directory `/home/rsyring/bin': Permission denied
du: cannot read directory `/home/rsyring/.netbeans-registration': Permission denied
du: cannot read directory `/home/rsyring/Public': Permission denied
du: cannot read directory `/home/rsyring/.kde': Permission denied
du: cannot read directory `/home/rsyring/.python-eggs': Permission denied
du: cannot read directory `/home/rsyring/.esets': Permission denied
du: cannot read directory `/home/rsyring/.virtinst': Permission denied
du: cannot read directory `/home/rsyring/.putty': Permission denied
du: cannot read directory `/home/rsyring/Templates': Permission denied
du: cannot read directory `/home/rsyring/.ri1.9.1': Permission denied
du: cannot read directory `/home/rsyring/.dbus': Permission denied
du: cannot read directory `/home/rsyring/.ssh': Permission denied
du: cannot read directory `/home/rsyring/.subversion': Permission denied
du: cannot read directory `/home/rsyring/.virt-manager': Permission denied
du: cannot read directory `/home/rsyring/.gconfd': Permission denied
du: cannot read directory `/home/rsyring/.macromedia': Permission denied
du: cannot read directory `/home/rsyring/.komodoedit': Permission denied
du: cannot read directory `/home/rsyring/Desktop': Permission denied
du: cannot read directory `/home/rsyring/.thumbnails': Permission denied
du: cannot read directory `/home/rsyring/.cache': Permission denied
|
|
|
|
04-15-2010, 12:50 AM
|
#10
|
|
Member
Registered: Apr 2009
Posts: 214
Rep:
|
Generic faultfinding:
does this happen consistently for all folders, or only for the dirs under the programs folder? If so, what is the difference with the programs folder?
Substitute 'programs' for 'home', 'root', etc....
Can you make it work at all? i.e. Does du have access to any folders?
Last edited by bakdong; 04-15-2010 at 12:52 AM.
|
|
|
|
04-17-2010, 01:56 PM
|
#11
|
|
Member
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225
Original Poster
Rep:
|
Quote:
Originally Posted by bakdong
Generic faultfinding:
does this happen consistently for all folders, or only for the dirs under the programs folder? If so, what is the difference with the programs folder?
Substitute 'programs' for 'home', 'root', etc....
Can you make it work at all? i.e. Does du have access to any folders?
|
I was just using the programs folder as an example. It happens for many folders, even when acting as root:
Code:
rsyring@antec:~$ sudo du -h --max-depth=1
24K ./.TaskCoach
524K ./.fontconfig
4.0K ./.gvfs
7.3M ./Music
20K ./.tsclient
4.0K ./Pictures
12K ./.smbpasswords
20K ./.sqlitestudio
8.0K ./.hplip
456K ./.gimp-2.6
du: cannot read directory `./programs/netbeans-6.8/ruby2': Permission denied
du: cannot read directory `./programs/netbeans-6.8/etc': Permission denied
du: cannot read directory `./programs/netbeans-6.8/bin': Permission denied
du: cannot read directory `./programs/test': Permission denied
du: cannot read directory `./programs/javapwsafe': Permission denied
du: cannot read directory `./programs/mprime': Permission denied
96M ./programs
du: cannot read directory `./.autotest_images': Permission denied
4.0K ./.autotest_images
du: cannot read directory `./mnt': Permission denied
4.0K ./mnt
du: cannot read directory `./.vim': Permission denied
4.0K ./.vim
du: cannot read directory `./.dropbox': Permission denied
4.0K ./.dropbox
du: cannot read directory `./.yolk': Permission denied
4.0K ./.yolk
du: cannot read directory `./dev': Permission denied
4.0K ./dev
du: cannot read directory `./.pyNeighborhood': Permission denied
4.0K ./.pyNeighborhood
du: cannot read directory `./.gnome2': Permission denied
4.0K ./.gnome2
du: cannot read directory `./.passwordsafe': Permission denied
4.0K ./.passwordsafe
du: cannot read directory `./.bundle': Permission denied
4.0K ./.bundle
du: cannot read directory `./Documents': Permission denied
4.0K ./Documents
du: cannot read directory `./.openoffice.org': Permission denied
4.0K ./.openoffice.org
du: cannot read directory `./.dropbox-dist': Permission denied
4.0K ./.dropbox-dist
du: cannot read directory `./.gconf': Permission denied
4.0K ./.gconf
du: cannot read directory `./Komodo-Edit-5': Permission denied
4.0K ./Komodo-Edit-5
du: cannot read directory `./.gnome2_private': Permission denied
4.0K ./.gnome2_private
du: cannot read directory `./.mozilla': Permission denied
4.0K ./.mozilla
du: cannot read directory `./.unison': Permission denied
4.0K ./.unison
du: cannot read directory `./.update-notifier': Permission denied
4.0K ./.update-notifier
du: cannot read directory `./.adobe': Permission denied
4.0K ./.adobe
du: cannot read directory `./tmp': Permission denied
4.0K ./tmp
du: cannot read directory `./.dropbox-dist-new': Permission denied
4.0K ./.dropbox-dist-new
du: cannot read directory `./.local': Permission denied
4.0K ./.local
du: cannot read directory `./Audio': Permission denied
4.0K ./Audio
du: cannot read directory `./.wapi': Permission denied
4.0K ./.wapi
du: cannot read directory `./.netbeans': Permission denied
4.0K ./.netbeans
du: cannot read directory `./.pyrenamer': Permission denied
4.0K ./.pyrenamer
du: cannot read directory `./Downloads': Permission denied
4.0K ./Downloads
du: cannot read directory `./Videos': Permission denied
4.0K ./Videos
du: cannot read directory `./.ri': Permission denied
4.0K ./.ri
du: cannot read directory `./Dropbox': Permission denied
4.0K ./Dropbox
du: cannot read directory `./backups': Permission denied
4.0K ./backups
du: cannot read directory `./.vmware': Permission denied
4.0K ./.vmware
du: cannot read directory `./.gegl-0.0': Permission denied
4.0K ./.gegl-0.0
du: cannot read directory `./.gstreamer-0.10': Permission denied
4.0K ./.gstreamer-0.10
du: cannot read directory `./.nbi': Permission denied
4.0K ./.nbi
du: cannot read directory `./.thunderbird': Permission denied
4.0K ./.thunderbird
du: cannot read directory `./.nautilus': Permission denied
4.0K ./.nautilus
du: cannot read directory `./.AbiSuite': Permission denied
4.0K ./.AbiSuite
du: cannot read directory `./.mozilla-thunderbird': Permission denied
20K ./.mozilla-thunderbird
du: cannot read directory `./.filezilla': Permission denied
4.0K ./.filezilla
du: cannot read directory `./.update-manager-core': Permission denied
4.0K ./.update-manager-core
du: cannot read directory `./.tortoisehg': Permission denied
4.0K ./.tortoisehg
du: cannot read directory `./nb_projects': Permission denied
4.0K ./nb_projects
du: cannot read directory `./.rvm': Permission denied
4.0K ./.rvm
du: cannot read directory `./vmware': Permission denied
4.0K ./vmware
du: cannot read directory `./.purple': Permission denied
4.0K ./.purple
du: cannot read directory `./.config': Permission denied
4.0K ./.config
du: cannot read directory `./.svnqt': Permission denied
4.0K ./.svnqt
du: cannot read directory `./.VirtualBox': Permission denied
4.0K ./.VirtualBox
du: cannot read directory `./.gem': Permission denied
4.0K ./.gem
du: cannot read directory `./bin': Permission denied
4.0K ./bin
du: cannot read directory `./.netbeans-registration': Permission denied
4.0K ./.netbeans-registration
du: cannot read directory `./Public': Permission denied
4.0K ./Public
du: cannot read directory `./.kde': Permission denied
4.0K ./.kde
du: cannot read directory `./.python-eggs': Permission denied
4.0K ./.python-eggs
du: cannot read directory `./.esets': Permission denied
4.0K ./.esets
du: cannot read directory `./.virtinst': Permission denied
4.0K ./.virtinst
du: cannot read directory `./.putty': Permission denied
4.0K ./.putty
du: cannot read directory `./Templates': Permission denied
4.0K ./Templates
du: cannot read directory `./.ri1.9.1': Permission denied
4.0K ./.ri1.9.1
du: cannot read directory `./.dbus': Permission denied
4.0K ./.dbus
du: cannot read directory `./.ssh': Permission denied
4.0K ./.ssh
du: cannot read directory `./.subversion': Permission denied
4.0K ./.subversion
du: cannot read directory `./.virt-manager': Permission denied
4.0K ./.virt-manager
du: cannot read directory `./.gconfd': Permission denied
4.0K ./.gconfd
du: cannot read directory `./.macromedia': Permission denied
4.0K ./.macromedia
du: cannot read directory `./.komodoedit': Permission denied
4.0K ./.komodoedit
du: cannot read directory `./Desktop': Permission denied
4.0K ./Desktop
du: cannot read directory `./.thumbnails': Permission denied
4.0K ./.thumbnails
du: cannot read directory `./.cache': Permission denied
4.0K ./.cache
107M .
|
|
|
|
04-17-2010, 02:33 PM
|
#12
|
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
I think it's interesting that all the results are listing ./ <directory> instead of just / <directory>
Are you going to the root directory first and running this ?
i.e.
Obviously run this as root.
I would get a live cd and access your disks using that.
If you find du works fine from the live cd, I would guess that your system has become compromised and du is under the control of a malicious program or user.
do any other tools generate a similar error (df, stat, etc) ?
Also check the du binary (find it with which du) and check its modification times and size against a known working du binary (such as on the live cd).
Last edited by smoker; 04-17-2010 at 02:39 PM.
|
|
|
|
04-21-2010, 10:33 AM
|
#13
|
|
Member
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225
Original Poster
Rep:
|
Went ahead and installed the live CD and got an MD5 sum of du, but more importantly mounted the file system and ran du without problems from there.
Took the md5sum and compared to my installed system and it was the same. That got me thinking that it must be something installed on this system, most likely at the kernel level, if it was interfering with basic file system operations. Then I remembered that I had a beta install of nod32 antivirus running. Uninstalled it and no more permission problems.
Filing a bug report now.... 
|
|
|
|
04-21-2010, 12:32 PM
|
#14
|
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
Good to hear you tracked it down.
Just as a general note for others who might read this,
One can never have too much information when dealing with these problems, so even if something should be alright, it's always worth making sure that it is alright.
It's the old ASS out of U and ME thing.
By testing things out thoroughly, you gradually remove the things it can't be, until, as Sherlock would say, "whatever remains must be the truth".
Last edited by smoker; 04-21-2010 at 12:38 PM.
|
|
|
|
04-21-2010, 12:38 PM
|
#15
|
|
Member
Registered: Apr 2009
Posts: 214
Rep:
|
Thanks for the info. I've had problems with anti virus on Macs also. Always good to have more info.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:59 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|