LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-15-2011, 04:12 PM   #1
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Rep: Reputation: 0
unable to remove user home directory


CentOS 5.5. attempting to remove a home directory that is currently not assigned to any group or user.
Code:
[root@computer home]# ls -lah
total 20K
drwxr-xr-x 14 root       root       4.0K Nov 14 15:09 .
drwxr-xr-x 26 root       root       4.0K Nov  8 14:31 ..
drwx------  4  511        511       4.0K Nov 14 17:11 olduser
drwx------  4  511        511       4.0K Jul  6 10:41 olduser2
drwx------  3  512        512       4.0K Nov 10 16:25 share

[root@computer home]#
Someone previously removed the users but left the mail and home dir.

Code:
[root@computer home]# rm -rf olduser
rm: cannot chdir from `.' to `olduser': Permission denied
[root@computer home]#
I tried rm and rmdir but I can't even cd into the directory. Any suggestions?

Last edited by daisychick; 11-15-2011 at 04:30 PM.
 
Old 11-15-2011, 04:34 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Is that directory local, or mounted from an NFS share?
 
Old 11-15-2011, 04:48 PM   #3
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
derpa derp. Nice catch. Totally NFS. How could you tell? From the output or from the behavior?
 
Old 11-15-2011, 04:50 PM   #4
inoculos
Member
 
Registered: Apr 2009
Location: Seattle
Distribution: Arch, Crunchbang, Fedora
Posts: 38

Rep: Reputation: 6
Forgive me if i'm missing something, Doesn't the number 511 refer to the owner of the file? maybe something like

su
userdel -r 511
 
Old 11-15-2011, 04:51 PM   #5
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
I was able to delete them by deleting the user on the NFS share system.
 
Old 11-15-2011, 04:52 PM   #6
inoculos
Member
 
Registered: Apr 2009
Location: Seattle
Distribution: Arch, Crunchbang, Fedora
Posts: 38

Rep: Reputation: 6
Oh just saw that, sorry
 
Old 11-15-2011, 05:37 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by daisychick View Post
derpa derp. Nice catch. Totally NFS. How could you tell? From the output or from the behavior?
Any time you get a permission denied message when you try to "rm -f" a file while you're root (ignoring drives mounted in read only mode), chances are the file isn't local. NFS is the easiest explanation for why that might be.

Last edited by suicidaleggroll; 11-15-2011 at 05:38 PM.
 
Old 11-15-2011, 07:05 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by daisychick View Post
derpa derp. Nice catch. Totally NFS. How could you tell? From the output or from the behavior?
Experience ;}


Behaviour - if root can't delete files it's either "not on his box", and root_squash
enabled, or something seriously wrong w/ the underlying fs ...
 
Old 11-16-2011, 12:13 AM   #9
daisychick
Member
 
Registered: Nov 2006
Location: Texas
Distribution: ubuntu 12.04 LTS
Posts: 154

Original Poster
Rep: Reputation: 0
thanks to all for the input
 
  


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] 'Could not chdir to home directory /home/[user]: Permission denied' arashi256 Linux - Newbie 25 11-11-2011 10:29 AM
Unable to access home directory of AD user after logging in via SSH with Samba transient Linux - Software 1 08-24-2011 01:01 PM
[SOLVED] How can i change my HOME (/home/user) directory location to something else? QueenZ Linux - Newbie 6 08-05-2010 07:26 AM
Unable to remove directory twk Linux - Software 3 10-13-2009 09:12 PM
Active Directory User Cannot Write to Samba Home Directory jonwatson Linux - Networking 2 12-19-2006 01:40 PM


All times are GMT -5. The time now is 03:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration