You worst moment on a Unix system - Psychology, Philosophy, and Licenses

Users browsing this thread: 7 Guest(s)
venam
Administrators
(This is part of the podcast discussion extension)

You worst moment on a Unix system

Everyone's bad moment was about data loss. Some mis-used cp/mv and overwrote their precious music libs, some badly used dd, some repartitioned incorrectly and got corrupted filesystems.

http://unixhorrorstories.blogspot.com/20...about.html
Wildefyr
Long time nixers
I've managed to remove my music directory several times while organising it, thankfully I keep backups.

Also for some reason, I'm having terrible luck with crux's init system. 3 times it refuses to boot the system after the kernel has been loaded and I can't find any error messages anywhere! I've just ended up reinstalling the root partition several times now...
jkl
Long time nixers
Not really a Unix system, but related: When I still had a Debian server, I managed to mix up "cp" and "rm" while doing routine maintenance work because I was already thinking of the action after the copying. Of course, no backups were made.

The next step was to write a shell script to automate this maintenance.

--
<mort> choosing a terrible license just to be spiteful towards others is possibly the most tux0r thing I've ever seen
cjm
Long time nixers
sudo rm -rf /...........
z3bra
Grey Hair Nixers
(23-05-2016, 11:26 AM)cjm Wrote: sudo rm -rf /...........

Doesn't it require "--no-preserve-root" now?
rocx
Members
My laptop (barely) booted up once with a "bad superblock". It wouldn't let me `fsck` it so the only thing I knew left to do is reinstall the OS.
xero
Long time nixers
i learned early about using paths on your arguments.

i now almost never use:
Code:
rm -rf something

as opposed to:
Code:
rm -rf /legit/path/to/something
rm -rf ./something
Loki123
Members
When I thought I was cool and tried using Ubuntu's default encryption for my home directory.
Needless to say, I failed, miserably and lost about 200GB worth of music and photos. 6 years later, I still don't trust encryption perfectly to be safe to use.
Dworin
Members
(23-05-2016, 12:32 PM)rocx Wrote: My laptop (barely) booted up once with a "bad superblock". It wouldn't let me `fsck` it so the only thing I knew left to do is reinstall the OS.

But you had your /home on a separate partition, I hope? That has certainly saved me before (I'm terrible at back-up discipline).
z3bra
Grey Hair Nixers
I recently had one of my server diying. I found the issue while trying to backup a directory, when rsync refused to read some files. Turned out to be the hard drive.
Hopefully, I had most of my services/data moved onto another serv a few days before. The worst part for me was that the server was used by other people, so the service was down for a few days.
stratex
Nixers
1) Lost about 20000 Tux coins, by thinking that I backed up the private key while in reality I did not. (I have ~80 different coins) which leads to confusion and management issues sometimes. Tux is worthless as of now, so no biggy.
2) Almost lost my entire password database, thanks god I could find a very old copy somewhere, I don't recall how exactly it happened, probably it was so traumatic that my psyche now blocks the memory access to these addresses.
3) Couple times deleted something with wrong glob expansion, but nothing which couldn't be restored/downloaded again within 1 hour, if I recall corectly I did rm .* instead of ./*
I now have a very ellaborate and unorthodox encryption setup, and I also living on the edge with couple of very old hard drives, I can't decommission them because I'm quite poor. To be continued...
seninha
Long time nixers
I was done with the compilation and was going to remove the *.o object files.
A `rm *.o` would do the job.
In my keyboard layout, the * character needs a shift, and the > character is the shifted period . (see image)
I kept the shift pressed from the asterisk * when I was going to press the period .
Thus, I typed `rm *>o`
This removes everything and sends the output of rm to a file named o
My rm is an alias to 'rm -r'.
I ran this at $HOME.
[Image: scrot-2020-11-12-160321.png]
pkal
Long time nixers
I think it's pretty obviously when I dd'd an ISO over my old Window partition, and lost my bookmark collection I had started when I was 4 years old.
movq
Long time nixers
It’s always data loss, isn’t it? Probably because it’s so painful. I only lost a couple of screenshots once, because I ran `rm *` in `$HOME`. No `-r`, though, so it only picked up those few stray JPGs.

One of the worst moments in the recent past (a few years ago, I think) was probably running `iptables -nvL | less` on all of our client-facing OpenVPN servers at the same time (something like clusterssh).

That command looks totally harmless. What I didn’t know was that `iptables` grabs a file lock (`/run/xtables.lock`), queries rules from the kernel, prints them, and then releases that lock. In that order. If you have a lot of rules, then writing this output to the pipe will eventually block because the pipe buffer is full. Meaning, the lock is still being held, basically until `less` has read until EOF from the pipe.

Now, when a new clients connects, we had OpenVPN create a new set of iptables rules for this client. And this is where the disaster happened: OpenVPN accepts the connection, then runs `iptables -w -A …`, and then waits for this to finish.

In other words, me running `iptables -nvL | less` grabbed the file lock and the next client that connected tried to grab that lock as well, but it blocked due to `-w` and thus it blocked the entire OpenVPN process. Boom, no more traffic for a couple of hundred VPN clients. Including myself.

(We have since introduced a wrapper script `iptables-show` which basically does `iptables -nvL >foo && less foo`.)

(13-11-2020, 03:24 PM)zge Wrote: lost my bookmark collection I had started when I was 4 years old.
Was that a figure of speech or did you really start this young?
pkal
Long time nixers
(13-11-2020, 05:31 PM)vain Wrote: Was that a figure of speech or did you really start this young?

No, I started browsing the web somewhere between 2001 and 2003, and I distinctly remember gathering bookmarks firt using IE, importing them into Firefox, later into Chrome and then back into Firefox when I switched to Linux (2013). Most of the links would probably be broken now, but it was a considerable collection, because I obviously didn't use any social media sites back then, but just browsed the world wild web.
s0kx
Members
Earlier today I managed to accidentally create a file name * in a directory with other files. I almost ran
Code:
rm *
in said directory, only to stop at the very last second. Phew, that was a close call ;)
venam
Administrators
(24-11-2020, 12:21 PM)s0kx Wrote: Earlier today I managed to accidentally create a file name * in a directory with other files. I almost ran

If you want to talk about almost worst moment, a similar story keeps happening to me.

I usually take a lot of screenshots in my home directory using scrot, so the screenshots all start with the current date and then the time and resolution.
So normally what I do to remove them all is that I type:
PHP Code:
rm 2020-<tab>* 

Well, sometimes I type that and there's a single file in the directory that starts with "2020-", so the shell add a space after the name and I'm left with:
PHP Code:
rm 2020-11-24-173440_1366x768_scrot.png 

Fortunately, I've never executed it... so far at least.
freem
Nixers
hum... you should change your shell, venam. An acceptable auto-completion should here put a backslash before the space, minimum. Just tried, and it seems neither bash nor zsh have such problem here. What's your shell?
venam
Administrators
(24-11-2020, 01:43 PM)freem Wrote: neither bash nor zsh have such problem here. What's your shell?

I'm using zsh, maybe you misunderstood what I was doing. I'm typing the start of the filename, and I was expecting it to stop at what's common between them.

Let's say I have these:
  • 2020-11-24-185510_219x157_scrot.png
  • 2020-11-24-185513_218x191_scrot.png
  • 2020-11-24-185516_169x153_scrot.png

When I type rm 2020<tab>, it autocompletes to rm 2020-11-24-18551 then i type rm 2020-11-24-18551*.
But in the case when there's a single file it does rm 2020-11-24-185510_219x157_scrot.png * because it completes the whole name and adds a space afterwards. I'm so used to typing it that it has become ingrained.
freem
Nixers
Indeed, I didn't understood it like that.
jkl
Long time nixers
Still sounds like it shouldn’t do that.

--
<mort> choosing a terrible license just to be spiteful towards others is possibly the most tux0r thing I've ever seen
Dworin
Members
(24-11-2020, 12:36 PM)venam Wrote:
(24-11-2020, 12:21 PM)s0kx Wrote: Earlier today I managed to accidentally create a file name * in a directory with other files. I almost ran

If you want to talk about almost worst moment, a similar story keeps happening to me.

I usually take a lot of screenshots in my home directory using scrot, so the screenshots all start with the current date and then the time and resolution.
So normally what I do to remove them all is that I type:
PHP Code:
rm 2020-<tab>* 

Well, sometimes I type that and there's a single file in the directory that starts with "2020-", so the shell add a space after the name and I'm left with:
PHP Code:
rm 2020-11-24-173440_1366x768_scrot.png 

Fortunately, I've never executed it... so far at least.

My screenshots go to /tmp so I can let the regular cleanup deal with it.
If the shell were to place a \<space> after the filename, it wouldn't match anymore (because of the space). Another alternative might be to just type 2020*, without <tab>-expansion.
pfr
Nixers
When I borked my Arch install back in 2013/14 (I can hardly remember). I was so pissed off I completely destroyed my laptop. It was an old HP Pavilion (however it has nvidia graphics). I regretted it later. I could still be using that old laptop today if id just stopped and taken a breath.

I cant remember exactly what happened, but I think I went away on holiday for about 4 weeks and came back and did the old "pacman -Syu" and well... needless to say it broke and I was unable to recover. I did spend a day or two trying to recover it, but it seemed hopeless.

It wasn't the data loss I cared about, it was my configs. I was young(er) then, and foolish to not have backups. I didn't even git back then. My system was heavily customised and I wasn't experienced enough to be able to reinstall and get it back to where it was to I ceremoniously destroyed the entire laptop. I know it was wrong, but it felt good.

EDIT: I literally took to it with a hammer and a screw driver. Hammering holes through the entire thing.
_____________________________________________________________________________________________
“Maybe you have some bird ideas... Maybe that's the best you can do.” - Terry A. Davis (R.I.P Terry & Percival)