Popped POP OS :)
Posted by Veiled_Wisp@reddit | linux | View on Reddit | 73 comments
I just accidentally deleted my entire OS for the first time :3 I ran in the terminal "find / -iname "steam" -ignore_readdir_race -delete" to delete any Steam install residuals. I accidentally put "iname" instead of "-iname" though so I got to watch my OS crash and burn in real time. I rebooted and I can no longer get past BIOS. Life is great.
aa_conchobar@reddit
Command line fanatics:
Sirius707@reddit
There's a reason why, the first time you use sudo on many systems, there's a message containing the quote "with great power comes great responsibility".
Equivalent_Law_6311@reddit
Yeah, I wanted to delete a timeshift folder that refused to delete, so rm -rf some_dir but forget to add the folder name, then watched several GB of folders vanish until I stopped it.
Mr_Cheese_Lover@reddit
rm -rf is like having access to weapons of mass destruction
Equivalent_Law_6311@reddit
Yep, I learned that the hard way.
allthatsmasomenos@reddit
Ubuntu doesnt, it only says are you sure??
Kruug@reddit
Ubuntu does.
privinci@reddit
I remember fedora show that message, ubuntu warning is different
shogun77777777@reddit
I accidentally deleted everything out of my NAS last week with one command, join the party!
Mr_Cheese_Lover@reddit
Ever seen that video of the guy with the cowboy hat, pulls out his pistol and it discharges into his leg? Yeah, bet it felt like that
stevorkz@reddit
That is terrifying.
daemonpenguin@reddit
Ouch, this is one of those times when you really wish you'd tested with a dry run before using the "-delete" flag.
I am curious though, why you'd do this in the root directory. Wouldn't removing the Steam package and deleting your ~/.steam directory do the trick?
Veiled_Wisp@reddit (OP)
I was initially having a bit of an issue with getting steam to work, so I tried installing it multiple times with multiple different methods. I wanted to make sure I cleared absolutely everything before I did what I was hoping would be my last reinstall. It seems I got my wish, not in the way I intended though.
ManlySyrup@reddit
If you were on Pop_OS, the only option you should ever consider is the official one from Steam's website. There's an official .deb installer on their website that Pop_OS is compatible with. Easiest thing in the world.
Mr_Cheese_Lover@reddit
Just get the flatpak its even easier
KnowZeroX@reddit
This is what things like timeshift are for. You can restore the os to what it was before you ran all the funky stuff without running a blind delete everything.
gentisle@reddit
SystemRescueCD should be able to help you get the images back. If you can get it to boot.
scannerthegreat@reddit
steam should be called something else on linux because this happens also hope you didnt have anythin important there
choodleforreal@reddit
Didn't Linus do something similar? Why does PopOS have this problem so often?
webmdotpng@reddit
No. Linus tried to install Steam from APT, then the terminal returns a warning that the installation of Steam could uninstall everything (an error between 64-bit and 32-bits packages), including GNOME. He still had a functional system, but without a GUI.
choodleforreal@reddit
Oh wow I'm suprised he would ignore a warning like that lol
webmdotpng@reddit
He ignores the whole message.
In the video, it seems to ignore the entire message that the terminal returns and only focuses on the last line which ends in something similar to “if you understand, type: “Yes, do as I say“”. He typed it and the rest is history.
Natjoe64@reddit
Pop os is not the best distro, if your new, I would recommend ether stock fedora or bazzite linux if you are using nvidia graphics. Ubuntu and ubuntu adjacent stuff is not the best place to start
mmstick@reddit
Fedora and Bazzite aren't going to stop you from deleting files in a terminal.
gsstratton@reddit
Bazzite and other immutables will make it much less prone to any catastrophic user error.
webmdotpng@reddit
In fact, you still could delete everything in /var.
Natjoe64@reddit
Thats true, but also they just make everything phenomenally easier
stevorkz@reddit
That’s peculiar. I find pop os to be quite user friendly. In fact if I was asked by someone to recommend a distro to start/learn from, or better yet someone who is afraid of the terminal, I would say pop or mint.
DuePresent7313@reddit
I am almost positive Linus Tech Tips made a very similar mistake. Steam on POP OS is something completely different from Valve's Steam. If anyone knows why lmk, I don't use POP.
Alarming_Airport_613@reddit
Maseltov!
McNastyIII@reddit
Sounds like a memorable/exciting learning experience
I hope you didn't lose anything serious
Veiled_Wisp@reddit (OP)
Nothing major. Just about 10 downloaded images or so. I'm also taking this as a lesson on what to definitely not do again.
ElvisVan007@reddit
don't stop there, here's the chance for you to test it even further to see if you can recover a deleted instance, as long as you don't overwrite the sector range (where the os used to be) with new data, there's ways to recover the partition
draeath@reddit
It's always a good idea to run it without
-delete
first, to confirm it's matching what you expect.lurker-157835@reddit
Same as with SQL. You always SELECT to test out your clause before you DELETE.
KilnHeroics@reddit
Lol. Way to miss foreign keys when transactions exist.......
NatoBoram@reddit
ON DELETE CASCADE
KilnHeroics@reddit
you modify or just have this set?
omenosdev@reddit
Additionally you can start your command with your shell's comment character to prevent accidental execution. Or ensure it ends with
\
which allows for one accidental return press. You can^C
to escape disaster (and/or retain edits to a command you were making without rewriting its history).Visible_Bake_5792@reddit
Well, we all learn by doing mistakes.
agent484a@reddit
Honestly, this is one of the reasons I went to atomic Linux (Fedora Silverblue in my case)
SnooCookies1995@reddit
I'm using bluefin!
agent484a@reddit
I lied, I actually am too but I figured more people would have heard of Silverblue. :)
headedbranch225@reddit
Why lie though, you can just say for example
agent484a@reddit
Lying is fun.
Or is it?
Natjoe64@reddit
run bazzite on my gaming pc/rog ally and its so much better than windows
redddcrow@reddit
1) check the output of find first.
2) if it makes sense, then you can add the -delete flag :)
IMO find should return nothing if the command is not explicitly being told what to find:
"find /" outputs all the files on disk, I think that's an incorrect behaviour.
jacobgkau@reddit
I use
find . | grep -i ...
to search for files in the current directory (recursively) all the time. The.
is telling it to find files in or below the current directory. The/
infind /
is telling it to find files in or below the root of the filesystem. So it's not as if you haven't given it any parameters at all.redddcrow@reddit
let's agree to disagree on that one. in "find ." the . is the location, but what to search for is not specified.
jacobgkau@reddit
Yeah, your opinion just isn't how it works, lol.
Wooden-Opposite3557@reddit
It seems something like this could have helped you out: https://www.youtube.com/watch?v=qkErsc4CA24
NovaStorm93@reddit
the :3 in this post is environmental storytelling
E-werd@reddit
This is why I don't create big long command chains and will just keep them in small steps. Always keep the "Are you sure?" prompts. It takes longer, but saves me from headaches. If I fuck up, it's going to cost me a LOT more time.
Angar_var2@reddit
Why did you need ignore-readdir_race?
Veiled_Wisp@reddit (OP)
I wanted to leave no stones unturned and search through files that would normally be permission blocked in case anything was in there. That seems to have been a major mistake.
freenullptr@reddit
ignore_readdir_race
doesn't do that, all it does is avoid printing an error message for files that have disappeared inbetween their name being read from a directory andfind
making an attempt at deleting them.akanezzx@reddit
thats why guys id rather not mess with -delete flags!
_Sgt-Pepper_@reddit
Never run any deletion operations from or for the / directory
Never do this as root user
Use btrfs
netsx@reddit
So you were logged in as "root" (no sudo)?
KlePu@reddit
Without root permissions that'll still delete pretty much everything under
/home/$USER
, typically the data you care about most \^\^derixithy@reddit
I did a chmod 0755 ./* But my keyboard isn't great and I was in a hurry. So I didn't type the . Ssh wouldnt work anymore docker did strange things, but after a reboot and changing ssh permissions in /etc everything works again. But I probably should still do a reinstall
sebekonlinux@reddit
Well... Live and learn. Valid on Linux, and irl too.
Equivalent_Law_6311@reddit
Been there done that several times, several different ways. I'm a knucklehead.
RandomGuy256@reddit
wow I just learned that find can also delete files...
bstock@reddit
It does have the native -delete flag but it also has -exec which lets you do anything with the found files.
funbike@reddit
I guess you'll have to restore from yesterday's backup.
aqjo@reddit
Backups.
Snapshots.
Bluefin.
shogun77777777@reddit
That’s quite a dangerous command you got there m8
rbrownsuse@reddit
Fun fact.. I did something this stupid on an openSUSE distro once but was able to use an automatic snapshot to restore the whole system to 5 minutes before I was an idiot
fellipec@reddit
Shit happens
0riginal-Syn@reddit
As I tell my kids... Life lessons.
The_Pacific_gamer@reddit
Yes, do as I say!
Keely369@reddit
I'm just going to type "*OUCH!*" here. Not sure if it helps..