I’m working on a some materials for a class wherein I’ll be teaching some young, wide-eyed Windows nerds about Linux and we’re including a section we’re calling “foot guns”. Basically it’s ways you might shoot yourself in the foot while meddling with your newfound Linux powers.

I’ve got the usual forgetting the . in lines like this:

$ rm -rf ./bin

As well as a bunch of other fun stories like that one time I mounted my Linux home folder into my Windows machine, forgot I did that, then deleted a parent folder.

You know, the war stories.

Tell me yours. I wanna share your mistakes so that they can learn from them.

Fun (?) side note: somehow, my entire ${HOME}/projects folder has been deleted like… just now, and I have no idea how it happened. I may have a terrible new story to add if I figure it out.

  • inetknght@lemmy.ml
    link
    fedilink
    arrow-up
    19
    ·
    1 year ago
    1. have an nvidia GPU

    2. have Fedora

    3. download RPM package of drivers for Red Hat (after all, Fedora and Red Hat are… compatible, right?)

    4. Everything goes fine

    5. Six months later, upgrade to a new version of Fedora

    6. oops, kernel panic at boot after the upgrade, and no video to troubleshoot after UEFI boot

    7. figure out how to boot into a recovery partition from UEFI

    8. figure out how to enable a serial console over a USB device

    9. figure out how to connect to the serial console from another computer using another USB device

    10. figure out what the kernel panic is from (not the upgrade, but the driver which wasn’t upgraded)

    11. figure out how to uninstall the incorrectly installed driver

    12. figure out how to install the correct driver

    That was a fun three week OS upgrade.

  • bloodfart@lemmy.ml
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    1 year ago

    Everyone here is talking about rm, but when’s the last time you dd’ed the wrong thing by accident?

    You can get tripped up by tab completion, hda vs sda, sda vs sdb, flipping the articles around, he’ll, I’ve even blasted a good drive with /dev/random because I did t pay attention to what computer I’m logged into.

    My killer app for multiple terminals open at once, weather through several ttys, xterms, tmux or the other one I don’t use was to type out my dd commands with a ls or something safe making in front of it while I look back and forth compulsively to verify that all the targets are correct.

    • Bhaelfur@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      Yup, I did that last year. I wrote a Linux ISO to my hard drive instead of a flash drive. It was interesting watching my desktop slowly fail. Thankfully I was preparing a switch to a different distro, so I had backed up what I needed.

  • KISSmyOSFeddit@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    1 year ago

    The dumbest must have been when I went through the list of installed packages on Debian and removed everything named “python-…” since I don’t program in python.

  • Morphior@feddit.de
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago

    If you count Android too, then this: I got my first Android phone when I was 10 or 11 and rooted it on the first day of having it. This was during a time when we were all still using ClockworkMod because TWRP didn’t exist yet, and I somehow ended up with a system without a kernel. Panic ensued, and I spent that entire night (like 10 hours) digging through xda in order to find a tutorial on how to get this damn phone to run again. Imagine having to tell your parents “I broke my phone I got yesterday.” I did get it working at like 6:30 AM. Fun times.

  • collapse_already@lemmy.ml
    link
    fedilink
    English
    arrow-up
    9
    ·
    1 year ago

    I do dumb things like edit my network configuration do some stuff and log out. Then I can’t login the next weekend because the IP address is wrong. Also:

    Ifconfig eth0 down

    And I am booted from ssh.

    • ProtonBadger@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Yeah screwing with the network interface of the machine you’re SSHd into is something nearly every sysadmin have done at least once.

      That or changing something, rebooting the server and subsequently being unable to contact it again due to said change. I’m always scared and feeling I’m taking a risk when upgrading a major OS version over SSH, yet Ubuntu never failed me in that, it’s the silly things that got me, like messing with fstab.

  • slembcke@lemmy.ml
    link
    fedilink
    arrow-up
    9
    ·
    edit-2
    1 year ago

    I totally pulled a LTT and removed my kernel. >_< There was a “real time” kernel listed in apt, and I installed it because I was curious if it would reduce lock latency for a project I was working on. (I wasn’t trying to solve a problem, just curious) It didn’t and I figured it was probably a bad idea to leave it installed. So I did an apt remove, and the rest went something like this.

    Apt: Are you sure you want to remove the your kernel? Y/N

    Me: Oh jeez… I don’t want to do that.

    Motor Memory: Y <return>

    Apt: Are you really really sure? Your computer will not boot if you do this. Y/N

    Me: Oh, crap! That’s not what I meant to do. Definitely not!

    Motor Memory: Y <return>

    Me: No! Why would my brain betray me!?

    Fortunately this was on a PopOS machine, so I booted into the recovery partition. Even if fixing it only took a minute, I still felt very very dumb. >_<

  • thezeesystem@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    1 year ago

    Reformatted windows and installed Linux.

    Wait before the hate. This was the first time I did it and knew nothing about it and didn’t know it would wipe my system. So I lost everything.

  • Laura@lemmy.ml
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    dd if=/dev/zero of=/dev/sda status=progress

    hmm why is it so fast

    OH

    CTRL-C

    and then a kernel panic yeah my fs was gone

  • czardestructo@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    Deleted the certs from the sshd daemon which locked me out of a remote server that required and a 2 hour drive to fix.

    • onlinepersona@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Wonderful. Just like deleting all the iptables rules with a default DENY rule in place *chef’s kiss*. Required calling the service provider to enable a remote console over HTTPS (it was a manual action for them… supposedly).

      Anti Commercial-AI license

  • HarriPotero@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    1 year ago

    Not me, and not Linux, but a school mate found the following bash snippet online :(){ :|:& };:.

    Naturally, he tried it on the SunOS servers we had access to for schoolwork. He got his account suspended for the rest of the year.

    I think most Linux distros are configured to kill fork bombs nowadays.

  • macniel@feddit.de
    link
    fedilink
    arrow-up
    7
    ·
    1 year ago

    I distrohopped once and wanted to try OpenSuse Tumbleweed. Would have went really well if I didn’t by accident deleted all my partitions…

    I lost all of my curated music files I gathered over the span of the last 15 years.

    I’ll never get those back.

    • pipe01@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      Probably too late now lol, but you can totally recover deleted files if you don’t overwrite them. I recommend the System Rescue image, it has a lot of tools to deal with these things.

  • jyte@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    1 year ago
    • apt something that ended up removing sudo. No more admin rights.
    • used rsync to backup pretty much everything in / , with remove source option…
    • find with -delete option miss positioned. It deleted stuff before finding matching pattern
    • chown / chmod on /bin and/or /usr/bin
    • Removed everything in /etc
  • ebd6a8c9051028dc1607@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    i accidentally mark iwd as dependency rather than explicit. after that someday im removing a package depends on iwd, iwd itself been removed as a dependency as well. and im been blocked out of my remote machine until someday i have physical acces to it

  • rolandtb303@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    was too incompetent to install arch one time so i used archinstaller and created a separate home partition. couple years later that root partiton’s close to filled up, and i do an update after deleting come programs to free up space. then some weird text appeaerrs in terminal, and so i try to update again (this time specifically wine), says loads of files already exist in filesystem. i think “this is weird”, so i restart.

    what instantly gets my attention is this text greeting me on boot

    loading Linux linux… error: file ‘/vmlinuz-linux’ not found. Loading initial ramdisk… error: you need to load the kernel first.

    Press any key to continue.

    yup, i just borked my install, so i hastily whipped out an outdated arch USB, updated it using a spare laptop and am now on a reinstall (luckily i keep the important files on a separate drive, so not all is lost). extra insult to injury was that my previous install had my drive LUKS encrypted, so i couldn’t evne get in there to possibly backup anything if i tried lol. but it’s feels refreshing starting anew though.