Let’s say I have an external HDD with 4 TB of data, and I store it in the shelf.
There is no dust going into it, or anything.
I take it out from the shelf after 10 years, will it work perfectly in theory?
If not, what part can deteriorate and why?
Electrolytic capacitors can dry out for starters
Nothing last forever, check its contents at least once a year and same with a backup
A lot of it depends on the stability of the environment it’s in. Not too hot, not too cold, not too humid, not too dry. You want minimal temperature change over time: a calm, steady, inoffensive environment where nothing changes and nothing moves.
Any deviance from that causes things to happen and things happening can cause the drive to not be in the state you left it in. In theory, the drive will be perfectly fine in an ideal environment like that. For greatest peace-of-mind you would want to store the data with some sort of error detection and correction and verify it every now and then.
In theory, it should work perfectly.
Some old, old drives had a problem where the spindle wouldn’t spin, a phenomenon known as “stiction.” Drives made in the last – maybe – 15 years seem to be immune.
One other remotely possible issue would be “bit rot.” That’s where the magnetic polarity of a single bit could change over time, often being influenced by neighboring bits.
Superparamagnetism is used to “flip” magnetic fields of small particles on drive platters, in order to record data.
https://en.m.wikipedia.org/wiki/Superparamagnetism
There is a slow relaxation over time because sometimes particles flip spontaneously. This means that after a very long time the magnetic patterns on the platters will become more and more random and errors will appear. Error coding, larger regions, and parity and similar tricks can minimize the problem. Higher densities can make it worse.
The rate of relaxation depends on the sizes and density of the magnetic regions, the magnetic properties of the material, external magnetic influence and temperature. If the temperature was absolute zero and no external magnetic fields were present, the magnetic properties of a hdd platter would last forever.
Modern large capacity hdds are filled with helium for cooling and to create a gas cushion between the platters and the reader heads. Since helium is a very small molecule, over time it will leak out through the case of the hdd, making the hdd performance reduced or fail. The helium will slowly leak out, even if the hdd is not being used.
Typically hdds fail early, after less than 10 years, due to vibrations, drops, head crashes, overheating, misalignments and failed electronics. Not because of magnetic relaxation or helium leakage. But eventually magnetic relaxation and helium leakage will cause problems.
This length of time can be anywhere from a few nanoseconds to years or much longer.
It’s hard to derive exact conclusions from this theory.
I’d personally feel a lot more comfortable if that drive was an SSD, not a spinning/mechanical one. Seems (and this is mostly gut feeling) like more can go wrong with mechanical drives: lubrication, things “sticking” etc.