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.

  • alexsup21@szmer.info
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    I installed timeshift to have a way to create restore points just in case I mess something up while fiddling with my Archbox.

    I used it for a while before I decided to remove it. After that, I realized it didn’t remove the “restore points” (I didn’t fully understand how it worked) and thought it would be good idea to rm -rf /run/timeshift.

    My whole /home was smited (it uses symlinks to create these “restore points”). Before I realized, it removed gigabytes of data.

    Lesson learned: always understand how something works and always be careful when using rm -rf.

  • pmk@lemmy.sdf.org
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    I wanted to try inserting and removing kernel modules, so I looked around and thought “well, I don’t have a USB stick in right now so I can safely try removing the usb kernel module.” So I did that, and after pressing enter I realized my keyboard is connected with USB.

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

      I was smug thinking “I haven’t done anything so silly as the people commenting in this thread”, then I came across this one. I’ve actually done this one, and it was earlier this year, and I’ve been using Linux since 2004, 20 years.

  • inetknght@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    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.

  • mino@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Adding a DENY ALL line to the top of iptables, getting disconnected, realizing that I’m fucking SSHing into this removed

  • Analog@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    shutdown -h now on the wrong machine. Should have been “-r”. No IPMI but important enough to force me to drive to the office at night.

    Ever since, I force myself to wait a couple seconds before sending any shutdown command, and tend to use reboot instead.

  • MrShankles@reddthat.com
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    I just finished doing a fresh install this morning, because my wifi card wasn’t working. It honestly needed to be done anyway because I was out-of date, but the wifi card finally got me to back-up all my data and do it.

    Fresh install, and wifi still won’t even toggle-on. Was about to look for manual install of the driver, and so on and so forth… and then I noticed my folly

    Fucking keyboard has a toggle switch to turn the wifi off. Not the worst and glad I didn’t pull my hair out over it, but damn… felt pretty dumb this morning

  • mackwinston@feddit.uk
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    An older friend of mine told me years back about an incident that happened on a university VAX running Unix. In those days, everyone was using vt100 terminals, and the disk drives weren’t all that quick. He was working on his own terminal when without warning, he got this error when trying to run a common command (e.g. ls)

    $ ls -l
    sh: ls: command not found
    

    So he went on over to the system admin’s office, where he found the sysadmin and his assistant, staring at their terminal in frozen horror. Their screen had something like:

    # rm -rf / tmp/*.log
    ^C^C^C^C^C^C^C^C^C^C
    # ls -l
    sh: ls: command not found
    # stat /bin/ls
    sh: stat: command not found
    

    A few seconds after hitting return, and the rm command not finishing immediately, he realised about the errant space, and then madly hammered Ctrl-C to try to stop it. It turns out that the disk was slow enough that not everything was lost, and by careful use of the commands that hadn’t been deleted, managed to copy the executables off another server without having to reinstall the OS.

  • KISSmyOSFeddit@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    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.

  • konsn@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    One time on Manjaro i had a dependency issue regarding python3. So i just removed it. The I watched in horror as i saw what packages depend on python3, including pacman and manjaro-system, but did not dare to interrupt the process and end up with a half-broken system, and my curiosity wanted to see it play out. Then I rebooted, and thus legally turned my Manjaro system into a half-working Arch install. It even displayed the OS as Arch Linux. Still managed to fix it without reinstalling by downloading the package files from http mirrors, but if i was smart the entire thing should have taken 5 minutes instead of a full afternoon. Was a valuable learning experience tho

  • sexy_peach@beehaw.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    formatted the wrong drive. I had to run a data rescue program which gave a bajillion files with random names…

  • deo@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Due to some poorly placed quotes, I managed to create a subdirectory named ~ in my home folder. You can imagine what happened next. Luckily, I had just gotten my backup system up and running the day before, so nothing was lost.

  • Laura@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    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

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

    I already posted this before but a friend did chmod -R user /usr/bin and broke every suid and guid bin including sudo lol.

    Personally have accidentally shadow deleted /home via an incorrect bind mount so I couldn’t log into my own user.