this post was submitted on 22 Jan 2024
201 points (100.0% liked)

Linux

1259 readers
70 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Tinkering is all fun and games, until it's 4 am, your vision is blurry, and thinking straight becomes a non-option, or perhaps you just get overly confident, type something and press enter before considering the consequences of the command you're about to execute... And then all you have is a kernel panic and one thought bouncing in your head: "damn, what did I expect to happen?".

Off the top of my head I remember 2 of those. Both happened a while ago, so I don't remember all the details, unfortunately.

For the warmup, removing PAM. I was trying to convert my artix install to a regular arch without reinstalling everything. Should be kinda simple: change repos, install systemd, uninstall dinit and it's units, profit. Yet after doing just that I was left with some PAM errors... So, I Rdd-ed libpam instead of just using --overwrite. Needless to say, I had to search for live usb yet again.

And the one at least I find quite funny. After about a year of using arch I was considering myself a confident enough user, and it so happened that I wanted to install smth that was packaged for debian. A reasonable person would, perhaps, write a pkgbuild that would unpack the .deb and install it's contents properly along with all the necessary dependencies. But not me, I installed dpkg. The package refused to either work or install complaining that the version of glibc was incorrect... So, I installed glibc from Debian's repos. After a few seconds my poor PC probably spent staring in disbelief at the sheer stupidity of the meatbag behind the keyboard, I was met with a reboot, a kernel panic, and a need to find another PC to flash an archiso to a flash drive ('cause ofc I didn't have one at the time).

Anyways, what are your stories?

top 50 comments
sorted by: hot top controversial new old
[–] technohacker@programming.dev 105 points 10 months ago (7 children)
[–] caseyweederman@lemmy.ca 39 points 10 months ago
[–] fl42v@lemmy.ml 31 points 10 months ago (1 children)

That's the scariest horror story in 2 words I've seen so far

[–] technohacker@programming.dev 10 points 10 months ago (1 children)

I'm genuinely having a chuckle at how shocked people are at my submission, made my day xD

[–] fl42v@lemmy.ml 8 points 10 months ago (1 children)

I mean, it's simple, elegant, and destructive AF given the right circumstances. Basically a chaos grenade we didn't realize existed

load more comments (1 replies)
load more comments (5 replies)
[–] krimson@feddit.nl 45 points 10 months ago* (last edited 10 months ago)

Many many years ago I wanted to clean up my freshly installed Slackware system by removing old files.

find / -mtime +30 -exec rm -f {};

Bad idea.

[–] avidamoeba@lemmy.ca 35 points 10 months ago (1 children)

Tried to convert Ubuntu to Debian by replacing the repos in sources.list and apt dist-upgrading. 💣 Teenagers...

load more comments (1 replies)
[–] evatronic@lemm.ee 26 points 10 months ago* (last edited 10 months ago) (4 children)

sudo rm -f /lib /usr/share/backup/blah blah.tar.gz

Note the space.

[–] downhomechunk@midwest.social 30 points 10 months ago (2 children)

Oh man, you really owned those libs

[–] liara@lemm.ee 11 points 10 months ago

You need to use chown if you want to own the libs

load more comments (1 replies)
load more comments (3 replies)
[–] raoul@lemmy.sdf.org 24 points 10 months ago* (last edited 10 months ago) (2 children)

First, the classical typo in a bash script:

set FOLDER=/some/folder

rm -rf ${FODLER}/

which is why I like to add a set -u at the begining of a script.

The second one is not with a Linux box but a mainframe running AIX:

If on Linux killall java kills all java processes, on AIX it just ignore the arguments and kill all processes that the user can kill. Adios the CICS region 😬 (on the test env. thankfully)

[–] NaibofTabr@infosec.pub 16 points 10 months ago (2 children)

If on Linux killall java kills all java processes, on AIX it just ignore the arguments and kill all processes that the user can kill.

jfc, is ignoring arguments the intended behavior?

[–] aard@kyu.de 17 points 10 months ago (1 children)

On a real UNIX (not only AiX) killall is part of the shutdown process - it gets called by init at that stage when you want to kill everything left before reboot/shutdown.

Linux is pretty unique in using that for something else.

[–] raoul@lemmy.sdf.org 9 points 10 months ago (1 children)

I didn't know that, good to know.

They could have send a SIGTERM by default instead of a SIGKILL. I would not have corrupt everything 😅

[–] aard@kyu.de 11 points 10 months ago* (last edited 10 months ago)

killall typically sends SIGTERM by default. It accepts a single argument, the signal to send - so shutdown would call it once with SIGTERM, then with SIGKILL. killall is not meant to to be called interactively - which worked fine, until people who had their first contact with UNIX like systems on Linux started getting access to traditional UNIX systems.

It used to be common to discourage new Linux users from using killall interactively for exactly that reason. Just checked, there's even a warning about that in the killall manpage on Linux.

[–] raoul@lemmy.sdf.org 8 points 10 months ago* (last edited 10 months ago)

Yes: same command name, two different semantics:

AIX man page

The Linux one

Cross-Unix scripting is fun ☺️

[–] fl42v@lemmy.ml 11 points 10 months ago

Wow, the last one is quite unexpected. What a useful command

[–] BestBouclettes@jlai.lu 21 points 10 months ago (2 children)

CTRL-C-ing apt because it looked stuck for more than 10 minutes. I don't recommend doing it.

[–] Cwilliams 10 points 10 months ago (1 children)

Man, gotta love apt sometimes

load more comments (1 replies)
[–] maynarkh@feddit.nl 8 points 10 months ago (1 children)

Haven't used apt in a while, is it not atomic? What happens if you mess with it?

load more comments (1 replies)
[–] mozz@mbin.grits.dev 20 points 10 months ago (1 children)

I can't even remember how I did this, but overwriting the partition table on the main production server at our small startup (back when "the server" would usually live on the premises of the startup). I remember my boss starting to hyperventilate from panic while I reconstructed it from memory / notes, and all the filesystems came back and he calmed down.

Same job, they gave me a little embedded-systems unit for me to use to build a prototype on. I hooked it up, nothing worked. I brought it back to them.

Hey, this one doesn't work.

Huh... that's weird, it was working before. Did you break it?

I don't think so. Can I have one that works?

They literally told me, as they were handing me the second one: Okay, here's another one. Don't break it.

I figured it out literally seconds after breaking the second one... I was hooking it up to 12 volts of power when it needed 5. Second dead computer. Explaining that and that I needed a third one now was fun.

load more comments (1 replies)
[–] glibg10b@lemmy.ml 20 points 10 months ago* (last edited 10 months ago)

Before installing Arch on a USB flash drive, I disabled ext4 journaling in order to reduce disk reads and writes, being fully aware of the implications (file corruption after unexpected power loss). I was confident that I would never have to pull the plug or the drive without issuing a normal shutdown first. Unfortunately, there was one possibility I hadn't considered: sometimes, there's that one service preventing your PC from turning off, and at that stage there's no way to kill it (besides waiting for systemd to time out, but I was impatient).

So I pulled the plug. The system booted fine, but was missing some binaries. Unfortunately, I couldn't use pacman to restore them because some of the files it relied on were also destroyed.

This was not the last time I went through this. Luckily I've learned my lesson by now

[–] msmc101@lemmy.blahaj.zone 19 points 10 months ago (2 children)

First time trying Linux I went with an arch install because I Googled "best version of Linux" and went with arch. Followed a guide to the point of drive formatting and I decided to go with a setup with drive encryption. I didn't understand what I was doing, ended up locking myself out of my hard drives and couldn't get windows to reinstall on them. I used a MacBook for a week until I installed Ubuntu and managed to wipe and reset my drives and reinstalled. Needless to say I am going to read up a little more before I try that again.

[–] fl42v@lemmy.ml 10 points 10 months ago

Been there, and even without encryption: took me to reinstall a few times before I realized I can chroot again and repair 😅

load more comments (1 replies)
[–] KISSmyOS@feddit.de 16 points 10 months ago (2 children)

I don't know if that counts, but on a fresh default Debian Stable system, my cat walked across the keyboard and the DE crashed.
I could still switch to another TTY and reboot via command line.
After the reboot, I was greeted by a blinking cursor and nothing else. Had to reinstall.

[–] NaibofTabr@infosec.pub 15 points 10 months ago

keyboard cat strikes again

load more comments (1 replies)
[–] halfway_neko@lemmy.dbzer0.com 15 points 10 months ago* (last edited 10 months ago) (2 children)

Deleted my entire efi partition while trying to install some grub themes.

And then my backup didn't work when I tried to restore it.

I have pretty colours now though, so it was all worth it :)

load more comments (2 replies)
[–] janabuggs 14 points 10 months ago (1 children)

This was pre-linux for me but something you can still do in most distros so I think it's a valid story.

In 1999 I was using Napster on computer running MS-DOS. I was 12 years old and an aspiring open media enthusiast/stupid script kiddie. I was using the file explorer interface in Napster and accidentally gave access to my entire C drive. I also had opened ports to share certain media and to fuck with my friends using daemon tools (back then you could do stupid stuff like control a friend's desktop with certain versions of daemon tools). Immediately I started receiving packages called things like "sleep.tight.tiny.mite" and I knew I was fucked so I clicked in the Napster interface and clicked "delete" and deleted my entire active drive.

I panicked and installed the only operating system we had which was a random copy of Red Hat. When my dad came home I pretended like it had always had Linux on it. I do think he was more impressed than mad.

load more comments (1 replies)
[–] glibg10b@lemmy.ml 14 points 10 months ago

I wanted to use fio to benchmark my root drive. I had seen a tutorial saying that the file= parameter should point to the device file, so I pointed it at /dev/sda. As you might expect, the write test didn't go so well.

[–] Kjev@discuss.tchncs.de 13 points 10 months ago (3 children)

Somehow convinced a person to run sudo chmod -x /usr/bin/*

I don't remember the exact command so it could be a bit different but it did the job. It was a fun evening.

[–] rem26_art@kbin.social 14 points 10 months ago

The first time I read this, i thought "shouldn't all that be executable anyway?"

And then I read it again and realized, minus x

[–] avidamoeba@lemmy.ca 14 points 10 months ago* (last edited 10 months ago)

An intern nuked their workstation by sudo chmod -R 777 /. Turns out adding exec to everything isn't good either.

[–] fl42v@lemmy.ml 8 points 10 months ago* (last edited 10 months ago)

Daaem, I guess the poor dude at the receiving end did not consider it particularly fun. Well, at least they had sbin working, so probably possible to recover without a live cd. Huh, guess who's now spinning up a VM to check it out 🤣

Checked it out: on arch that results in inability to run tty on reboot, then you're dropped into initramfs's rescue shell where you can simply +x new_root's /usr/bin/* and be back up and running

[–] Kanedias@lemmy.ml 13 points 10 months ago (1 children)

Just straight up overwriting boot sector and superblock of my hard drive thinking it's the USB drive.

Udev tried to warn me, saying there's no permission, and I just typed sudo without thinking.

Then after a second I remembered USB block devices are usually writable by users, but it was too late.

load more comments (1 replies)
[–] carcus@lemmy.ml 12 points 10 months ago

Learned about the importance of trailing slashes in rsync by using the -delete flag.

[–] BlueEther@no.lastname.nz 12 points 10 months ago

I've broken systems far too many times in the last 24 years, since Mandrake 6.x, to count:

  • I've dd a disk or more
  • I've rm *
  • I've chmod
  • I've brought down the network, with every intention tar it would come back - on a remote box
  • I've failed to RTFM far too many times
[–] fl42v@lemmy.ml 11 points 10 months ago

Oh, I just remembered another one or three. So, resizing the partitions. My install at the time had a swap partition that I didn't need anymore. Should be simple, right? Remove the partition and the corresponding fstab entry, resize root, profit. Well, the superblock disagreed. Fortunately, I was lucky enough to be able to re-create the scheme as it was, and then take my time to read the wiki and do the procedure properly (e2fsck, resize2fs and all that stuff).

Some people I've met since, unfortunately, weren't so lucky (as far as I remember, both tried to shrink and were past mkfs already) and had to reinstall. The moral is, one does simply mess with superblocks; read the wiki first!

[–] reallyzen@lemmy.ml 11 points 10 months ago* (last edited 10 months ago)

Generated my grub configuration as grub.conf

This one took a stupid amount of time to debug - but on the other hand, when grub failed it did with "can't find any bootable thingy" and not "missing configuration file" as, in my later opinion, it should.

~~Life~~ Linux is a harsh mistresses, sometimes.

[–] ParsnipWitch@feddit.de 10 points 10 months ago* (last edited 10 months ago) (3 children)

Nooo I have so many.. This one I can explain in English:

Xubuntu but blind

So, this is ~2016. Ubuntu is hip and a handful of my students use it. On my PCs I only use Debian and Suse. So to help them better I take out an old ASUS laptop and install Ubuntu on it. Try out Xubuntu instead.

At that time I was also huge into alternative keyboard layouts. I had a slightly modified Neo keyboard layout installed when I switched to Xubuntu.

Here the fun starts because the obscure internal graphics card built into the laptop didn't have driver support under Xubuntu. Black screen but I could hear it working. This was the hardest driver fix I ever did. No monitor and a keyboard layout I wasn't used to, under a Linux distro I wasn't used to. And I also was at the university library, so no hardware support or Debian stick in reach.

load more comments (3 replies)
[–] FQQD@lemmy.ohaa.xyz 9 points 10 months ago

I copied a program into the /bin/ folder while in a file browser with sudo permissions and somehow overwrote every file except the one I was moving. It, of course, couldn't boot, but copying the bins from a live iso made it at least boot able. Reinstalled Linux after that, of course.

[–] Engywuck@lemm.ee 9 points 10 months ago

"Updating" a 5.2 RedHat install with a 6.0 Mandrake CD-ROM (or the opposite, can't remember right now...). Fun stuff.

[–] HuntressHimbo@lemm.ee 9 points 10 months ago

So I am sort of an embedded developer, and I like to mess around with weird configurations. So the craziest experiment I did was trying to reflash a rasberry pi from a system running in the pi's RAM. It honestly might have worked, but during the prep work I forgot to resize the filesystem before mucking with the paritions and had to reflash the normal way before I could try again. Ended up just turning it into a pihole instead, but I still learned a lot about pivot_root

[–] papertowels@lemmy.one 9 points 10 months ago

Not strictly Linux related, but in college I was an IT assistant. One day I was given a stack of drives to run through dariks boot and nuke.

I don't remember exactly what happened, but I think midway through, my laptop shut off.

Guess who picked the wrong drive to wipe with DBAN :)

[–] Cwilliams 9 points 10 months ago* (last edited 10 months ago)

At one point I had the coolest Ventoy USB; CyberRe, LABEL=hakr. But then I got a new computer and apparently the ssd was /dev/nvme0n1 instead of /dev/sda. While I was installing Arch, When I created a new GPT partition on /dev/sda, it wiped my beautiful Ventoy 😢

[–] exocortex@discuss.tchncs.de 9 points 10 months ago

Oh, i have a brilliant one:

A few years ago i spent a lot of time converting .flac-files into .ogg-files in order to put on my oldschool iPod. As I did a lot of repetitive typing - entering $dir / for file in flac ; do convert etc / mkdir -p $somewhere/$artist/$album / mv $somewhere/.ogg->$new_dir/ and so on - I thought: "hm lets just write a loop over loops for all the artists here and then all the albums and at the same time create the nested directories somewhere else... hm actually in the home directory.... and later love everything on the iPod at once."

so i was in my music folder with the artists-folders i wanted to convert. i did something wrong

So i did my complicated script directly in the shell. I made something wrong and instead of creating a folder "~/artist/album" I created 3 folders in my current working directory: "~", "artist" and "album". hmph dammit gotta try again... but first : i have to clean up these useless folders in the current dir. so i type of course this: "$ rm -r ~ artist album " after about 5 seconds of wondering why it took so long i realized my error. o_O I stopped the running command, but it was (of course) too late and i bricked my current installation. All the half-deleted config files made or impossible to start normally and extremely tedious to repair it by hand, so i reinstalled.

[–] qwesx@kbin.social 9 points 10 months ago

dpkg-reconfigure sysvinit

I don't remember what I was trying to achieve, but it was a bad idea. I also didn't (and still don't) know how to fix the outcome of this, so - since my home was on a separate partition anyway - I just reinstalled Debian since that was much quicker anyway.

[–] HotChickenFeet@sopuli.xyz 9 points 10 months ago* (last edited 10 months ago) (3 children)

Installed python3 before it was made the native python on the dist. Half broke everything, including apt & python. So I uninstalled it, and then everything was broken. Finally got python3 reinstalled, and lived with it kindof working & awful distribution updates.

I have finally freed myself of that prison last month, by nuking everything and starting fresh.

load more comments (3 replies)
[–] Jean_le_Flambeur@discuss.tchncs.de 8 points 10 months ago* (last edited 10 months ago)

Types

rm -r -f Presses strg+v (instead of strg + shift + v)

Hits enter

Maschine proceeds to delete the home folder as the garbage that comes when pressing normal strg+v gets interpreted so...

load more comments
view more: next ›