this post was submitted on 21 Apr 2024
265 points (98.2% liked)

Linux

54367 readers
669 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 6 years ago
MODERATORS
 

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.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 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.

[–] [email protected] 2 points 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

[–] [email protected] 8 points 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

[–] [email protected] 3 points 1 year ago

Probably removing the default python 2 runtime environment because i didn't like how running python redirected to python2.7, had to reinstall my system 4 times in a year, 4th one is currently happening. 🥲

[–] [email protected] 2 points 1 year ago

I once had grub and rEFInd installed on the same system and an Arch update hosed both. I was able to fix it with an Ubuntu LiveCD and went back to Ubuntu. I still use Arch in a VM as a treat.

[–] [email protected] 6 points 1 year ago (1 children)

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

[–] [email protected] 5 points 1 year ago

Uhoh, the nannies of lemmy.ml took away your naughty word.

[–] [email protected] 15 points 1 year ago (2 children)

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.

[–] [email protected] 7 points 1 year ago* (last edited 1 year ago)

Best advice when using rm -rf
Don't.

[–] [email protected] 2 points 1 year ago (1 children)
[–] [email protected] 1 points 1 year ago
[–] [email protected] 1 points 1 year ago

I once deleted /usr/bin while trying to delete /bin (symbolic link) because I accidentally misformed it . don't remember why I had to recreate /bin in the first place but it had something to do with installing java

[–] [email protected] 2 points 1 year ago

Mine was wiping my vps while backing it up. Luckily for me I only lost some files that I could easily replace.

[–] [email protected] 4 points 1 year ago

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

[–] [email protected] 8 points 1 year ago* (last edited 1 year ago)
dir="$(something that ultimately resolved to "")"

rm -r $dir/*

on a company server

I also once completely destroyed the data in a db that wasn't backed up for that same company while trying to restore from a dump (which was deleted as part of the script i was running).

Luckily both of these mistakes happened on staging servers so no one really cared. (prod is backed up though so if i did it there, not that i have access to prod, it also wouldn't be catastrophic)

[–] [email protected] 3 points 1 year ago

Breaking the bootloader, uninstalling nvidia drivers ton install mesa without removing mesa/nouveau from the blacklist

[–] [email protected] 5 points 1 year ago

Messing around with system python/pip and newly installed versions till all was broken and then looking at documentation.
This was way back on the 00's and I'm still ashamed on how fast completely I messed it up.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

Ha! I just did something like that. I thought I had "orphaned" BTRFS snapshots taking up space.

I opened a file explorer as root...I deleted this one that wasn't listed.

Oh wait..."Writable snapshot"...? Oh...no.

Yeah suddenly no programs or anything worked. Sadly there was no snapshot restoring out of that one! (That I would be capable of, anyway!)

So yeah, I managed to deliberately bumble past several safeguards into the "I should know what I'm doing" area, and found a magical way to rm -rf / from the GUI, essentially. Wee!

Thankfully, /home was its own partition, so aside from minor inconveniences bringing .configs back over and other little tweaks I'd implemented, I have reinstalled OpenSUSE Tumbleweed leaner, meaner, and cleaner. ¯_(ツ)_/¯

ACTUALLY, glad I backed up /home before the reinstall because the first reinstall attempt failed and wiped it!

Backups, kids. They really are the difference between "Aw darn, live and learn."...and complete heartbreaking despair.

[–] [email protected] 7 points 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.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

I footgunned myself with iptables once and couldn't even google how to fix it. (Well, I could with my phone, just not the convenient google - copy - paste - run workflow)

I don't remember the details, but I was trying to control internet access of a VM guest and ended up controlling my own too.

[–] [email protected] 6 points 1 year ago* (last edited 1 year ago)

Not too long ago, on a Slackware box I needed to manually change glibc to another version. No problem, I thought, just remove the version that's there and install the package for the version I needed. So removepkg glibc and then immediately dawned on me.... oh wait I really didn't want to do that... Of course, after that installpkg and pretty much everything else was broken since pretty much everything either depends on glibc, or has a dependency that depends on glibc, so I couldn't install the new package or do pretty much anything other than smack my forehead.

Wasn't actually too big of a deal to fix. Used another computer to create a bootable USB stick with the Slackware installer, booted the computer with the USB stick, and did some chroot trickery to reinstall the old glibc package again. Then booted it back up normally and used upgradepkg to change glibc like I should have in the first place.

[–] [email protected] 5 points 1 year ago

I accidentally wiped my backup. I'm redoing my storage setup and had the backup laying nearby.

I was stunned. I immediately gave up and went to bed.

[–] [email protected] 6 points 1 year ago (1 children)

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.

[–] [email protected] 5 points 1 year ago (1 children)

I did something similar (that my professor still talks about in class as a cautionary tale)

I ran chown -R user .* (intending to target all hidden files in the folder) and for people that don't know .* also matches .. (.. was / in this case) which changed the permissions on all files on the system to that user, including sudo.

We fixed it by mounting the root of the file system in a docker container which effectively gave us root.

[–] [email protected] 4 points 1 year ago

I've also been hit by .* matching ... First of all, I find this really really jarring. It makes sense and doesn't at the same time. I also wonder how to properly only glob the hidden files but I'm too afraid to experiment.

load more comments
view more: next ›