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 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.
Best advice when using rm -rf
Don’t.Nice.
thanks
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.
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.
Running the right command on the wrong SSH session/machine.
This is the scariest comment I’ve read in this thread.
-
have an nvidia GPU
-
have Fedora
-
download RPM package of drivers for Red Hat (after all, Fedora and Red Hat are… compatible, right?)
-
Everything goes fine
-
Six months later, upgrade to a new version of Fedora
-
oops, kernel panic at boot after the upgrade, and no video to troubleshoot after UEFI boot
-
figure out how to boot into a recovery partition from UEFI
-
figure out how to enable a serial console over a USB device
-
figure out how to connect to the serial console from another computer using another USB device
-
figure out what the kernel panic is from (not the upgrade, but the driver which wasn’t upgraded)
-
figure out how to uninstall the incorrectly installed driver
-
figure out how to install the correct driver
That was a fun three week OS upgrade.
Why would you need a serial console? Live USB is a thing
I have a super-n00b question, and I apologize in advance, but, uh…yeah, what is a serial console?
You attach a secondary computer via serial (COM port) with your primary computer and then you can open a console on that one. You can access the primary computer as if you would be sitting in front of it.
You probably have to explain what Serial actually is.
-
Adding a DENY ALL line to the top of iptables, getting disconnected, realizing that I’m fucking SSHing into this removed…
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.
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
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.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.
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
formatted the wrong drive. I had to run a data rescue program which gave a bajillion files with random names…
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.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
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.
rm *.c
when I meantrm *.o