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 | # ]
|