Once I omitted a semicolon after an “rm -rf”and the next command. The script was supposed to reduce downtime vs typing the commands manually, but instead it deleted the production site and the “.bak” backup of the site instantly.
Linux
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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
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.
Today I did rsync backwards. I just restored the backup and moved on.
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.
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.
Thinking Android/Linux would behave anything resembling GNU/Linux
Adding a DENY ALL line to the top of iptables, getting disconnected, realizing that I'm fucking SSHing into this removed...
Uhoh, the nannies of lemmy.ml took away your naughty word.
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.
crontab -r .. now i always look on the keyboard when i want to edit my cronjobs
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.
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.
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.
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.
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.
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.
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.
rm ~*
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.
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.
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.
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...
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.
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.
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.
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.
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.
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.
I was working on my final project in a class in undergrad on the campus VAX. VMS had a versioned filesystem, which is to say that every time you saved a file (like your source code in LSE), it would create a new file (e.g., FINAL.COB;23
). I was getting confused by all of the versions of my project so I decided to clean some of the older ones out:
DELETE FINAL.COB;1*
DELETE FINAL.COB;2*
I had to run to the data center the VAX was in halfway across campus to beg the sysadmins to restore $STUDENTS:[DRWHO.CS1337]FINAL.COB;*
from the hourly tape backup (at least there was that) and re-debug the last two functions so I could hand it in before midnight. Lesson learned: Don't worry about cleaning up your workspace until after you're done.