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

Linux

48185 readers
1107 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.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 113 points 6 months ago (4 children)

Running the right command on the wrong SSH session/machine.

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

This is the scariest comment I've read in this thread.

load more comments (1 replies)
[–] [email protected] 24 points 6 months ago (2 children)

I set a different background color on all my machines because of exactly this while using VNC/RDP

load more comments (2 replies)
load more comments (2 replies)
[–] [email protected] 57 points 6 months ago (1 children)

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.

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

[–] [email protected] 49 points 6 months ago (2 children)
  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.

[–] [email protected] 13 points 6 months ago (16 children)

I have a super-n00b question, and I apologize in advance, but, uh...yeah, what is a serial console?

load more comments (16 replies)
load more comments (1 replies)
[–] [email protected] 44 points 6 months ago* (last edited 6 months ago) (10 children)

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.

load more comments (10 replies)
[–] [email protected] 43 points 6 months ago

rm *.c when I meant rm *.o

[–] [email protected] 33 points 6 months ago* (last edited 6 months ago) (4 children)

ntfsclone /dev/sdc /dev/sdb

/dev/sdb was a blank filesystem and /dev/sdc was my Windows filesystem.

ntfsclone man page

It ran for less than a second and didn't take me long to figure out what happened. That's the story of how I stopped using Windows.

load more comments (4 replies)
[–] [email protected] 31 points 6 months ago (3 children)

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.

[–] [email protected] 21 points 6 months ago

what's the fun in modding if not the two hours where you think you've bricked everything and you're scrambling through a 52 page post on XDA trying to find someone with your same problem

load more comments (2 replies)
[–] [email protected] 28 points 6 months ago (1 children)

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.

load more comments (1 replies)
[–] [email protected] 25 points 6 months ago* (last edited 6 months ago) (1 children)

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

load more comments (1 replies)
[–] [email protected] 24 points 6 months ago (1 children)

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.

load more comments (1 replies)
[–] [email protected] 24 points 6 months ago (1 children)
[–] [email protected] 13 points 6 months ago (2 children)
[–] [email protected] 27 points 6 months ago

Is that the “licking my own nose” emoticon?

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

E37: No write since last change

load more comments (1 replies)
[–] [email protected] 23 points 6 months ago (6 children)

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.

load more comments (6 replies)
[–] [email protected] 21 points 6 months ago

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!

[–] [email protected] 20 points 6 months ago (3 children)

I once removed all groups from my user by using usermod -g instead of usermod -G

load more comments (3 replies)
[–] [email protected] 19 points 6 months ago

I once tried to restore replication on a broken MySQL cluster by restoring the backup on the only good, running node.

[–] [email protected] 19 points 6 months ago (2 children)

How I lost a Postgres database:

  1. Installed Postgres container without configuring a volume
  2. Made a mental note that I need to configure a volume
  3. After a few days of usage, restarted the container to configure the volume
  4. ...
  5. Acceptance
load more comments (2 replies)
[–] [email protected] 18 points 6 months ago (2 children)

Reformatted windows and installed Linux.

Wait before the hate. This was the first time I did it and knew nothing about it and didn't know it would wipe my system. So I lost everything.

[–] [email protected] 21 points 6 months ago* (last edited 6 months ago) (1 children)

On the brighter side, you did delete windows.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 17 points 6 months ago

Trusting tab-completion and pressing enter just a tiny bit too early, resulting in overwriting the work of at least four hours, because the files' names started the same. That whilst trying to initiate a git repository to prevent that kind of mistake....

[–] [email protected] 17 points 6 months ago (5 children)

You know, I'm in a constant battle with bootloaders. I've both deleted grub multiple times and windows boot manager by accident and by believing "I could fix it by re-generating it"... More like re-installing.

load more comments (5 replies)
[–] [email protected] 17 points 6 months ago

I have a faint memory of once uninstalling python2 on an Ubuntu system trying to switch to python3. That was a fun learning moment.

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

I do dumb things like edit my network configuration do some stuff and log out. Then I can't login the next weekend because the IP address is wrong. Also:

Ifconfig eth0 down

And I am booted from ssh.

load more comments (1 replies)
[–] [email protected] 16 points 6 months ago (2 children)

"I have 200 GB of unused space in the windows partition, I'll just plug a live CD, divide that partition and merge it with the Linux one, ggez"

Yes, dividing the windows partition destroyed it. Yes, mixing the windows and ext destroyed Linux. I might have been able to recover something but I was like 18 and I just reinstalled windows in a fit of misdirected anger against Linux.

load more comments (2 replies)
[–] [email protected] 16 points 6 months ago

Not me, and not Linux, but a school mate found the following bash snippet online :(){ :|:& };:.

Naturally, he tried it on the SunOS servers we had access to for schoolwork. He got his account suspended for the rest of the year.

I think most Linux distros are configured to kill fork bombs nowadays.

[–] [email protected] 16 points 6 months ago (4 children)

Deleted the certs from the sshd daemon which locked me out of a remote server that required and a 2 hour drive to fix.

load more comments (4 replies)
[–] [email protected] 16 points 6 months 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

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

Always do an echo first before you put rm in a script. You know the story.

load more comments (1 replies)
[–] [email protected] 15 points 6 months ago (2 children)

I distrohopped once and wanted to try OpenSuse Tumbleweed. Would have went really well if I didn't by accident deleted all my partitions...

I lost all of my curated music files I gathered over the span of the last 15 years.

I'll never get those back.

load more comments (2 replies)
[–] [email protected] 15 points 6 months 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.

[–] [email protected] 15 points 6 months ago (3 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.

load more comments (3 replies)
[–] [email protected] 14 points 6 months ago

I accidentally overwrote /etc/passwd once and I allowed /boot to run out of space during a kernal update and I created a local user with the same user that was also on the realm/domain that I had joined and various bash script issues.
Some stuff I've had to fix that someone else did:

  • named a file rm -rf
  • rm -rf /bin instead of ./bin -- Also the fact that they had sudo was crazy and also I guess this was the second time
  • chmod -R 777 /
  • Various software bugs running swap out of space or hitting the inode limit by creating files over and over again with a timestamp in the filename and having to remove all of them because there was no backup to the OS
  • Someone disabled SELinux because something wasn't working but didn't tell anyone -- ugh
  • Compiled java because they googled some issue and followed some old tutorial without understanding anything instead of using alternatives and symlinked the old java from /bin to /home/theiruser/java -- had sudo because he was a Windows domain admin.
  • Cybersecurity guy didn't know what some VMs did so he turned them off and figured he'd find out if/when someone complained. Caused a massive core services outage.
  • Same Cybersecurity guy deleted a bunch of data because he wanted to see how the sysadmins would respond and witness backup restorations. He did not inform anyone.
  • Cybersecurity guy above still has Domain Admin and sudo everywhere. I would have personally removed his privileged access regardless of what 'CyberSecurity' management thought but I was leaving for a new job by then anyway so I figured I'd just let them eventually lie in the bed they made.

There's more but I don't want to keep going because it is Sunday and I don't want to ruin it.

[–] [email protected] 13 points 6 months ago (10 children)

I updated a manjaro system.

[–] [email protected] 17 points 6 months ago

Did you... Kill-a-manjaro?

load more comments (9 replies)
[–] [email protected] 13 points 6 months ago

My first experience with installing Linux on a hard drive involved wiping the wrong hard drive (my dad’s) and installing on it. Then panicking when Windows 95 didn’t boot up. Thank goodness my dad was understanding lol.

[–] [email protected] 13 points 6 months ago* (last edited 6 months ago) (2 children)
load more comments (2 replies)
[–] [email protected] 12 points 6 months ago

I mounted a disk of a server in rescue mode, since I needed to extract everything (the provider didn't have the option to dump everything as a zip). Then installed an FTP server, added a user/pass, it worked.

But I couldn't access the files of the original disk, even though I could see them. So I just chgrp/chown the original files, since the disk was just "mounted" in the rescue disk /mnt, I thought it was alright (at the time I thought permissions were volatile, stored separately from the files). I could now download the entire disk, yay!

Upon booting the original disk again, a bunch of errors: shell not starting, tools not running, because they were owned by user and not root...

Well we reinstalled all the server from scratch that day.

[–] [email protected] 12 points 6 months ago* (last edited 6 months ago) (6 children)
  • apt something that ended up removing sudo. No more admin rights.
  • used rsync to backup pretty much everything in / , with remove source option...
  • find with -delete option miss positioned. It deleted stuff before finding matching pattern
  • chown / chmod on /bin and/or /usr/bin
  • Removed everything in /etc
load more comments (6 replies)
[–] [email protected] 12 points 6 months ago (1 children)

Tip: don't put important things in just 1 place.

That aside!

Years ago when I first tried out Linux (I was around the age of 10), I didn't really pay much attention while installing Linux back then, so I wiped my entire data disk D:...

[–] [email protected] 12 points 6 months ago* (last edited 6 months ago)

I like the 3-2-1-1-0 backup rule personally.

tl;dr:

  • 3 copies of your data
  • on 2 different media
  • at least 1 offsite copy
  • 1 copy offline (preferably air-gapped)
  • 0 errors (IE verified backups)

(For the super important stuff, obviously. I'm more lax about other things.)

[–] [email protected] 12 points 6 months ago

i accidentally mark iwd as dependency rather than explicit. after that someday im removing a package depends on iwd, iwd itself been removed as a dependency as well. and im been blocked out of my remote machine until someday i have physical acces to it

load more comments
view more: next ›