Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While discussing the security of my home server with my friend, he pointed out to me that with his SSH access, he could write files and delete them, over and over, ad infinitum and that this would damage the hard drive. I realized that in theory, this is possible for anyone who gains write access to any part of the system.

Then again, it's also occurred to me that maybe the same thing can be accomplished simply by spamming a server that writes access logs; I've never heard of that happening.

I've never heard of this potential type of attack before, but it seems plausible to me. Is this actually a risk, and if so, what can be done to prevent it?

EDIT: It is a hard drive with a spinning platter, not an SSD.

share|improve this question
My operating system spams the log-file and the bitmap on my hard drives for years and years, locations that never change, and it does not bother my hard drive. I dont know about servers, but hard drives are amasingly resiliant and can write stuff over and again to the same locations. It would be a very stupid way to try and herass people and machines. – Psycogeek Dec 17 '13 at 3:23
It is true, no doubt about that. Well, it is also true that a not-so-large river carved the Grand Canyon. How it was able to do it, you might ask? The answer is time. The same applies to your scenario regarding the "HD bomb" -- given enough time the tiniest wear and tear would accumulate. But before that happens your grand-grand-grand-grand-grand children would become grand parents... – elgonzo Dec 17 '13 at 4:46
Ostensibly they are thinking about SSDs; hence the write (and delete). – Synetech Dec 17 '13 at 4:49
@Syntech: Well, he speaks about "hard drives". But you are right (as also mentioned in an answer) that write cycles are of concern for flash-based storage such as SSDs... – elgonzo Dec 17 '13 at 4:51
@Psycogeek, I know what you mean; since day-one, I have wondered how file-system structures will affect SSDs. Certain parts like the MBR will always be in the same part of a disk, but they rarely get written. Things like the FAT and MFT on the other hand are also usually statically located, but do get written quite a lot. TRIM and wear-leveling and such are supposed to mitigate the problems, but I can’t help but wonder if anyone is working on a file-system that is more robust and volatile-storage–safe anyway. – Synetech Dec 17 '13 at 14:55
up vote 2 down vote accepted

he could write files and delete them, over and over, ad infinitum

True in some very rare cases:

E.g. If you write to SD cards (flash without wear leveling) and you have no disk cache, then you can wear out the card.

Not true if:

  1. If he does that with small files and the write does not even make it to the disk, just to the disk cache. Then it gets deleted before the actual flush happens.
  2. Not true for regular spinning HDDs. These already take that sort of abuse and happily live on for years. (After 6 years I consider replacing heavily used server disks, but they might work fine for another decade. By that time the hardware is technically outdated though).
  3. Not true for modern SSDs. The first generation had relative low write limits, but those are much higher on modern SSDs. The result is that a SSD is technically outdated again before hitting that limit. (Some tech site(s) even tested this by using a SSD in a desktop, writing to it 24/7 with a background task and then testing the SSD after a year. It was fine. If you have a user who does this for a year and you fail to detect that then the problem is not a technical one).

Lastly, it might hurt the performance of your system. If someone is hitting the disk IO all the time then less throughput will remain for the rest of the system.

Is this actually a risk, and if so, what can be done to prevent it?

No actual risk, but monitoring your systems is always a good idea. Not just for someone doing weird stuff, but also for a myriad of other cases, such as failed fans / high temperature, for failed drives (they do fail now and then, entirely on their own and with no abuse needed), failed RAM, ... ...

share|improve this answer
  • a. You've given an untrusted person SSH access to your server. Don't give access to people who brag about abusing your system.

  • b. You've just described what happens in all the temp folders your OS has access to as well as the constant reading and writing done by system paging and in Windows, the Master File Table. Since your system is already doing the equivalent of his "thought problem", how's it holding up? Current drive technology doesn't really care.

I have 15k SAS hard drives that have taken this "supposed abuse" for 6-10 years without failure. Maybe your weaker consumer grade SATA drives might have a problem, just buy better quality and you won't be having the issue.

share|improve this answer
SSDs might not handle this sort of thing as well as spinning rust, but, as you point out, it already happens with tempfiles and logfiles, so it's worth planning for anyway if it seems likely to become a problem. – Aaron Miller Dec 17 '13 at 4:40
SSDs that can't handle this kind of thing are being weeded out of the gene pool. Server grade SSDs are a lot more resilient now. If you're going to call it a server, you might want to spend the bucks that makes it so <grin>. – Fiasco Labs Dec 17 '13 at 4:48
No, I trust him. He wasn't bragging about abusing my system, he was pointing out a potential vulnerability. – Frogging101 Dec 17 '13 at 14:45

It must be some kind of spam for writing and deleting file over and over again. You can put some time issue and when someone after 1 time deletes or writes a file they should wait some time for write or delete other file exp 10 second. İt is not a real solution but i guess it will delay damage.

share|improve this answer

The act of writing does not in itself wear or degrade a spinning hard drive.

The platters in a hard drive are always spinning, except when in power save mode, especially in a server hard drive. They are spinning at the same speed whether the head is reading, writing, or idle. The read/write head does not actually touch the disk as it does in floppies so there's no chance for friction wear. I've never heard of a read/write head or arm wearing out in any non-ancient hard drive.

Now, the act of bringing a hard drive to full RPM does stress the drive, as well as "emergency offloads" where the drive detects it's lost power and pulls the head away from the platter to avoid a head crash. Perhaps by issuing the appropriate hdparm commands a user can tell a hard drive to power down, then up repeatedly. This still would not cause the "emergency offload" condition, just a spin-down/spin-up. I don't believe your user can do this without root.

If your user is root, your user may be able to upload a bogus firmware update to the drive, bricking it. hdparm is capable of this.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .