Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I bought an SSD and I am going to set up my desktop system with a completely fresh Linux installation.

SSDs are known to be fast, but they have a disadvantage: The number of writes (per block?) is limited.

So I am thinking about which data should be located at the SSD and which at the HDD drive. Generally I thought that data that changes frequently should be placed on the HDD and data that doesn't change frequently can be put on the SSD.

  • Now I read this question, with a similar scenario. In the answers there is written: "SSD drives are ideally suited for swap space..."

    Why are SSDs ideally suited for swap space? OK, I see high potential for raising the system's performance, but doesn't swap data change frequently and hence there would be many writes on the SSD resulting in a short SSD lifetime?

  • And what about the /var directory? Doesn't its contents change frequently, too? Wouldn't it be a good idea to put it on the HDD?

  • Is there any other data that should not be located on an SSD?

share|improve this question
    
As an added point, we used a raid 1 with SSDs on our AIX production DB. Granted they are probably enterprise grade SSDs (havn't actually checked), but still... consumer grade would still be acceptable for most applications where your /proc and /home directories reside on your SSD. –  hydroparadise Jun 27 '13 at 16:29
5  
@hydroparadise /proc is maintained by the kernel and does not live on disk, whether spinning-platter or SSD. –  Michael Kjörling Jun 29 '13 at 13:33
    
Oops, had a brain fart. /var or /etc would be suitable replacements for /proc for the example. I suppose /proc would still be relevant if it spilled over to using swap. –  hydroparadise Jul 1 '13 at 13:14

2 Answers 2

up vote 60 down vote accepted

If you worry about write cycles, you won't get anywhere.

You will have data on your SSD that changes frequently; your home, your configs, your browser caches, maybe even databases (if you use any). They all should be on SSD: why else would you have one, if not to gain speed for the things you do frequently?

The number of writes may be limited, but a modern SSD is very good at wear leveling, so you shouldn't worry about it too much. The disk is there to be written to; if you don't use it for that, you might just as well use it as a paperweight and never even put it into your computer.

There is no storage device suited for swap space. Swap is slow, even on SSD. If you need to swap all the time, you're better off getting more RAM one way or another.

It may be different for swap space that's not used for swapping, but for suspend-to-disk scenarios. Naturally the faster the storage media used for that, the faster it will suspend and wake up again.

Personally, I put everything on SSD except the big, static data. A movie, for example, doesn't have to waste expensive space on SSD, as a HDD is more than fast enough to play it. It won't play any faster using SSD storage for it.

Like all storage media, SSD will fail at some point, whether you use it or not. You should consider them to be just as reliable as HDDs, which is not reliable at all, so you should make backups.

share|improve this answer
4  
This answer totally ignores the fact that lots of data is written rarely but read frequently. –  jwg Jun 27 '13 at 12:31
15  
Ummm, how does that change the answer? The theme here is "gain speed for the things you do frequently". What's it matter if that is reading or writing? The point is use the SSD for things that involve lots of disk IO regardless of reads or writes. –  Pete Jun 27 '13 at 14:12
1  
@LorenPechtel So you're saying that you actually expect that SSD to be functional in about a hundred years' time? Somehow I doubt it will be, regardless of usage patterns. :) "Increasing at a constant rate" does not necessarily translate to "accurate", particularly when you are (as is most likely the case) measuring one thing but reporting it as another. If you are measuring write cycles but reporting it as lifetime, that ignores everything else that can go wrong, especially over a longer period of time (physical materials and component fatigue comes to mind as one possibility). –  Michael Kjörling Jun 28 '13 at 8:15
2  
SSDs are better specifically at random IO, not just any IO. Normal drives will be just as good for sequential access such as media. –  JamesRyan Jun 28 '13 at 11:41
1  
@JamesRyan That assumes that access is indeed sequential at the physical disk block level. For relatively static content it likely will be, but it isn't a given: even files written (relatively speaking) all at once, or which have space reserved for them at the beginning, can be fragmented. –  Michael Kjörling Jun 29 '13 at 13:19

Ok, so the goal is to get as much bang for the buck as possible - Speed vs. the price of replacement hardware (assuming a single large harddisk and medium-size SSD, which seems to be the norm). To simplify you can to weigh how much you notice the speed increase from moving a file to the SSD against the number of sectors written to move that file to the SSD.

  • Files which need to be read a lot and written to rarely (such as the OS and programs) would probably be the most obvious to move to the SSD.
  • Files which are written once and read to many times at a fixed data rate where the HDD is fast enough (for example music, video) should probably stay there. They are usually not modified, but consider that they are written to a lot of sectors.
  • Small files which are modified a lot (such as some temporary files) are more complicated. For example, given a sector size of 512 bytes, you can overwrite a single-sector file 20,000,000 times before "consuming" the same amount of writes as writing a single 1 GiB file once. If the SSD takes care of wear leveling these should be equivalent.

Of course, even the best calculations also use up the most precious resource of all, time. So in the long run you're probably best off keeping it simple and buying new hardware slightly more often than the absolutely ideal case.

share|improve this answer
1  
speed vs price of replacement vs. data loss. yeah not everyone uses backup even if they should. +1 –  naxa Jul 12 '13 at 13:56
    
I have to admit that I like the concept of sector-writes as a measure of storage usage, particularly in the case of SSDs. :) –  Michael Kjörling Aug 11 '13 at 19:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.