Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Fedora 9. I removed the user using userdel -r command. The user is removed, but the home directory still remains. When I tried to remove the home directory (rm -rf /home/user/), I get the following message:

rm: cannot remove '/home/user/.gvfs': Permission denied

This happens on random occasions. Which scenario does this occur? Why is this occurring?

share|improve this question

migrated from stackoverflow.com Aug 31 '12 at 15:40

This question came from our site for professional and enthusiast programmers.

1  
By the way, this should only happen if the user is logged into a Gnome session. You shouldn't be removing the home directories of people who are logged in. –  Paul Tomblin Aug 31 '12 at 12:29
    
Hi Paul, Thanks for the reply. I did the delete user operation after logging out the user. Point to note is: userdel -r command has deleted the user. If the user was logged in, the userdel wont delete the user. Only the home directory remains and it is empty. –  Nikhil P Kookkiri Sep 1 '12 at 11:47
1  
On an unrelated but important note: please upgrade from Fedora 9, which is three years past end of life. –  mattdm Sep 2 '12 at 15:03
add comment

1 Answer

I'm surprised you're getting that error instead of Device or resource busy. Nonetheless, I suspect the problem is that something is mounted there. The first step is to check for processes running as the deleted user and kill them all. (If you've removed the user account, you'll have to find them in the process table via the numeric uid.) There's probably something like gvfs-fuse-daemon running. Once that's gone, you should have no problem removing everything.

(It's reasonable to run killall -u targetuser; sleep 5; killall -9 -u targetuser before running userdel -r targetuser.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.