decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
What have you got against the swap partition? | 179 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
SSD stops working ...
Authored by: Wol on Thursday, September 20 2012 @ 07:31 AM EDT
I've not dug into it, but I've seen comments by people who should know (on LWN
iirc) that say it's very easy to destroy a flash device (such as an SSD).

It's quite tricky to do it deliberately, but all you need do is pull the power
while it's actually writing. Normally, that just results in a corrupt
filesystem. But pick the right moment and it corrupts the controller ... bingo -
the card will never start up again ...

So NEVER pull power on an SSD that's in the middle of a write.

Cheers,
Wol

[ Reply to This | Parent | # ]

What have you got against the swap partition?
Authored by: ailuromancy on Thursday, September 20 2012 @ 12:36 PM EDT

First, here is a magic command to output the number of sectors written to each block device:

awk '$10 != 0 {print $3"\t"$10}' /proc/diskstats

And here is the output for my laptop:

  • sda    43196
  • sda2      469
  • sda3        24
  • sda5  29825
  • sda6          8
  • sda7  12870
  • dm-0         8

The swap partition is encrypted on dm-0, which is hosted by sda6. 8 sectors have been written to the swap partition. (sda1: boot - not mounted, sda2: /, sda3: /usr, sda4: primary partition for holding extended partitions sda5: /var, sda6: encrypted swap, sda7: /home)

Here is my desktop:

  • sdb     1943222
  • sdb1   1491162
  • sdb2         7504
  • sdb3     444556
  • sdd     6271384
  • sdd10 6271384

sdb1: /, sdb2: swap, sdb3: /home, sdd10: video recorder on a rotating disk.

Finally, the raspberry π:

  • mmcblk0     3468760
  • mmcblk0p2   564704
  • mmcblk0p3 2904056

p1: boot (not mounted), p2 /, p3 swap.

The laptop has been on for under 3 hours (type: uptime). The desktop is low power and silent, so it has been on for a week. Long enough to build some numbers. The π has been on for 75 days (Most of the disk write activity is on NFS mounts, so it does not show up on the π's statistics.)

The laptop has plenty of ram, so no reason to swap. The desktop has to run multiple concurrent GUI's for different users and I use tmpfs so it actually wrote 3.6MB to the swap partition over the course of a week. The π has 256MB of ram (192MB after the graphics buffer has been allocated), so it actually uses its swap space. Also it only has 8GB of SSD. 1.3GB of writes to swap in 75 days. If we assume an enormous write amplification factor of 10, and only 10000 erases per block then the swap partition will destroy the SSD in just over 1000 years.

The laptop and desktop have 60GB SSD's, so wear levelling spreads the smaller amount of swap writes over more sectors. The swap space on the desktop will destroy the SSD in about 300,000 years.

Why are you disabling swap?

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )