D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Doh!

 

On 27/10/06, Rob Beard <rob@xxxxxxxxxxxxx> wrote:
Hi folks,

I thought you guys might find this amusing.  It is a warning that even
running commands with sudo can be dangerous!

I was trying to delete some files from my USB pen drive this morning.
For some funny reason I couldn't delete a couple of files out of the
Trash can (I'm running Ubuntu Edgy 6.10 Beta).  I figured, okay I
haven't got time to mess around so I opened up a terminal, changed to
the USB key directory and ran...

rm -fr .Trash-Rob

Great I thought, that's the trash emptied (it was complaining about a
permissions problem which I considered strange on a FAT formatted
device!).

I then wanted to do something else in the terminal window, I think it
was checking the MD5SUMs of Ubuntu Edgy that I had downloaded.

I entered cd / and pressed enter.  Unfortunately I think, I'd hit the
up arrow key a second before so I actually entered the command...

rm -fr .Trash-Rob cd /

Good old Ubuntu remembered my password on the sudo command as I'd
previously entered it a few seconds before.  Before I knew it I was
rm'ing everything from / downwards!

Luckily I caught it in time (Ctrl-C didn't respond) so I closed the
terminal window.  I think it only deleted /bin /sbin /boot and /etc as
my data appears to be intact.  Not ideal as I'll have to reinstall but
still its not the end of the world I guess.  Just as well I downloaded
the Edgy ISO's now :-)

So I guess the moral of the story is even when running sudo, think
before pressing Enter (or at least when using the rm command don't do
rm -fr!).

You probably don't need to reinstall. There's an option in APT or DPKG to rebuild its own database - after that you can just "dpkg --reconfigure -a" and everything will be lovely.

--
Ben Goodger
#391382
---------------------

Mi admiras religiajn; ili estas fine ebliĝinta solvi la maljunegan demandon "kiel oni povas vivi sencerbe?".
It is well-known that I am blunt and unsophisticated. It's largely your fault if you object to this.
-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html