17

I was trying to enable hibernate on my laptop, when I came across this post, where enabling hibernation on an SSD disk is discouraged.

Then I saw, that that post was four years old. Has anything changed between 2015 and 2019, or should I still not enable hibernation on my laptop's SSD disk?

  • 4
    I have swap on all my SSDs with hibernation. Hibernation takes very little resource of SSD compared to normal use. It was paranoia then and now there is no reason not to have swap on SSD at all. – Pilot6 Aug 13 at 18:32
  • 2
    You could always run sudo swapon -a when you're about to hibernate, and then sudo swapoff -a when the system has returned from hibernation. – RonJohn Aug 14 at 4:25
21

Todays SSD are much larger than they were 4 years ago, making the write cycles involved from hibernating less significant for wearing.

Modern SSD come with 100-300 TBW (terabytes written), i.e. are guaranteed to be able to write 100-300 TB before they fail. This seems to be be plenty but consider that with each hibernation you may write up to the whole amount of RAM you have built in. Each hibernation will in the worst case write 16 GB of data on a laptop with 16 GB of RAM.

A SSD with 100 TBW will then last for

100.000 : 16 = 6250 hibernate cycles
4 hibernations a day makes this 1562 days or
4,3 years

Note that during these 4 years we just hibernated. We had not written anything else on the SSD.

Of course the kernel compresses RAM before writing, there are SSDs that come with 300 TBW or more, we may only want to hibernate once a day, or we have 4 GB of RAM only, so the time span until the drive fails may be much longer.

Still today, hibernating contributes significantly to the the write load on a SSD. Booting from SSD will not write much of data on the other hand. For low RAM machines that don't hibernate too often the life span of a modern SSD may be sufficient.

  • 4
    Good to hear some common sense after all of the FUD re SSDs. I have 2 Crucial - MX500 2 TB 2.5" SSDs and these have TBW of 700TB. So the life of the SSDs will be significantly greater than the life of the system itself. One upvote from me :) – andrew.46 Aug 13 at 22:48
  • 3
    Note that the manufacturer-listed TBW is an extremely conservative estimate: the Tech Report performed an experiment to determine what the actual TBW value is, and all of the tested drives achieved at least double their rated TBW without failure. And this was with older, smaller drives. It's also important to note that after the drive has exhausted its writes, it will still remain readable, so you won't lose any data. – Ian Kemp Aug 14 at 6:24
  • 3
    Does hibernation write all of the RAM to disk? Or just the parts used? It wouldn't seem to make any sense to write e.g, cached disk data to the hibernation image since it's already on the disk. – ilkkachu Aug 14 at 8:46
  • 4
    @ilkkachu It only writes what's used. Interestingly, that does seem to include part of cache... I did a quick test on a system with Linux 4.19; it has 32GiB memory, of which about 4G was used by programs, and 14G by buffer/cache. According to the logs, it wrote about 10G during hibernate, and after resume memory usage was about 4G + 6G buffer/cache. So it looks like it only saves what is used, and "used" includes some of the caches, but not everything. I have no idea how it determines what cache to keep, and what to discard. – marcelm Aug 14 at 10:15
  • 2
    The file size is set as kernel parameter to 2/5 of RAM. See this question. Making this file larger will speed up hibernation if you have a large enough SSD. – Takkat Aug 14 at 10:25
7

When I bought my SSD (not a top brand), the manufacturer's usage life estimate suggested I might expect an eighty year lifetime based on a reasonable write activity, even when using the drive for swap as well as OS and data storage.

SSD hardware hasn't gotten worse in the four years I've had mine, so you should be fine treating your SSD as you would have a platter drive ten years ago, with an expectation that it will outlast a similar capacity platter drive if not abused.

Compared to ordinary in-use swap, hibernation is nearly no usage at all -- so even in 2015 there ought to have been no problem with then-current hardware.

  • 3
    this answer would be better with numbers to back it up. – qwr Aug 14 at 4:58
  • 4
    I agree with qwr: what the marketing department says about the lifespan (especially when they include the weasel word "might") shouldn't be the leading sentence in a stackexchange answer. – Luc Aug 14 at 7:24
  • 1
    Unfortunately, I've had the SSD for at least four years, don't recall the brand, don't care to open up my desktop machine to check, and doubt the specs for a drive this old are still readily available. I arrived at the 80 year figure from write life in gigabytes per day at what the mfgr. claimed as 8 year life at a huge number of gigabytes per day. – Zeiss Ikon Aug 14 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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