Horror Stories

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
GrimReaper
Posts: 25
Joined: Wed Sep 24, 2008 5:00 am UTC

Horror Stories

Postby GrimReaper » Mon Jan 12, 2009 8:07 am UTC

I have recently been reforming an old barely-working Windows laptop into an excellent Ubuntu computer.
I had basically just finished twerking it when I decided I was sick of all of those "permission denied" dialogs.

So, I decided to run "sudo chmod -r 777 *" in root.
BAD DECISION. To put it simply, I BROKE EVERYTHING.

So there's my example, what are some of your horror stories that you have brought upon yourself in any OS?

Edit: In case anyone is wondering, this is my first true experience in Linux, it's not like I've been using it for years and then screwed up this ridiculously. And yes, I did learn from my experience :wink:
Update: It's reinstalled and alive! Hurray....
ImageImage
This link kills spam
Some people never go crazy. What truly horrible lives they must lead.

User avatar
Cleverbeans
Posts: 1378
Joined: Wed Mar 26, 2008 1:16 pm UTC

Re: Horror Stories

Postby Cleverbeans » Mon Jan 12, 2009 3:29 pm UTC

Well, when I was a kid our family PC didn't have enough "memory" to play a flight simulator I'd gotten my hands on, so I assumed the problem was the fact that out 10MB hard drive had been partitioned into five 2MB partitions. A quick FDisk fixed the partition problem, and handily destroyed 3 years worth of bookkeeping for my dad's business. Opps.
"Labor is prior to, and independent of, capital. Capital is only the fruit of labor, and could never have existed if labor had not first existed. Labor is the superior of capital, and deserves much the higher consideration." - Abraham Lincoln

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Horror Stories

Postby Rysto » Mon Jan 12, 2009 5:36 pm UTC

I once ran the following command:

cp /mnt/nfs/build/libc.so /lib/libc.so

It took an hour to get the system into a usable state again.

User avatar
wst
Posts: 2613
Joined: Sat Nov 24, 2007 10:06 am UTC

Re: Horror Stories

Postby wst » Mon Jan 12, 2009 6:22 pm UTC

NB: I'm terrible at CLI

I edited xorg.conf and put the wrong thing in the wrong place.
Next boot "Oh shit I broke X"
I fixed it, with numerous hard reboots, and Vim. (I didn't know how to save with VIM and typing Vim --help didn't.)
Took ~30 minutes to fix. Not bad for a newb.
Anything I said pre-2014 that you want to quote me on, just run it past me to check I still agree with myself.

mij
Posts: 7
Joined: Tue Dec 30, 2008 3:03 am UTC

Re: Horror Stories

Postby mij » Mon Jan 12, 2009 6:56 pm UTC

When I was new to linux, I was trying to install a caml compiler. I found some instructions on a forum and started to copy-paste everything mechanically. One of the steps was something like "sudo rm -r /usr/local/lib/caml/" but I accidentally
copied only "sudo rm -r /". I didn't realized what was going like for two or three seconds, when I directly pulled the plug.

Surprisingly enough the system worked for several months after that incident without any problem.

User avatar
Izawwlgood
WINNING
Posts: 18686
Joined: Mon Nov 19, 2007 3:55 pm UTC
Location: There may be lovelier lovelies...

Re: Horror Stories

Postby Izawwlgood » Mon Jan 12, 2009 7:05 pm UTC

I'm not a linux user, but am curious what these commands do, for the sake of understanding the horror stories. Can someone post some translations?
... with gigantic melancholies and gigantic mirth, to tread the jeweled thrones of the Earth under his sandalled feet.

mij
Posts: 7
Joined: Tue Dec 30, 2008 3:03 am UTC

Re: Horror Stories

Postby mij » Mon Jan 12, 2009 7:24 pm UTC

"sudo chmod -r 777 *" in root changes the permissions of every file of the computer so that every user can read, write or execute everything.

"sudo rm -r /" deletes every file in the system.

qbg
Posts: 586
Joined: Tue Dec 18, 2007 3:37 pm UTC

Re: Horror Stories

Postby qbg » Mon Jan 12, 2009 8:16 pm UTC

Way back in the days of MSDOS, I wanted to run memmaker but I didn't have it on the computer I was using. I did however have the installation disks, so I just copied the memmaker.ex_ and renamed it to memmaker.exe. The program ran and it went through two reboots before messing up the system. I did not uncompress the file, which leaves me surprised at how long it worked...

User avatar
hotaru
Posts: 1045
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Horror Stories

Postby hotaru » Mon Jan 12, 2009 8:19 pm UTC

wst wrote:(I didn't know how to save with VIM and typing Vim --help didn't.)

i blame gnu for that. if it weren't for all their --help and gnu info idiocy, you'd have known that looking at the man page is the first thing you should do when you don't know how to use a program.

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

Unparallelogram
Posts: 336
Joined: Mon Jul 28, 2008 4:16 am UTC

Re: Horror Stories

Postby Unparallelogram » Mon Jan 12, 2009 9:49 pm UTC

I pulled an external .deb from Debian unstable into Ubuntu and totally broke dependencies. Apt was convinced I needed to uninstall my base system entirely because it wasn't quite recent enough.

User avatar
wst
Posts: 2613
Joined: Sat Nov 24, 2007 10:06 am UTC

Re: Horror Stories

Postby wst » Mon Jan 12, 2009 10:05 pm UTC

hotaru wrote:
wst wrote:(I didn't know how to save with VIM and typing Vim --help didn't.)

i blame gnu for that. if it weren't for all their --help and gnu info idiocy, you'd have known that looking at the man page is the first thing you should do when you don't know how to use a program.
I just guessed. I found that hitting Esc did something, then I saw I could type commands then, and then I figured out that I should type 'exit' :D
Anything I said pre-2014 that you want to quote me on, just run it past me to check I still agree with myself.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Horror Stories

Postby Berengal » Mon Jan 12, 2009 10:21 pm UTC

This happened just today.
Some time ago I installed linux on the machine of a friend of mine alongside windows. For reasons unknown to man, however, his keyboard doesn't work in the bios or grub at all, and since I had set windows to his default OS that's what he'd used. Today he had bought a new keyboard, however, and started linux for the first time in about 4 months. Of course, there were updates, and so he started installing them. Guess what happened in the middle of replacing his old packages? A blown fuse. Fuse replaced, he now found he couldn't start gnome anymore, as it crashed immediately after logging in. The terminals still worked, but as he had no console-browser we couldn't reach the online fix linux documentation, and the package manager was seemingly beyond repair so we couldn't install anything either.

The fix was easy though. Since he'd barely used his linux, it was either a quick reinstall from the interweb, or hours spent trying to fix it using a suboptimal documentation pipeline. I also introduced him to KDE, so it was a win overall.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Horror Stories

Postby You, sir, name? » Mon Jan 12, 2009 10:30 pm UTC

mij wrote:When I was new to linux, I was trying to install a caml compiler. I found some instructions on a forum and started to copy-paste everything mechanically. One of the steps was something like "sudo rm -r /usr/local/lib/caml/" but I accidentally
copied only "sudo rm -r /". I didn't realized what was going like for two or three seconds, when I directly pulled the plug.

Surprisingly enough the system worked for several months after that incident without any problem.


When I was new, I had littered / with junk files, so I wanted to run "rm -rf foo*", but I wrote "rm -rf foo *"

Oh yes.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Marz
Posts: 156
Joined: Mon Dec 10, 2007 9:13 pm UTC
Location: UK
Contact:

Re: Horror Stories

Postby Marz » Mon Jan 12, 2009 11:17 pm UTC

hotaru wrote:
wst wrote:(I didn't know how to save with VIM and typing Vim --help didn't.)

i blame gnu for that. if it weren't for all their --help and gnu info idiocy, you'd have known that looking at the man page is the first thing you should do when you don't know how to use a program.

Ugh, yes. Besides, a man page used to take a minute to read. Now tar has more than 90 possible arguments. Wtf. Thanks, GNU, for the bloated confusion. Original Unix was beautiful - cat had 0 arguments; that's how it should be: cat -v considered harmful.


I haven't had any real horror stories myself - I've done stupid things, but they haven't really been to distastrous. Besides, I haven't installed sudo, on the basis that there's only me on my system, and it should ask whether I actually want to do something as root, so I think about what I'm doing it before I do it. Thus I use su -c (it asks for the root password every time).

User avatar
Seanbot
Posts: 11
Joined: Sat Jul 12, 2008 10:12 am UTC
Location: Australia

Re: Horror Stories

Postby Seanbot » Mon Jan 12, 2009 11:35 pm UTC

I have an Ubuntu server down in my study, which quietly chugs away, acting as a file server for the network, but the CD drive will only open with either persistence, or a paper-clip shoved into the manual open.
So I cannibalised an old computer to get a faster drive that opened properly, and installed it. Then I tried to install VLC off the Dapper disk. It turned out that the disk drive didn't actually work, so I was stuck in a loop of attempted file retrieval, then a fail. Eventually I had to turn it off, and try and take the drive out, which it did not want to do, managing to break the IDE cable I was using.
So eventually, with the old one back in, and the computer still off, I turned it on for a long sort of fixing process, which ended with basically a re-install of a couple of programs, but the files where still intact.
A little later the Power Supply conked out as well.

User avatar
Xanthir
My HERO!!!
Posts: 5413
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Horror Stories

Postby Xanthir » Tue Jan 13, 2009 12:06 am UTC

My worst case, working with Ubuntu.

I was having some strange difficulties with a USB drive. I dont' recall exactly what was wrong, but I wasn't able to view files on it. I looked around on forums for a bit, and ended up running some code that, to the best of my knowledge, unmounted all drives and prevented them from being mounted ever again.

I had to wipe the computer to get my USB working again.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
Cosmologicon
Posts: 1806
Joined: Sat Nov 25, 2006 9:47 am UTC
Location: Cambridge MA USA
Contact:

Re: Horror Stories

Postby Cosmologicon » Tue Jan 13, 2009 12:11 am UTC

Marz wrote:Ugh, yes. Besides, a man page used to take a minute to read. Now tar has more than 90 possible arguments. Wtf. Thanks, GNU, for the bloated confusion. Original Unix was beautiful - cat had 0 arguments; that's how it should be: cat -v considered harmful.

Okay, I can't tell, is that website a joke or not? It has an obviously false interview with Stroustrup claiming he made C++ as a joke that nobody got. It also says that Firefox is a far inferior web browser to gopher, and "Children are nothing more than a toy some parents use to feed their ego and feel important. They are a nuisance and make life miserable for everyone else around."

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Horror Stories

Postby b.i.o » Tue Jan 13, 2009 12:20 am UTC

Doing a Gentoo install.

Creating hard drive partitions and formatting them.

I type mkfs.jfs /dev/sda4 and hit 'enter'.
I realize that I had meant /dev/sda5.
I realize that /dev/sda4 is my working Ubuntu install with lots of files that haven't been backed up because I forgot to bring my external hard drive's power cable home with me.

User avatar
hotaru
Posts: 1045
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Horror Stories

Postby hotaru » Tue Jan 13, 2009 12:50 am UTC

  • Cosmologicon wrote:Okay, I can't tell, is that website a joke or not?

    no, it's not a joke.
  • Cosmologicon wrote:It has an obviously false interview with Stroustrup claiming he made C++ as a joke that nobody got.

    everyone knows that's not a real interview. it does contain a lot of truth, tho:
    Remember the length of the average-sized 'C' project? About 6 months. Not nearly long enough for a guy with a wife and kids to earn enough to have a decent standard of living. Take the same project, design it in C++ and what do you get? I'll tell you. One to two years.

    The universities haven't been teaching 'C' for such a long time, there's now a shortage of decent 'C' programmers. Especially those who know anything about Unix systems programming. How many guys would know what to do with 'malloc', when they've used 'new' all these years - and never bothered to check the return code. In fact, most C++ programmers throw away their return codes.

    Keeping track of all the gotchas I put into C++ is no easy job. And, as I said before, every C++ programmer feels bound by some mystic promise to use every damn element of the language on every project.
  • Cosmologicon wrote:It also says that Firefox is a far inferior web browser to gopher,

    where does it say that gopher is a web browser?
Last edited by hotaru on Sat May 26, 2012 5:13 am UTC, edited 1 time in total.

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

User avatar
Cosmologicon
Posts: 1806
Joined: Sat Nov 25, 2006 9:47 am UTC
Location: Cambridge MA USA
Contact:

Re: Horror Stories

Postby Cosmologicon » Tue Jan 13, 2009 1:13 am UTC

I don't need to argue about whether it's correct (or "contains truth", whatever that means), I was just pointing out some pretty ridiculous statements that made me think it might be a joke. The fact that it's not is... interesting. Thank you.

Sorry about my unclear wording re: gopher. It says that Firefox is a bad web browser, and gopher is a superior alternative. Better?

sam5550
Posts: 16
Joined: Sun Nov 23, 2008 8:54 pm UTC

Re: Horror Stories

Postby sam5550 » Tue Jan 13, 2009 1:46 am UTC

While working on my laptop, I noticed that something didn't seem right with the power supply brick. As a watched, increasing amounts of smoke began to pour out of it. By the time I unplugged it, there was at least as much smoke coming out as if I had lit a match. The scary part was, it still seemed to power the laptop perfectly fine... :shock:

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Horror Stories

Postby Rysto » Tue Jan 13, 2009 10:14 pm UTC

Things you don't want to see on the console immediately before power was lost:

Failed to write to BIOS flash
WARNING: YOUR BIOS IS HOSED
RESTORE IT IMMEDIATELY FROM THE BACKUP FILE!

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Horror Stories

Postby Berengal » Wed Jan 14, 2009 4:00 am UTC

Rysto wrote:Things you don't want to see on the console immediately before power was lost:

Failed to write to BIOS flash
WARNING: YOUR BIOS IS HOSED
RESTORE IT IMMEDIATELY FROM THE BACKUP FILE!

I actually fixed a BIOS killed in similar circumstances once. It was pretty scary until I got to the point where I had a running computer with the hosed BIOS.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
quintopia
Posts: 2906
Joined: Fri Nov 17, 2006 2:53 am UTC
Location: atlanta, ga

Re: Horror Stories

Postby quintopia » Wed Jan 14, 2009 4:32 am UTC

mij wrote:"sudo chmod -r 777 *" in root changes the permissions of every file of the computer so that every user can read, write or execute everything.

"sudo rm -r /" deletes every file in the system.


Actually, that would be a very annoying way to delete every file in the system. For more efficiency:

"sudo rm -rf /"

User avatar
'; DROP DATABASE;--
Posts: 3284
Joined: Thu Nov 22, 2007 9:38 am UTC
Location: Midwest Alberta, where it's STILL snowy
Contact:

Re: Horror Stories

Postby '; DROP DATABASE;-- » Wed Jan 14, 2009 6:47 am UTC

I don't remember exactly how it went, but something like this:
  • mkfs.ext3 /dev/hda5
  • A few more commands
  • Look at my partition list again to see which partition another command should be modifying
  • Realize that hda5 is the one with all my stuff on it
Surprisingly, most of the files survived. The filesystem was toast, but it was NTFS, which keeps a backup, so that wasn't a problem.
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

User avatar
OOPMan
Posts: 314
Joined: Mon Oct 15, 2007 10:20 am UTC
Location: Cape Town, South Africa

Re: Horror Stories

Postby OOPMan » Wed Jan 14, 2009 6:59 am UTC

GrimReaper wrote:I have recently been reforming an old barely-working Windows laptop into an excellent Ubuntu computer.
I had basically just finished twerking it when I decided I was sick of all of those "permission denied" dialogs.

So, I decided to run "sudo chmod -r 777 *" in root.
BAD DECISION. To put it simply, I BROKE EVERYTHING.

So there's my example, what are some of your horror stories that you have brought upon yourself in any OS?

Edit: In case anyone is wondering, this is my first true experience in Linux, it's not like I've been using it for years and then screwed up this ridiculously. And yes, I did learn from my experience :wink:
Update: It's reinstalled and alive! Hurray....


Yeah, that's a pretty big screwup I'd say. Still, you live and learn...

When I first installed Linux it was Redhat 3.0.3 (Picasso release) and over the course of that weekend I re-installed about 30 times :-)

Back in those days just about every misstep resulted in an unbootable system.

Tinkered with rc.local? FAIL!

Tinkered with xf86config (Which still existed back then...)? FAIL!

And so forth...

Still, it was a lot of fun :-)

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Horror Stories

Postby headprogrammingczar » Wed Jan 14, 2009 2:55 pm UTC

VM Fedora is still like that (I use 8). Add Window Effects? FAIL! Change logon behavior? FAIL! Do an update through the terminal? FAIL! On the bright side though, it has a feature where the virtual desktop disappears and the GNOME windows get rendered on my host desktop, which (along with clipboard sharing) makes for a nice C coding environment.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

fazzone
Posts: 186
Joined: Wed Dec 10, 2008 9:38 pm UTC
Location: A boat

Re: Horror Stories

Postby fazzone » Thu Jan 15, 2009 12:25 am UTC

One command: rm .* :twisted:
*/

User avatar
Marz
Posts: 156
Joined: Mon Dec 10, 2007 9:13 pm UTC
Location: UK
Contact:

Re: Horror Stories

Postby Marz » Thu Jan 15, 2009 4:40 pm UTC

fazzone wrote:One command: rm .* :twisted:

That ... really wouldn't do all that much. It would delete any hidden files; that is all. -r needed.

User avatar
psykx
Posts: 408
Joined: Sat Feb 23, 2008 11:24 pm UTC
Location: England
Contact:

Re: Horror Stories

Postby psykx » Thu Jan 15, 2009 5:16 pm UTC

as mentioned above that would be a very frustrating way of deleting all your files. This wasn't me but this link is the best recovery story ever, from a rm -rf ./*

http://www.ee.ryerson.ca/~elf/hack/recovery.html
Berengal wrote:Only if they're killer robots. Legos are happy robots. Besides, even if they were killer robots it wouldn't stop me. You can't stop science and all that.

User avatar
scarecrovv
It's pronounced 'double u'
Posts: 674
Joined: Wed Jul 30, 2008 4:09 pm UTC
Location: California

Re: Horror Stories

Postby scarecrovv » Thu Jan 15, 2009 6:50 pm UTC

Well, when I was little (up until 6th grade) and still a windows user, I thought that the only thing needed to change a file from one type to another was to change the file extension. After all, windows would then treat the file as being of the new type, and most tools were smart enough not to believe the file extension anyway. Though I haven't touched those files in years, I've still got dozens of files kicking around for old times sake with completely meaningless file extensions, and without opening up binaries in a text editor, it's really impossible to say what most of my files from before 2001 (or so) actually are.

Nothing terminally stupid though.

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Horror Stories

Postby Rysto » Thu Jan 15, 2009 7:20 pm UTC

I can't remember where I saw this(I could have sworn it was in foldoc or the Jargon File, but I can find it in either). Anyway, somebody once wrote a shell whose globbing routing tried to correct for typos. That resulted in the following:

$ rm -f ~/*.bak
~/*.bak not found; assuming you meant ~/*

fazzone
Posts: 186
Joined: Wed Dec 10, 2008 9:38 pm UTC
Location: A boat

Re: Horror Stories

Postby fazzone » Thu Jan 15, 2009 7:43 pm UTC

the reason "rm .*" is so evil is because .. matches .* Therefore, the rm command goes up the file hierarchy and deletes all the files in that tier until it gets all the way back to /
*/

User avatar
tetsujin
Posts: 426
Joined: Thu Nov 15, 2007 8:34 pm UTC
Location: Massachusetts
Contact:

Re: Horror Stories

Postby tetsujin » Thu Jan 15, 2009 8:02 pm UTC

scarecrovv wrote:Well, when I was little (up until 6th grade) and still a windows user, I thought that the only thing needed to change a file from one type to another was to change the file extension. After all, windows would then treat the file as being of the new type, and most tools were smart enough not to believe the file extension anyway. Though I haven't touched those files in years, I've still got dozens of files kicking around for old times sake with completely meaningless file extensions, and without opening up binaries in a text editor, it's really impossible to say what most of my files from before 2001 (or so) actually are.


On Unix there's a nice utility called "file" that will attempt to guess a file's type based on its contents. It's not always right because of the very limited amount of analysis done and the fact that not all file types have sufficiently strong type signatures - but if you ever get interested in repairing that damage, MINGW or Cygwin, plus a bit of time learning shell programming, might yield a good payoff. Failing that, someone's probably implemented the equivalent as a Windows GUI app. :)
---GEC
I want to create a truly new command-line shell for Unix.
Anybody want to place bets on whether I ever get any code written?

User avatar
scarecrovv
It's pronounced 'double u'
Posts: 674
Joined: Wed Jul 30, 2008 4:09 pm UTC
Location: California

Re: Horror Stories

Postby scarecrovv » Thu Jan 15, 2009 9:32 pm UTC

tetsujin wrote:
scarecrovv wrote:Well, when I was little (up until 6th grade) and still a windows user, I thought that the only thing needed to change a file from one type to another was to change the file extension. After all, windows would then treat the file as being of the new type, and most tools were smart enough not to believe the file extension anyway. Though I haven't touched those files in years, I've still got dozens of files kicking around for old times sake with completely meaningless file extensions, and without opening up binaries in a text editor, it's really impossible to say what most of my files from before 2001 (or so) actually are.


On Unix there's a nice utility called "file" that will attempt to guess a file's type based on its contents. It's not always right because of the very limited amount of analysis done and the fact that not all file types have sufficiently strong type signatures - but if you ever get interested in repairing that damage, MINGW or Cygwin, plus a bit of time learning shell programming, might yield a good payoff. Failing that, someone's probably implemented the equivalent as a Windows GUI app. :)


Well nowadays I'm a Fedora user, so MinGW and Cygwin wouldn't be needed. I'll investigate "file" though, and if I'm feeling motivated, write a little Perl to correct the issue. Thanks for the tip.

User avatar
Marz
Posts: 156
Joined: Mon Dec 10, 2007 9:13 pm UTC
Location: UK
Contact:

Re: Horror Stories

Postby Marz » Thu Jan 15, 2009 9:48 pm UTC

fazzone wrote:the reason "rm .*" is so evil is because .. matches .* Therefore, the rm command goes up the file hierarchy and deletes all the files in that tier until it gets all the way back to /

Indeed, ".." matches ".*". However, it does not go up the file hierarchy - it is not recursive without -r, so it simply attempts to delete:
  • All hidden files in the current directory.
  • The current directory, ".".
  • The parent directory, "..".
However, as you are in the current directory (plus you can't delete directories with rm unless you -r), it is met with the response:

Code: Select all

rm: cannot remove directory `.'
rm: cannot remove directory `..'
Try it, if you want (I'm not trying to get you to delete all your files, either).

User avatar
phlip
Restorer of Worlds
Posts: 7572
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Horror Stories

Postby phlip » Thu Jan 15, 2009 10:43 pm UTC

I once spent a couple of days doing some tedious graphic stuff... taking a bunch of GIF files, giving them nice 8-bit alpha channels, saving them as PNG. Finally finished, time to clean up, and delete all the originals from the work dir. rm *.png. Wait... crap.

And that's the story of when I learned that there's no way to undelete in ext3.

I've also done the "rm * ~" thing once, but luckily I happened to have a recent backup of that one...

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
Xanthir
My HERO!!!
Posts: 5413
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Horror Stories

Postby Xanthir » Thu Jan 15, 2009 11:17 pm UTC

phlip wrote:I once spent a couple of days doing some tedious graphic stuff... taking a bunch of GIF files, giving them nice 8-bit alpha channels, saving them as PNG. Finally finished, time to clean up, and delete all the originals from the work dir. rm *.png. Wait... crap.

And that's the story of when I learned that there's no way to undelete in ext3.

I've also done the "rm * ~" thing once, but luckily I happened to have a recent backup of that one...

I've never had a bad experience with rm, but I've heard enough stories that I still treat it like a loaded gun.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
niteice
Posts: 186
Joined: Wed May 02, 2007 4:17 am UTC
Contact:

Re: Horror Stories

Postby niteice » Fri Jan 16, 2009 12:29 am UTC

phlip wrote:And that's the story of when I learned that there's no way to undelete in ext3.


You can use debugfs.
GENERATION 4294967292: The first time you see this, copy it into your sig on any forum, negate the generation, and convert it to a 32-bit unsigned integer. Social experiment.

User avatar
phlip
Restorer of Worlds
Posts: 7572
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Horror Stories

Postby phlip » Fri Jan 16, 2009 1:24 am UTC

niteice wrote:You can use debugfs.

With ext2, yes. ext3, not so much. Something about the journalling and deletes ends up destroying some information that undelete utils need, or something.
Spoiler:

Code: Select all

phlip@boris:~/tst$ touch e2test
phlip@boris:~/tst$ mke2fs e2test 1024
mke2fs 1.41.3 (12-Oct-2008)
e2test is not a block special device.
Proceed anyway? (y,n) y
mke2fs: Filesystem larger than apparent device size.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
Maximum filesystem blocks=1048576
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Writing inode tables: done                           
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
phlip@boris:~/tst$ mkdir mnt
phlip@boris:~/tst$ sudo mount e2test mnt -o loop
phlip@boris:~/tst$ echo Test ext2 undelete > mnt/a_file
phlip@boris:~/tst$ rm mnt/a_file
phlip@boris:~/tst$ sudo umount mnt
phlip@boris:~/tst$ touch e3test
phlip@boris:~/tst$ mke2fs -j e3test 2048
mke2fs 1.41.3 (12-Oct-2008)
e3test is not a block special device.
Proceed anyway? (y,n) y
mke2fs: Filesystem larger than apparent device size.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
256 inodes, 2048 blocks
102 blocks (4.98%) reserved for the super user
First data block=1
Maximum filesystem blocks=2097152
1 block group
8192 blocks per group, 8192 fragments per group
256 inodes per group

Writing inode tables: done                           
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
phlip@boris:~/tst$ sudo mount e3test mnt -o loop
phlip@boris:~/tst$ echo Test ext3 undelete > mnt/a_file
phlip@boris:~/tst$ rm mnt/a_file
phlip@boris:~/tst$ sudo umount mnt
debugfs:  phlip@boris:~/tst$ debugfs e2test
debugfs 1.41.3 (12-Oct-2008)
debugfs:  lsdel
 Inode  Owner  Mode    Size      Blocks   Time deleted
    12   1000 100644     19      1/     1 Fri Jan 16 12:18:10 2009
1 deleted inodes found.
debugfs:  quit
phlip@boris:~/tst$ debugfs e3test
debugfs 1.41.3 (12-Oct-2008)
debugfs:  lsdel
 Inode  Owner  Mode    Size      Blocks   Time deleted
0 deleted inodes found.
debugfs:  quit

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 5 guests