Samsung SSD 840 120GBを使い潰す(前編)

概要と目的

以前windowsマシンのシステムディスクとして利用していたSSDが余りました
他の用途は無いが捨て置くのも勿体ないので SSDの書き込み上限を迎えたときの挙動を検証します
前編ではまず準備としてSSDの寿命まで書き込みを行います

現在の状態

  • SMART
[comicsong@comicsong ~]$ sudo smartctl -iA /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-514.6.2.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Samsung based SSDs
Device Model:     Samsung SSD 840 Series
Serial Number:    S14CNEAD312546J
LU WWN Device Id: 5 002538 5502533cd
Firmware Version: DXT07B0Q
User Capacity:    120,034,123,776 bytes [120 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Wed Mar  1 22:25:17 2017 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   096   096   000    Old_age   Always       -       18927
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       36
177 Wear_Leveling_Count     0x0013   094   094   000    Pre-fail  Always       -       64
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   072   059   000    Old_age   Always       -       28
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       17
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       8578427501
  • マウント状態
[comicsong@comicsong ~]$ mount | grep sda
/dev/sda1 on /mnt/benchmark type xfs (rw,relatime,attr2,discard,inode64,noquota)
[comicsong@comicsong ~]$ sudo parted /dev/sda -s unit s p
モデル: ATA Samsung SSD 840 (scsi)
ディスク /dev/sda: 234441648s
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: gpt
ディスクフラグ:

番号  開始   終了        サイズ      ファイルシステム  名前       フラグ
 1    2048s  234440703s  234438656s  xfs               benchmark

事前ベンチマーク

書き込み上限到達後のスコアと比較するため、現時点でのスコアを見ます
テストの設定は以前 M4-CT256M4SSD2 をテストした時と同一です
その時点でのスケジューラによる挙動差も見たいのでスケジューラ毎に確認

e6zout.hatenablog.jp

  Description  : [cfq_read]
  read : io=5274.2MB, bw=539696KB/s, iops=134923, runt= 10007msec
  Description  : [cfq_write]
  write: io=2545.7MB, bw=259042KB/s, iops=64760, runt= 10063msec
  Description  : [cfq_randread]
  read : io=1367.3MB, bw=138808KB/s, iops=34701, runt= 10086msec
  Description  : [cfq_randwrite]
  write: io=2046.4MB, bw=208856KB/s, iops=52213, runt= 10033msec
  Description  : [cfq_rw]
  read : io=1063.8MB, bw=108405KB/s, iops=27101, runt= 10048msec
noop deadline [cfq]
---------------
  Description  : [deadline_read]
  read : io=1937.9MB, bw=198074KB/s, iops=49518, runt= 10018msec
  Description  : [deadline_write]
  write: io=1833.6MB, bw=187324KB/s, iops=46831, runt= 10023msec
  Description  : [deadline_randread]
  read : io=1213.7MB, bw=123122KB/s, iops=30780, runt= 10089msec
  Description  : [deadline_randwrite]
  write: io=2253.2MB, bw=230099KB/s, iops=57524, runt= 10027msec
  Description  : [deadline_rw]
  read : io=903884KB, bw=90262KB/s, iops=22565, runt= 10014msec
noop [deadline] cfq
---------------
  Description  : [noop_read]
  read : io=2610.6MB, bw=267161KB/s, iops=66790, runt= 10006msec
  Description  : [noop_write]
  write: io=1762.8MB, bw=179907KB/s, iops=44976, runt= 10033msec
  Description  : [noop_randread]
  read : io=1187.8MB, bw=112432KB/s, iops=28107, runt= 10818msec
  Description  : [noop_randwrite]
  write: io=2324.2MB, bw=237164KB/s, iops=59290, runt= 10035msec
  Description  : [noop_rw]
  read : io=720968KB, bw=71824KB/s, iops=17955, runt= 10038msec
[noop] deadline cfq
---------------

M4に比べてランダムアクセスが速いですね

消耗させる

消耗は dd コマンドで行います
まずは利用可能なブロックサイズの確認。物理・論理共に512バイトなので512指定で df

[comicsong@comicsong benchmark]$ df --block-size=512 /dev/sda1
ファイルシス   512B-ブロック  使用    使用可 使用% マウント位置
/dev/sda1          234324184 65888 234258296    1% /mnt/benchmark

234258296 ブロック利用可能なようです。直接指定して while ループさせた dd コマンドを実施

[comicsong@comicsong benchmark]$ while (i=0);do sudo dd if=/dev/zero of=/mnt/benchmark/FILE bs=512 count=234258296 ;done

SMARTの書き込み数を確認すると、無事にモリモリと書き込まれているようなのでこのまま放置

[comicsong@comicsong /]$ sudo smartctl -A /dev/sda | grep ^241
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       8638597904
[comicsong@comicsong /]$ sudo smartctl -A /dev/sda | grep ^241
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       8639640384
[comicsong@comicsong /]$ sudo smartctl -A /dev/sda | grep ^241
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       8640746256

次回更新は書き込み上限達成後の予定です。それでは