The query actually shows a lack of confidence. He should have googled "How to recover a file from /dev/null?" instead.
linuxmemes
Hint: :q!
Sister communities:
Community rules (click to expand)
1. Follow the site-wide rules
- Instance-wide TOS: https://legal.lemmy.world/tos/
- Lemmy code of conduct: https://join-lemmy.org/docs/code_of_conduct.html
2. Be civil
3. Post Linux-related content
sudo
in Windows.4. No recent reposts
5. π¬π§ Language/ΡΠ·ΡΠΊ/Sprache
6. (NEW!) Regarding public figures
We all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.Please report posts and comments that break these rules!
Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.
- Stack Overflow
Top voted answer
"Why would you want to?"
"... you don't. You recover it from /dev/random. Eventually."
And if really want quality recovery, /dev/urandom
. Might take a bit longer, but it's worth the wait π.
Duh, just read it back from /dev/random
You will recover the data, you just need to wait long enough.
Patience is key.
I mean, if the data was written to a HDD, then any forensic tool can read the magnetic residual patterns on the metal platters instead of looking for file headers?
That is true, though it would be pointless to look for it in /dev/null
.
There is nothing in /dev/null, and no man needs nothing.
A hole would be something, this is NOTHING!
/dev/void
π€
That hack Torvalds keeps denying my pull request to implement /dev/aether which would immediately begin overwriting the entire disk and all other mounted storage with the repeating content of whatever is moved there.
That is... brilliant! I love it!
Programmatically, what does the kernel actually do with data sent to /dev/null? Put it in a temp buffer and just delete it?
I was also curious, here's a good answer:
https://unix.stackexchange.com/questions/670199/how-is-dev-null-implemented
The implementation is:
static ssize_t write_null(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
return count;
}
So it's basically doing nothing and lying about it. π
"I accepted all of the bytes you gave me. I didn't do anything with them, but I accept you gave them to me".
Could've at least say thank you...
It's open source. If manners are an important feature to you perhaps look into contributing... :)
Yeah, that could actually be fun to be honest, lol π. But I just know the PR would be rejected, lol π.
The syscall to write passes a buffer and length. If it is Dev null the call just returns without doing anything more.
Programmatically, what does the kernel actually do with data sent to /dev/null?
I imagine it's like getting nullified in that olde show ReBoot.
Why would you be trying to recover something from a virtual device?
Because apparently, he moved it there... and doesn't know what /dev/null
is...
It is still on the disk though
Do people not understand how files work? Actually never mind that makes sense.
Yes.
It is still on the disk though
Do people not understand how files work? Actually never mind that makes sense.
Do people not understand how files work?
Oh honey, imagine trying to tech-support a family of rednecks. Threaten to charge them for services and they'll stop pretty quick though...