There are tools like snapper and btrbk that periodically make snapshots. Since btrfs is a COW filesystem, the live subvolume just stores newer changes on top of the snapshot — it doesn't need to copy anything until it changes. Only when file data is no-longer referenced is it actually marked free to overwrite. This can make disk usage a bit un-intuitive since you can have large files stuck in snapshots that don't show up in your live subvolumes but still use up space. It can really save you from serious mess ups and is really cheap in terms of performance. It's also possible to send snapshots over a network to another machine if you want longer term backups without keeping them on local disks.
But rm -r when you created a snapshot before basically just adds metadata about which files are supposed to be deleted in the current version.
The snapshot still has the old filesystem content.
That also means that when you use up all your space, deleting files actually worsens the problem.
Last week “I was trying to fix something” and made some bad decisions. Long story short, wrong command in the right directory the screen flashed like in this meme💀. Well, I liveUSB to reinstall the whole thing. Then I remembered that I installed Cachy with BTRFS snapshots. Bam Fucking magic, it's like nothing happened… I call it the Ohh shit, Ctrl-Z OS troubleshooter. Yep I'm new in linux...
I was trying to sudo rm -rf ./ Once and missed the / so I just used rm -rf . And this was before they added --no-preserve-root as a default so it just ripped through my entire drive.
I recently noticed that the logging framework I use does not limit the log's length. I don't know how exactly I filled the memory so quickly, but I did
38 Comments
Peffse@lemmy.world · 116 pts · 222d
The heart skip when an rm command runs longer than expected.
Hubi@feddit.org · 108 pts · 222d
When you run a dd command and the light on the USB stick does not start flashing
Peffse@lemmy.world · 58 pts · 222d
01189998819991197253@infosec.pub · 9 pts · 221d
Me right now
kali_fornication@lemmy.world · 22 pts · 222d
that really is a terrifying feeling
Little8Lost@lemmy.world · 20 pts · 222d
Why does it always take so lang to remove the french language pack???
hesh@quokk.au · 71 pts · 222d
ctrl-c ctrl-c ctrl-c ctrl-c ctrl-c
kali_fornication@lemmy.world · 50 pts · 222d
i ctrl+c my fucking face off when that happens.
oh and in case y'all can't read it, the command is
cat *in/binDeltaWingDragon@sh.itjust.works · 18 pts · 222d
How do I stop some big mean missed command from tearing up my main drive?
The answer: Use Ctrl-C. And if that don't work, use more Ctrl-C.
And if that don't work? Use Ctrl-Z.
cypherpunks@lemmy.ml · 5 pts · 221d
followed by
jobs,kill %1, etcTruscape@lemmy.blahaj.zone · 41 pts · 222d
"The right command in the wrong directory can make all the difference in the world. So rise and shine, Mr. Tux. Wake up, and check the log files..."
princess@lemmy.blahaj.zone · 5 pts · 221d
kkzzt Pick up that coredump.
regedit@lemmy.zip · 5 pts · 221d
I heard this in G-man's voice from the first two or three words!
Truscape@lemmy.blahaj.zone · 3 pts · 221d
That was intentional :)
Apart from the initial "Rise and Shine" before the first sentence, this is a direct play on G-man's intro speech from HL2.
Infernal_pizza@lemmy.dbzer0.com · 25 pts · 222d
Btrfs snapshots to the rescue!
Geometrinen_Gepardi@sopuli.xyz · 9 pts · 222d
I've been meaning to tinker with Brfs. Is the idea that snapshots live on a separate volume so you can always recover a messed up system?
Morphit@feddit.uk · 14 pts · 222d
There are tools like snapper and btrbk that periodically make snapshots. Since btrfs is a COW filesystem, the live subvolume just stores newer changes on top of the snapshot — it doesn't need to copy anything until it changes. Only when file data is no-longer referenced is it actually marked free to overwrite. This can make disk usage a bit un-intuitive since you can have large files stuck in snapshots that don't show up in your live subvolumes but still use up space. It can really save you from serious mess ups and is really cheap in terms of performance. It's also possible to send snapshots over a network to another machine if you want longer term backups without keeping them on local disks.
Hupf@feddit.org · 7 pts · 222d
That would be a separate step (send/receive).
But
rm -rwhen you created a snapshot before basically just adds metadata about which files are supposed to be deleted in the current version. The snapshot still has the old filesystem content.That also means that when you use up all your space, deleting files actually worsens the problem.
JasonDJ@lemmy.zip · 21 pts · 222d
When I paste a 250k-line log to console.
shoki@lemmy.world · 4 pts · 221d
wondering why firefox hangs as you paste a 30MB text file into an online diff tool
alecsargent@lemmy.zip · 19 pts · 222d
sudo kmsplsnerf7@lemmy.world · 15 pts · 222d
Last week “I was trying to fix something” and made some bad decisions. Long story short, wrong command in the right directory the screen flashed like in this meme💀. Well, I liveUSB to reinstall the whole thing. Then I remembered that I installed Cachy with BTRFS snapshots. Bam Fucking magic, it's like nothing happened… I call it the Ohh shit, Ctrl-Z OS troubleshooter. Yep I'm new in linux...
Mnem667@sh.itjust.works · 13 pts · 222d
b_tr3e@feddit.org · 10 pts · 222d
rm -rf is always right. No matter where. Supposed, of course, you are root.
No discussion. I am root! I am always right!
jimerson@lemmy.world · 9 pts · 222d
Made that mistake last week. Luckily it was just a chmod and not a rm. Stomach did a flip regardless.
frostlytt@lemmy.blahaj.zone · 6 pts · 222d
oh i made that same mistake a month ago when trying to chmod 777 -R another partition... and ran it in / instead
princess@lemmy.blahaj.zone · 4 pts · 221d
when I was but a baby sysadmin, my boss did that to a production server
cypherpunks@lemmy.ml · 3 pts · 221d
that can still render a system unbootable 😅
jimerson@lemmy.world · 1 pts · 221d
Hah, fair enough!
stupidcasey@lemmy.world · 8 pts · 221d
I was trying to sudo rm -rf ./ Once and missed the / so I just used rm -rf . And this was before they added --no-preserve-root as a default so it just ripped through my entire drive.
beegnyoshi@lemmy.zip · 6 pts · 221d
sudo rm -rf ./andsudo rm -rf .are, as far as I know, the same command. Did you mean that you dropped the . and ransudo rm -rf /?Fortunately for me, this never happened to me, but I have gotten pretty close to running
rm -rf ~after mistakenly creating a directory caller~...Killercat103@slrpnk.net · 2 pts · 220d
This is why i find rmdir useful.
x00z@lemmy.world · 2 pts · 221d
How do you even delete such a directory?
HK65@sopuli.xyz · 4 pts · 221d
rmdir ./~
x00z@lemmy.world · 2 pts · 221d
That makes sense.
irelephant@lemmy.dbzer0.com · 4 pts · 221d
When you forget to pipe the log file into
lessGottaHaveFaith@fedia.io · 2 pts · 222d
I've aliases sudo rm to sudo rm -i
UnfortunateShort@lemmy.world · 2 pts · 222d
I recently noticed that the logging framework I use does not limit the log's length. I don't know how exactly I filled the memory so quickly, but I did