this post was submitted on 21 Apr 2024
262 points (97.8% liked)

Linux

48323 readers
919 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 5 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.

(page 3) 50 comments
sorted by: hot top controversial new old
[–] cosmicrookie@lemmy.world 7 points 7 months ago

There's a lot of gun refference in that school class. Are you by any chance in the US?

[–] ChaoticNeutralCzech@feddit.de 7 points 7 months ago

Wanted to customize GRUB and tried the GUI program. I wanted it to boot without delays unless a key is being held, and also add a "Shutdown" option (GRUB script halt), in case I open the laptop and didn't want it turned on. The edits looked alright in GRUB Customizer but I should not have made them both at once, because it made "Shutdown" the default option somehow, so the OS would never boot and holding none of the special keys worked. I failed to update or reinstall GRUB using a live USB and ended up having to reinstall the entire distro.

[–] cyberwolfie@lemmy.ml 7 points 7 months ago (1 children)

I've deleted my DE a couple of times from not reading the "The following packages will be REMOVED"-list.

load more comments (1 replies)
[–] rolandtb303@lemmy.ml 7 points 7 months 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.

[–] OADINC@feddit.nl 6 points 7 months ago

I was running a Vanilla+ Minecraft server and was wondering why my plugin was not working. I had forgotten to unzip it before uploading it to the Ubuntu server vm and didn't know how to unzip on Linux. So I just unzipped it in windows and re transferred the file. Yaay RSync.

Otherwise just basic mistakes command in the wrong folder type of stuff.

[–] toastal@lemmy.ml 6 points 7 months ago

Thinking Android/Linux would behave anything resembling GNU/Linux

[–] mlg@lemmy.world 6 points 7 months 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.

[–] Archr@lemmy.world 5 points 7 months 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.

load more comments (1 replies)
[–] possiblylinux127@lemmy.zip 6 points 7 months ago

Today I did rsync backwards. I just restored the backup and moved on.

[–] bleistift2@feddit.de 6 points 7 months ago

I’m not sure anymore how I got into a state where that was necessary, but do keep a reference around for how to boot Linux or Windows from the Grub command line.

[–] taaz@biglemmowski.win 6 points 7 months ago* (last edited 7 months ago) (1 children)

Removed and apt purge'd python2 package.

Pity debian folded in on itself and dpkg required it at the time for something so that wasn't an easy one.

load more comments (1 replies)
[–] mino@lemmy.ml 6 points 7 months ago (1 children)

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

[–] ikidd@lemmy.world 5 points 7 months ago

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

[–] unmagical@lemmy.ml 6 points 7 months ago* (last edited 7 months ago)

Deleting my grub config instead of editing it. Fortunately that's pretty easy to recover from, just annoying.

F'ed up installing graphics driver and had to reset everything from another TTY, also just annoying.

Chose the wrong permissions or path on a chmod call and locked out a big party of the system. I think that was during a setup though, so I just started from scratch again.

[–] toddestan@lemm.ee 6 points 7 months ago* (last edited 7 months 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.

[–] avidamoeba@lemmy.ca 6 points 7 months ago* (last edited 7 months ago) (2 children)

Stupid 1

Made a 4-disk RAID10, back when 160GB disks were boss and I couldn't afford WD Raptors. Fiddled with some tune2fs options to make it even faster. After a reboot, fsck found some errors. Asked if I want to fix them. I said yes. It asked again for some more errors. I said yes. Eventually I jammed a screwdriver in the keyboard to accept every prompt. After a while of this a grim feeling came over me that fsck might not be doing me a favor. Stopped the machine. Booted into a live CD, mounted the fs, a good number of music and other files were gone. Luckily the corruption wiped mostly larger files like audio and video which were replaceable. I started making backups after that.

Here's what 160GB disks sequential read benchmarks used to look like:

Stupid 2

Around the same time I tried to convert Debian to Ubuntu by replacing the Debian repos in apt with Ubuntu's and following with dist-upgrade.

load more comments (2 replies)
[–] loppwn@sh.itjust.works 6 points 7 months ago (1 children)

crontab -r .. now i always look on the keyboard when i want to edit my cronjobs

load more comments (1 replies)
[–] darkphotonstudio@beehaw.org 5 points 7 months ago (1 children)

I've reinstalled a few times throughout the years, simply because I didn't want to deal with fixing something, mainly a bloated mess with multiple desktops. Sometimes it's faster to back up home and nuke it from orbit.

load more comments (1 replies)
[–] MustrumR@kbin.social 5 points 7 months ago* (last edited 7 months ago) (3 children)

Ran rm -rf after copying filepath with a space. The directory up to the space did exist. Fortunately so did a backup.

Cleaned a secondary drive mounted at the same point without noticing I was on the wrong SSH terminal tab, at least twice.

load more comments (3 replies)
[–] Norgur@kbin.social 5 points 7 months ago

Added an usb drive by its /dev/sd** identifier to fstab without the nofail option. Wanted to do a quick reboot for something I can't remember, then copy the files over to the USB drive, since I'd need them on the next day and… no boot. The reboot had assigned another name to the drive (/dev/sdb instead of /dev/sdc or something) and automount wouldn't skip it because nofail was missing. In the middle of the night, with files I required right the next morning. Fun times.

[–] CorrodedCranium@leminal.space 5 points 7 months ago (1 children)

Mostly powering off my system when I shouldn't have. I believe one time I began the process to format a drive I didn't mean to and when I saw the process had started I pushed the power button and just made things worse. The other times were when I was updating.

This all happened when I first started using Linux.

load more comments (1 replies)
[–] naptera@feddit.de 5 points 7 months ago

Just recently I have skill issue'd myself by doing git clean -rf in my home directory where my dotfiles live and therefore deleted all of my home files. I was tired and looked for a quick way to resolve my conflicts and made the stupidest mistake one can do: execute a command you do not really understand.

At least I know what it does now and now I also do hourly local backups of my files with cron and borg.

[–] loops@beehaw.org 5 points 7 months ago (2 children)

I wanted to upgrade my Ubuntu to a newer version, but I had to do it through the command line. During the upgrade it asked if I wanted to see the file changes or something, so I said yes for fun... I couldn't get out of the menu, or rather I didn't know how and seemed to be stuck halfway through the upgrade. I tried a bunch of keys and possible combinations including.... Ctrl + X.

So after quitting the terminal halfway through a system upgrade I tried to restore through backup. Turns out the backup was corrupted or something and didn't work. I never realized because I never thought to test it. I lost a few years of photos and some music files that I've had probably for decades that I downloaded off Limewire. I still have the backup file in case it can be salvaged some day, but oh well. Most of the files I was able to download again off of the bay.

load more comments (2 replies)
[–] markstos@lemmy.world 5 points 7 months ago (2 children)

Started to DBAN (destroy) internal drive instead of external drive.

load more comments (2 replies)
[–] vluz@kbin.social 5 points 7 months 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.

[–] possiblylinux127@lemmy.zip 5 points 7 months ago
[–] gwildors_gill_slits@lemmy.ca 5 points 7 months ago

If I've been repeatedly rerunning commands via ctrl-r'ing back through my history, I'll start getting careless and more than i should have I've accidentally hit enter twice on the wrong command without pausing to double check first. Sometimes to less than desirable effect...

[–] ThetaDev@lemmy.dbzer0.com 5 points 7 months ago* (last edited 7 months ago)

Attempting to resize the system partition without backing the system up first (right after I spent the whole day setting everything up). Gparted failed, the system did not boot any more so I had to stay up the night to redo the whole setup. No personal data loss since the system was fresh, though.

Since I got into Linux via virtual machines and Raspberry Pi before using it as my daily driver, I made most of my stupid beginner mistakes (like changing permissions on systen files) where it did not really matter.

[–] RedstoneValley@sh.itjust.works 5 points 7 months ago (1 children)

This happened just this morning. Probably not the dumbest thing ever, and I blame Snap for putting things where they don't belong: I deleted stuff from the /run/user/1000/doc directory. Turns out the files there are in fact hard links to files which actually reside somewhere else. Well, they were, until I deleted them forever.

Background: Firefox (as an Ubuntu snap package) downloads files in some kind of sandbox mode and references stuff there for some obscure reason. That was my weekly reminder to get rid of snap packages because snap sucks in a myriad of ways.

load more comments (1 replies)
[–] little_tuptup@lemmy.ml 5 points 7 months 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.

[–] A1kmm@lemmy.amxl.com 5 points 7 months ago

Most of mine are variations of getting confused about what system / device is which:

  • Had two magnetic HDDs connected as my root partitions in RAID-1. One of the drives started getting SATA errors (couldn't write), so I powered down and disconnected what I thought was the bad disk. Reboot, lots of errors from fsck on boot up, including lots about inodes getting connected to /lost+found. I should have realised at that point that it was a bad idea to rebuild the other good drive from that one. Instead, I ended up restoring from my (fortunately very recent!) backup.
  • I once typed sudo pm-suspend on my laptop because I had an important presentation coming up, and wanted to keep my battery charged. I later noticed my laptop was running low on power (so rushed to find power to charge it), and also that I needed a file from home I'd forgotten to grab. Turns out I was actually in a ssh terminal connected to my home computer that I'd accidentally suspended! This sort of thing is so common that there is a package in some distros (e.g. Debian) called molly-guard specifically to prevent that - I highly recommend it and install it now.
  • I also once thought I was sending a command to a local testing VM, while wiping a database directory for re-installation. Turns out, I typed it in the wrong terminal and sent it to a dev prod environment (i.e. actively used by developers as part of their daily workflow), and we had to scramble to restore it from backup, meanwhile no one could deploy anything.
load more comments
view more: ‹ prev next ›