Writing buffer to hard disk - can it fail? What are the stats?

Hi Experts,

I'm wondering - when we use any old file API and write bytes to a disk file, I'm sure this can fail and give an error.  But I also think it's entirely possible that the write fails WITHOUT error.  The bytes may all have been written, but could one or all of them be wrong?  I'm sure the answer is yes, but does anyone have any stats on this?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

>> But I also think it's entirely possible that the write fails WITHOUT error.

That's highly unlikely with modern operating systems, given that we're talking about conventional hard drives or SSDs here (you probably would not get an error code, but a BSOD or kernel panic). I would not rule that out when using an USB thumb drive with ailing or already defective flash chips, though.
threadyAuthor Commented:
Hmmmm... What about when a neutrino hits a drive head right when it's writing?  Or a spinning ionized dark matter particle that ricocheted off of a black hole?  Didn't think of that huh?

Seriously- it has to be more common than we'd think...
I would also not rule out that his would happen, but it would be detected as a 'write error' either at the drive's firmware level or the file system driver level. It's not like writing a bunch of bits to a disk, there are parity bits and checksums involved as well. While I would definitely believe your scenario with hardware and storage methods like 25 years ago, I'd consider them unlikely today.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

threadyAuthor Commented:
I'm going to be hard-headed on this one....  Just in case.  I have reason to believe otherwise from what I've seen in our tests (hashing the data showed that what was supposedly written was not what was on disk)...  I'll get back to you if I find anything.  Thank you!
it can also come from an incomplete magnetisized disk surface :  http://www.dposoft.net/hdd.html
Gerald ConnollyCommented:
There are lots of scenarios that can cause disk corruption - e.g. a power fail or power off of a system at the wrong time can mean that not all the updates required to update the file system get done in time, or maybe somebody has enabled The Write-Back Cache on a battery less RAID controller etc etc
threadyAuthor Commented:
Thanks everyone!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Hardware

From novice to tech pro — start learning today.