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?

  • krimson@feddit.nl
    ·
    edit-2
    5 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.

      • BestBouclettes@jlai.lu
        ·
        5 months ago

        I don't think it is, if it doesn't run its course on its own, you're screwed. It's Debian so you can recover, but, at least for me, it was painful.

  • raoul@lemmy.sdf.org
    ·
    edit-2
    5 months ago

    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)

  • exocortex@discuss.tchncs.de
    ·
    5 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.

  • papertowels@lemmy.one
    ·
    5 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 :)

  • Kanedias@lemmy.ml
    ·
    5 months ago

    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.

    • Jordan_U@lemmy.ml
      ·
      5 months ago

      USB block devices containing mountable filesystems (on Desktop systems) can generally have those filesystems mounted and files written to them by regular users; But the block device itself stays only root writeable.

      So, you need root privileges either way.

      (Going from memory, but also decently confident)

  • SomeLemmyUser@discuss.tchncs.de
    ·
    edit-2
    5 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...

  • halfway_neko@lemmy.dbzer0.com
    ·
    edit-2
    5 months ago

    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 :)

  • lemmyreader@lemmy.ml
    ·
    5 months ago

    Years ago a friend mistakenly typed in killall5 as root on a remote server. Didn't break things but resulted in extra work and effort.

  • bigkahuna1986@lemmy.ml
    ·
    5 months ago

    I was trying to extract some files from a a Linux image of one of those ARM boards. It was packed into the cpio format, and I had never used the format before. Of course I was trying to extract to a root owned directory and I sudo'ed it. I effed up the command and overwrote all my system directories (/bin, /usr, /lib, etc...). Thankfully I had backed up my system recently and was able to get it working again.

  • Adanisi@lemmy.zip
    ·
    edit-2
    5 months ago

    Writing and running a script to delete the first 2 characters from all files and folders recursively.

    It started backtracking to my home folder. :/

  • Thann@lemmy.ml
    ·
    5 months ago

    Accidentally executed a JPEG (on an NTFS partition) and the shell started going crazy. reboot was not successful =[

  • bitwolf@lemmy.one
    ·
    edit-2
    5 months ago

    The only time was within a VM. I accidentally wrote

    rm -rf ./* while my cwd was /

    I use absolute paths with -rf now, to prevent the error again.

    Every other breakage I had was with apt shitting itself. It has always been fixable just annoying.

    I now use Fedora, to prevent the error again.

  • musicmatze@lemmy.ml
    ·
    edit-2
    5 months ago

    Not really a "braking my linux setup", but still fun as hell! Back in university, a friend of mine got a new notebook at a time... we spent the night at the university hacking and they wanted to set the notebook up in the evening. They got to the point where they had to setup luks via the cryptsetup CLI. But they got stuck, it just wouldn't work. They tried for HOURS to debug why cryptsetup didn't let them setup LUKS on the drive.

    At some point, in the middle of the night (literally something like 2 in the morning) they suddenly JUMPED from their seat and screamed "TYPE UPPERCASE 'YES' - FUCK!!!"

    They debugged for about six hours and the conclusion was that cryptsetup asks "If you are sure you want to overwrite, type uppercase 'yes'". ... and they typed lowercase. For six hours. Literally.

    The room was on the floor, holding their stomach laughing.

  • carcus@lemmy.ml
    ·
    5 months ago

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