Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Aug 31 '12 at 15:40

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

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .