You are not logged in.

#1 2009-05-10 08:55:19

agac
Member
Registered: 2009-05-10
Posts: 6

rm -rf on /home

Hi,

My brother wrote

rm-rf / home

hmm
I quickly turned off the PC, I boot with live (knoppix).
Can I retrieve all the contents of /home?

I found  photos jpeg, files .odt ...      with PhotoRec
but I want to get the /home full.

Thanks

Offline

#2 2009-05-10 09:13:04

deej
Member
Registered: 2008-02-08
Posts: 395

Re: rm -rf on /home

You should 'rm -rf' your brother !*!*!

Try this [ if you were using ext3 ]:

http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html

Good luck...

Deej

Offline

#3 2009-05-10 09:19:34

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: rm -rf on /home

If he entered what you have actually posted i.e. with a space between '/' and 'home', your problem is not just in the /home dir. The command you have given deletes the root dir, and any file or dir called 'home' in the dir where the command was executed.

I have never needed to recover, or attempt to recover, deleted files, but I believe it depends a lot on the filesystem.

Offline

#4 2009-05-10 09:47:37

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: rm -rf on /home

I wonder if you can find out what was deleted. rm -r seems to use the same order as find, (which seems to be neither alphabetical nor based on inode).

If they do use the same order, something like find /home | head could tell you which folder rm was in before dying. It also seems to delete everything in the starting folder first, so see if all your dotfiles are still there.

Offline

#5 2009-05-10 09:58:38

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: rm -rf on /home

You're screwed probably.  Hope you have good backups.  One question, how does your brother have your root password?  If he did that as his user normal user, nothing would be allowed to happen.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2009-05-10 17:53:09

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: rm -rf on /home

Next time don't give your root password away... or stop normally logging in as root.

Offline

#7 2009-05-10 18:06:33

thoffmeyer
Member
From: Chi
Registered: 2006-07-27
Posts: 91

Re: rm -rf on /home

Wow.. yeah ^^ use sudo.

Offline

#8 2009-05-10 18:18:33

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: rm -rf on /home

Man, your brother is a dick.

Offline

#9 2009-05-10 18:28:09

maattd
Member
From: Toulouse, France
Registered: 2008-08-23
Posts: 56
Website

Re: rm -rf on /home

agac wrote:

Hi,

My brother wrote

rm-rf / home

hmm
I quickly turned off the PC, I boot with live (knoppix).
Can I retrieve all the contents of /home?

I found  photos jpeg, files .odt ...      with PhotoRec
but I want to get the /home full.

Thanks

rm-rf ? Without space ? If yes, you are lucky wink

Offline

#10 2009-05-10 21:24:16

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: rm -rf on /home

tomd123 wrote:

Next time don't give your root password away... or stop normally logging in as root.

Although, if his brother really wanted to rape his HDD, he would only need a live CD since root is root.  Still, short of locking down the BIOS w/ a password to boot and physically locking the case, I dunno what else the OP can do.

@op - have you tried beating your brother smile


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2009-05-10 23:01:58

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Re: rm -rf on /home

For the future, since you're using a knoppix liveCD, you should consider setting a BIOS password to keep your brother off the computer's root account.

Either that or remaster the system so the root account has a password.

Hopefully you have found your answer!


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

#12 2009-05-11 08:15:10

agac
Member
Registered: 2009-05-10
Posts: 6

Re: rm -rf on /home

Unfortunately he wrote
rm -rf /home


He wanted to install vlc, I logged on as root and I left to with pacman
: rolleyes:

I have lost any important file.

The partition /home is separate from /

In conclusion, it is impossible to find
/home as a whole and so the entire partition.

Offline

#13 2009-05-11 09:03:42

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: rm -rf on /home

I've checked the big book of sibling etiquette and chapter 4, section 5a clearly states that a severe beating is required in this situation.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#14 2009-05-11 11:00:45

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: rm -rf on /home

omg look at Xyne's post count XD
1337


OP: You need to lay the law down on your brother. I would go ape s*** if my bro did that to me


neutral

Offline

#15 2009-05-11 13:04:25

Joe_Arch
Member
Registered: 2008-11-27
Posts: 67

Re: rm -rf on /home

Dude that's rough. Was it his idea of a joke or something?

Offline

#16 2009-05-11 13:06:49

agac
Member
Registered: 2009-05-10
Posts: 6

Re: rm -rf on /home

I prefer my brother that the /home smile

Offline

#17 2009-05-11 13:12:39

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: rm -rf on /home

agac wrote:

I prefer my brother that the /home smile

+1


Matt

"It is very difficult to educate the educated."

Offline

#18 2009-05-11 13:56:15

Lexion
Member
Registered: 2008-03-23
Posts: 510

Re: rm -rf on /home

You should keep backups, and not brothers.  Also if you do make a backup, hide it from your brother. 

Let this be a lesson for us all to make backups, don't stay as root, and keep brothers in primordial fear.


urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand

Offline

#19 2009-05-11 14:02:21

agac
Member
Registered: 2009-05-10
Posts: 6

Re: rm -rf on /home

I is misunderstood,
I have lost any files (photos, videos, etc. ..) and I made regular backups
(every 15 days).

My question is to find the /home and not to set again software.
I have always the system partition /

Offline

#20 2009-05-11 18:05:14

windtalker
Member
Registered: 2008-03-17
Posts: 220

Re: rm -rf on /home

You can try this:

http://www.faqs.org/docs/Linux-mini/Par … RECOVERING

Good luck.
Myself, I'd start over from scratch since everything was backed up then booby trap my deskchair in case the wrong sized butt checks were ever planted in it.

Offline

#21 2009-05-11 19:34:51

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: rm -rf on /home

If the /home dir no longer exists, just recreate it, and mount the required partition on it. Then recreate any user dirs you need, and restore your files from backup.

Offline

#22 2009-05-11 21:25:11

agac
Member
Registered: 2009-05-10
Posts: 6

Re: rm -rf on /home

tomk wrote:

If the /home dir no longer exists, just recreate it, and mount the required partition on it. Then recreate any user dirs you need, and restore your files from backup.

But I have no backup configuration files of programs (konqueror, mplayer,
thunderbird (mails  ...)

Offline

#23 2009-05-11 22:09:13

syntaxerrormmm
Member
From: Italy
Registered: 2008-10-22
Posts: 80
Website

Re: rm -rf on /home

agac wrote:

But I have no backup configuration files of programs (konqueror, mplayer,
thunderbird (mails  ...)

So, you *don't* have a backup. You just saved what you thought were important files.

If I was in the same situation, I will surely ban my brother from Linux Heaven and leave him punished by some devilish airy (because of open Windows) operative systems. Also, I will start over and reconfigure all from the scratch. Lost emails? Definitely a bad idea not to set the option "Leave mails on server" for your POP3 accounts or not to use IMAP...

Do not frustrate yourself too much, though: it's just gained experience smile


syntaxerrormmm - Homepage

Offline

#24 2009-05-12 03:09:36

jwcxz
Member
Registered: 2008-09-23
Posts: 239
Website

Re: rm -rf on /home

It would be nice to patch rm so that if you try to delete an important directory like your home directory or /, it will ask for your password or the root password again.  Is this possible?


-- jwc
http://jwcxz.com/ | blog
dotman - manage your dotfiles across multiple environments
icsy - an alarm for powernappers

Offline

#25 2009-05-12 03:28:47

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: rm -rf on /home

It's actually been done, surprisingly. But there are so many ways of irrevocably clobbering your data... what's the point?

Do you want Linux to be like Windows, asking for confirmation whenever you so much as move the mouse?

Last edited by Peasantoid (2009-05-12 03:29:42)

Offline

Board footer

Powered by FluxBB