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.

  • 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.

    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.

  • I tried to install an OS to a USB stick. This is Kubuntu specific.

    You need to create a GPT partition on the stick, then you should be able to just use the installer and install on another USB stick.

    I went through it, selected the usb stick… was not sure if everything was right and went a menu back, was correct, went forth again, past the install target selection and installed.

    Well… turns out the Kubuntu installer (Calamares) selects the first disk always. And that selection seems to reset to default when going a menu back…

    I deleted my complete normal disk, with like everything I had.

    No Backup no mercy. Luckily did one only a few weeks before. The first since half a year! Damn… had my uni stuff on Nextcloud, a lot of personal stuff synced to my phone with syncthing.

  • 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.

    • I did pretty much exactly this on a Galaxy S1 (i9000) that was old even when I got it, but my uncle who gave it to me said that to make it usable I needed to install Cyanogenmod.

      I thought I fully bricked the phone trying and it actually sat dormant for years afterwards until I re-found the Odin backups I had taken, and was able to fully fix and restore it. Unfortunately by that time, nearly no ROM existed that was both up to date and a usable speed.

  • 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.

  •  slembcke   ( @slembcke@lemmy.ml ) 
    link
    fedilink
    18
    edit-2
    7 months 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

    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

    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. >_<

    • Man, that’s a really dumb story that I find really relatable despite not having had any experiences like that. It feels like it’d be very in character for me though. Thanks for sharing, it helps me feel less silly in the various times where I’ve messed up (of which I am struggling to recall specific examples, but whatever brain part is responsible for embarrassment can remember, apparently)

  • Way back when I was just beginning to experiment with Linux back in the 90s I installed ZipSlack, which was a GUIless 100MB distro based on Slackware that ran from a folder on Windows. It was okay but I couldn’t really do much with it and back then 100MB was a chunk of space, so i went to delete it. But i thought I would give it one last hurrah by deleting it from Linux. So I made use of the infamous rm -rf and sat there thinking “this is taking a long time”… then realised I had my Windows drive mounted as a sub folder and I was in the process of wiping my hard drive of everything!

  • 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.

    • Only reason dd hasn’t bitten me is that in my head, if and of make perfect sense as input and output.

      Doesn’t mean I won’t make that error tomorrow, ofc. But I tend not to alias except harmless stuff to avoid that very problem.

    • 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.