Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
'rm -rf /' ?(The wonders of 'emerge -e')
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
esapersona
n00b
n00b


Joined: 17 May 2003
Posts: 16
Location: Perth, Western Australia

PostPosted: Mon Jun 16, 2003 7:34 am    Post subject: 'rm -rf /' ?(The wonders of 'emerge -e') Reply with quote

ArgH!

I thought that I would benchmark some different filesystems (encrypted and not) and wrote a script to help me out. A portion of that script:
Code:
rm -rf $2/*

Ran great until I thought I'd try something different:
Code:
#time ./bench "/mnt/stor..... /mnt/fileSystem..."


Forgetting that the quotes would become $1...DOH! (because $2 was now empty, the rm -rf $2/* became rm -rf /*) :oops:

But that's okay - Thanks to my quick reflexes :roll: , I managed to ctrl-c. Only a few symlinks in /dev, and my /bin directory died. (thanks to whoever thought to not have /boot mounted automatically in the install instructions!).

But here is my tip:
My friend suggested I reinstall, but don't allow anything to be overwritten...but Gentoo is freaking great and has a better solution:
I slapped my knoppix cd in and untar'd my stage1 tarball into a ramdisk. I then copied the /bin part over to my crippled partition, chrooted and typed:
Code:
emerge -e system


And soon, if that doesn't fix everything:
Code:
emerge -e world


Perhaps this really doesn't need to be posted, but I felt that I should just in case someone else does something similar and doesn't have a friend to bring up these brilliant suggestions...
(and also so that someone can point out anything else that I may need to do :wink: )
Back to top
View user's profile Send private message
russo79
n00b
n00b


Joined: 22 May 2003
Posts: 27

PostPosted: Mon Jun 16, 2003 12:39 pm    Post subject: Reply with quote

Better yet:

Use qpkg -I -c -v to check all the damaged packages
and emerge only the ones that have files the are missing!!!

Just my 2 cents :-)


Last edited by russo79 on Fri Feb 18, 2005 9:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
esapersona
n00b
n00b


Joined: 17 May 2003
Posts: 16
Location: Perth, Western Australia

PostPosted: Mon Jun 16, 2003 1:27 pm    Post subject: Reply with quote

Hmm...That would be good, if I had qpkg =/

It's not a standard Gentoo thing, is it?

*edit* RTFM (okay - qpkg is in gentoolkit) Thanks alot! =) */edit*


Last edited by esapersona on Mon Jun 16, 2003 1:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
bsolar
Bodhisattva
Bodhisattva


Joined: 12 Jan 2003
Posts: 2764

PostPosted: Mon Jun 16, 2003 1:50 pm    Post subject: Reply with quote

esapersona wrote:
It's not a standard Gentoo thing, is it?

It's in the gentoolkit package.
_________________
I may not agree with what you say, but I'll defend to the death your right to say it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum