home folder missing after userdel -rf command

Hello All,

i am a new bee to SUSE. and managing a db2 instance on a user db2inst1. unfortunately. one i given a command userdel -rf <another name> after this the home folder is missing . i think it was deleted after the command. please suggest me some steps to recover the /home folder.

no partitions.

thanks in advance,

From your latest backup of course.

BTW I can not realy believe that a userdel -rf delete the complete /home directory. Except when that user had* /home* in the home directory field of that user in* /etc/passwd*. Which would be very strange and unusual also.

Well that’s what -r is documented to do, remove the home directory of the user. Hopefully you had nothing important there and only have to recreate the user account. Otherwise I hope you had a backup. If not, let this be a lesson to you.

As hcvv has assumed, I also assume you didn’t mean /home.

PS: Welcome to the forums.


When you delete something from the command line it is truly deleted. If you have any hope to recover do not add anything new. Do not even boot to that disk since the OS will start reusing those sectors that may still have your data.

You will need to obtain some recovery software and boot from live CD.

Google for “linux data recovery cd”

You will find many options I can’t recommend one since I never have had to do this.

The best way is to simply restore from your backup. You do have a backup don’t you??? :open_mouth:

Perhaps check out “ext3grep” http://groups.google.com/group/ext3grep/web/ext3grep-source-code-and-overview,its on the Parted Magic live CD, I’m assuming an ext3 or ext4 file system.