28 December 2019

GPT/EFIハードディスクのクローンコピー(Lenovo ThinkCentre M720qのHDDをSSDに換装)

2019年8月末に購入したLenovo ThinkCentre M720qのハードディスクをSSDに交換した。

Amazon.co.jpで12月初旬に購入したCFD販売 CSSD-S6B960CG3VX (CG3VXシリーズ 960GB) 9,295円を利用した。

RAMと同じく、SSDの価格も下落を続けていて、1TBが1万円を切る段階までやってきている。

20191228-ssdprice.jpg

交換前ハードディスクの情報

交換前ハードディスク ST1000LM049 1.0TBのhdparam
$ sudo hdparm -I /dev/sda
 
/dev/sda:
 
ATA device, with non-removable media
	Model Number:       ST1000LM049-2GH172                      
	Serial Number:      WN905KH5
	Firmware Revision:  LXM3    
	Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
	Used: unknown (minor revision code 0x001f) 
	Supported: 10 9 8 7 6 5 
	Likely used: 10
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		15	16
	sectors/track	63	63
	--
	CHS current addressable sectors:    16514064
	LBA    user addressable sectors:   268435455
	LBA48  user addressable sectors:  1953525168
	Logical  Sector size:                   512 bytes
	Physical Sector size:                  4096 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:      953869 MBytes
	device size with M = 1000*1000:     1000204 MBytes (1000 GB)
	cache/buffer size  = unknown
	Form Factor: 2.5 inch
	Nominal Media Rotation Rate: 7200
Capabilities:
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, no device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 16
	Advanced power management level: 254
	Recommended acoustic management value: 254, current value: 0
	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	DOWNLOAD_MICROCODE
	   *	Advanced Power Management feature set
	    	SET_MAX security extension
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	FLUSH_CACHE_EXT
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	WRITE_{DMA|MULTIPLE}_FUA_EXT
	   *	64-bit World wide name
	   *	IDLE_IMMEDIATE with UNLOAD
	   *	Write-Read-Verify feature set
	   *	WRITE_UNCORRECTABLE_EXT command
	   *	{READ,WRITE}_DMA_EXT_GPL commands
	   *	Segmented DOWNLOAD_MICROCODE
	   *	Gen1 signaling speed (1.5Gb/s)
	   *	Gen2 signaling speed (3.0Gb/s)
	   *	Gen3 signaling speed (6.0Gb/s)
	   *	Native Command Queueing (NCQ)
	   *	Phy event counters
	   *	Idle-Unload when NCQ is active
	   *	READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
	   *	DMA Setup Auto-Activate optimization
	    	Device-initiated interface power management
	   *	Software settings preservation
	   *	SMART Command Transport (SCT) feature set
	   *	SCT Write Same (AC2)
	   *	SCT Features Control (AC4)
	   *	SCT Data Tables (AC5)
	    	unknown 206[12] (vendor specific)
	    	unknown 206[13] (vendor specific)
	   *	DOWNLOAD MICROCODE DMA command
	   *	Data Set Management TRIM supported (limit 8 blocks)
Security: 
	Master password revision code = 65534
		supported
	not	enabled
	not	locked
		frozen
	not	expired: security count
		supported: enhanced erase
	122min for SECURITY ERASE UNIT. 122min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000c500c1054916
	NAA		: 5
	IEEE OUI	: 000c50
	Unique ID	: 0c1054916
Checksum: correct
交換前ハードディスク ST1000LM049 1.0TBのsmartctl
$ sudo smartctl -x /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-5.0.0-37-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
 
=== START OF INFORMATION SECTION ===
Device Model:     ST1000LM049-2GH172
Serial Number:    WN905KH5
LU WWN Device Id: 5 000c50 0c1054916
Firmware Version: LXM3
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 T13/2161-D revision 3b
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Sat Dec 28 12:27:26 2019 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is:   Unavailable
APM level is:     254 (maximum performance)
Rd look-ahead is: Enabled
Write cache is:   Enabled
ATA Security is:  Disabled, frozen [SEC2]
Wt Cache Reorder: Enabled
 
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
 
General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		(    0) seconds.
Offline data collection
capabilities: 			 (0x71) SMART execute Offline immediate.
					No Auto Offline data collection support.
					Suspend Offline collection upon new
					command.
					No Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   1) minutes.
Extended self-test routine
recommended polling time: 	 ( 120) minutes.
Conveyance self-test routine
recommended polling time: 	 (   2) minutes.
SCT capabilities: 	       (0x3035)	SCT Status supported.
					SCT Feature Control supported.
					SCT Data Table supported.
 
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
  1 Raw_Read_Error_Rate     POSR--   083   064   034    -    182210919
  3 Spin_Up_Time            PO----   099   099   000    -    0
  4 Start_Stop_Count        -O--CK   100   100   020    -    582
  5 Reallocated_Sector_Ct   PO--CK   100   100   036    -    0
  7 Seek_Error_Rate         POSR--   079   060   045    -    74751901
  9 Power_On_Hours          -O--CK   100   100   000    -    494 (13 114 0)
 10 Spin_Retry_Count        PO--C-   100   100   097    -    0
 12 Power_Cycle_Count       -O--CK   100   100   020    -    516
184 End-to-End_Error        -O--CK   100   100   099    -    0
187 Reported_Uncorrect      -O--CK   100   100   000    -    0
188 Command_Timeout         -O--CK   100   100   000    -    0
189 High_Fly_Writes         -O-RCK   100   100   000    -    0
190 Airflow_Temperature_Cel -O---K   073   046   040    -    27 (Min/Max 15/27)
191 G-Sense_Error_Rate      -O--CK   100   100   000    -    0
192 Power-Off_Retract_Count -O--CK   100   100   000    -    17
193 Load_Cycle_Count        -O--CK   100   100   000    -    1193
194 Temperature_Celsius     -O---K   027   054   000    -    27 (0 14 0 0 0)
196 Reallocated_Event_Count -O--CK   100   100   000    -    0
197 Current_Pending_Sector  -O--C-   100   100   000    -    0
198 Offline_Uncorrectable   ----C-   100   100   000    -    0
199 UDMA_CRC_Error_Count    -OSRCK   200   200   000    -    0
240 Head_Flying_Hours       POSR--   100   100   030    -    491 (250 211 0)
254 Free_Fall_Sensor        -O--CK   100   100   000    -    0
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning
 
General Purpose Log Directory Version 1
SMART           Log Directory Version 1 [multi-sector log support]
Address    Access  R/W   Size  Description
0x00       GPL,SL  R/O      1  Log Directory
0x01           SL  R/O      1  Summary SMART error log
0x02           SL  R/O      5  Comprehensive SMART error log
0x03       GPL     R/O      5  Ext. Comprehensive SMART error log
0x04       GPL,SL  R/O      8  Device Statistics log
0x06           SL  R/O      1  SMART self-test log
0x07       GPL     R/O      1  Extended self-test log
0x09           SL  R/W      1  Selective self-test log
0x10       GPL     R/O      1  SATA NCQ Queued Error log
0x11       GPL     R/O      1  SATA Phy Event Counters log
0x21       GPL     R/O      1  Write stream error log
0x22       GPL     R/O      1  Read stream error log
0x24       GPL     R/O    512  Current Device Internal Status Data log
0x30       GPL,SL  R/O      9  IDENTIFY DEVICE data log
0x80-0x9f  GPL,SL  R/W     16  Host vendor specific log
0xa1       GPL,SL  VS      24  Device vendor specific log
0xa2       GPL     VS    8160  Device vendor specific log
0xa8       GPL,SL  VS     136  Device vendor specific log
0xa9       GPL,SL  VS       1  Device vendor specific log
0xab       GPL     VS       1  Device vendor specific log
0xb0       GPL     VS    8920  Device vendor specific log
0xbe-0xbf  GPL     VS   65535  Device vendor specific log
0xc0       GPL,SL  VS       1  Device vendor specific log
0xc1       GPL,SL  VS      16  Device vendor specific log
0xc2       GPL,SL  VS     240  Device vendor specific log
0xc3       GPL,SL  VS       8  Device vendor specific log
0xc4       GPL,SL  VS      24  Device vendor specific log
0xc9       GPL,SL  VS       1  Device vendor specific log
0xca       GPL,SL  VS      16  Device vendor specific log
0xd3       GPL     VS    1920  Device vendor specific log
0xdf       GPL,SL  VS       1  Device vendor specific log
0xe0       GPL,SL  R/W      1  SCT Command/Status
0xe1       GPL,SL  R/W      1  SCT Data Transfer
 
SMART Extended Comprehensive Error Log Version: 1 (5 sectors)
No Errors Logged
 
SMART Extended Self-test Log Version: 1 (1 sectors)
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%       354         -
# 2  Short offline       Completed without error       00%       120         -
# 3  Vendor (0x50)       Completed without error       00%         0         -
 
SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
 
SCT Status Version:                  3
SCT Version (vendor specific):       522 (0x020a)
SCT Support Level:                   1
Device State:                        Active (0)
Current Temperature:                    27 Celsius
Power Cycle Min/Max Temperature:     15/27 Celsius
Lifetime    Min/Max Temperature:     14/54 Celsius
Under/Over Temperature Limit Count:   0/2
Vendor specific:
00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 
SCT Temperature History Version:     2
Temperature Sampling Period:         1 minute
Temperature Logging Interval:        11 minutes
Min/Max recommended Temperature:      0/ 0 Celsius
Min/Max Temperature Limit:            0/ 0 Celsius
Temperature History Size (Index):    128 (117)
 
Index    Estimated Time   Temperature Celsius
 118    2019-12-27 13:10     ?  -
 119    2019-12-27 13:21    18  -
 120    2019-12-27 13:32     ?  -
 121    2019-12-27 13:43    17  -
 122    2019-12-27 13:54    29  **********
 123    2019-12-27 14:05    31  ************
 124    2019-12-27 14:16    31  ************
 125    2019-12-27 14:27     ?  -
 126    2019-12-27 14:38    19  -
 127    2019-12-27 14:49    30  ***********
   0    2019-12-27 15:00    33  **************
   1    2019-12-27 15:11    33  **************
   2    2019-12-27 15:22     ?  -
   3    2019-12-27 15:33    19  -
   4    2019-12-27 15:44    28  *********
   5    2019-12-27 15:55    31  ************
   6    2019-12-27 16:06    33  **************
   7    2019-12-27 16:17    34  ***************
   8    2019-12-27 16:28     ?  -
   9    2019-12-27 16:39    15  -
  10    2019-12-27 16:50    29  **********
  11    2019-12-27 17:01    30  ***********
  12    2019-12-27 17:12     ?  -
  13    2019-12-27 17:23    16  -
  14    2019-12-27 17:34    29  **********
  15    2019-12-27 17:45    31  ************
  16    2019-12-27 17:56    31  ************
  17    2019-12-27 18:07    32  *************
  18    2019-12-27 18:18    33  **************
  19    2019-12-27 18:29     ?  -
  20    2019-12-27 18:40    15  -
  21    2019-12-27 18:51    28  *********
  22    2019-12-27 19:02    29  **********
  23    2019-12-27 19:13     ?  -
  24    2019-12-27 19:24    18  -
  25    2019-12-27 19:35    29  **********
  26    2019-12-27 19:46    30  ***********
  27    2019-12-27 19:57    31  ************
  28    2019-12-27 20:08    32  *************
  29    2019-12-27 20:19    33  **************
  30    2019-12-27 20:30    34  ***************
  31    2019-12-27 20:41    33  **************
  32    2019-12-27 20:52    34  ***************
  33    2019-12-27 21:03    33  **************
  34    2019-12-27 21:14    34  ***************
  35    2019-12-27 21:25     ?  -
  36    2019-12-27 21:36    15  -
  37    2019-12-27 21:47    29  **********
  38    2019-12-27 21:58    32  *************
  39    2019-12-27 22:09    32  *************
  40    2019-12-27 22:20     ?  -
  41    2019-12-27 22:31    16  -
  42    2019-12-27 22:42    30  ***********
  43    2019-12-27 22:53    33  **************
  44    2019-12-27 23:04    32  *************
  45    2019-12-27 23:15    33  **************
  46    2019-12-27 23:26    34  ***************
  47    2019-12-27 23:37    35  ****************
  48    2019-12-27 23:48    36  *****************
  49    2019-12-27 23:59    34  ***************
  50    2019-12-28 00:10    33  **************
  51    2019-12-28 00:21     ?  -
  52    2019-12-28 00:32    15  -
  53    2019-12-28 00:43    26  *******
  54    2019-12-28 00:54    30  ***********
  55    2019-12-28 01:05    31  ************
  56    2019-12-28 01:16    32  *************
  57    2019-12-28 01:27    32  *************
  58    2019-12-28 01:38    36  *****************
 ...    ..(  3 skipped).    ..  *****************
  62    2019-12-28 02:22    36  *****************
  63    2019-12-28 02:33    35  ****************
  64    2019-12-28 02:44    37  ******************
  65    2019-12-28 02:55     ?  -
  66    2019-12-28 03:06    17  -
  67    2019-12-28 03:17     ?  -
  68    2019-12-28 03:28    17  -
  69    2019-12-28 03:39     ?  -
  70    2019-12-28 03:50    19  -
  71    2019-12-28 04:01    31  ************
  72    2019-12-28 04:12    32  *************
  73    2019-12-28 04:23     ?  -
  74    2019-12-28 04:34    20  *
  75    2019-12-28 04:45    28  *********
  76    2019-12-28 04:56    31  ************
  77    2019-12-28 05:07    32  *************
  78    2019-12-28 05:18    32  *************
  79    2019-12-28 05:29     ?  -
  80    2019-12-28 05:40    33  **************
  81    2019-12-28 05:51    33  **************
  82    2019-12-28 06:02    32  *************
  83    2019-12-28 06:13    32  *************
  84    2019-12-28 06:24    34  ***************
  85    2019-12-28 06:35    32  *************
  86    2019-12-28 06:46    34  ***************
  87    2019-12-28 06:57    33  **************
  88    2019-12-28 07:08    32  *************
  89    2019-12-28 07:19    32  *************
  90    2019-12-28 07:30    30  ***********
  91    2019-12-28 07:41    29  **********
  92    2019-12-28 07:52    29  **********
  93    2019-12-28 08:03     ?  -
  94    2019-12-28 08:14    19  -
  95    2019-12-28 08:25    31  ************
  96    2019-12-28 08:36    31  ************
  97    2019-12-28 08:47    31  ************
  98    2019-12-28 08:58    32  *************
 ...    ..(  3 skipped).    ..  *************
 102    2019-12-28 09:42    32  *************
 103    2019-12-28 09:53     ?  -
 104    2019-12-28 10:04    19  -
 105    2019-12-28 10:15     ?  -
 106    2019-12-28 10:26    22  ***
 107    2019-12-28 10:37    30  ***********
 108    2019-12-28 10:48    29  **********
 109    2019-12-28 10:59    30  ***********
 110    2019-12-28 11:10    33  **************
 111    2019-12-28 11:21    34  ***************
 112    2019-12-28 11:32     ?  -
 113    2019-12-28 11:43    16  -
 114    2019-12-28 11:54    28  *********
 115    2019-12-28 12:05     ?  -
 116    2019-12-28 12:16    15  -
 117    2019-12-28 12:27    27  ********
 
SCT Error Recovery Control command not supported
 
Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             516  ---  Lifetime Power-On Resets
0x01  0x010  4             494  ---  Power-on Hours
0x01  0x018  6      2422075791  ---  Logical Sectors Written
0x01  0x020  6        16921802  ---  Number of Write Commands
0x01  0x028  6      2399576937  ---  Logical Sectors Read
0x01  0x030  6        30059011  ---  Number of Read Commands
0x01  0x038  6               -  ---  Date and Time TimeStamp
0x03  =====  =               =  ===  == Rotating Media Statistics (rev 1) ==
0x03  0x008  4             494  ---  Spindle Motor Power-on Hours
0x03  0x010  4             491  ---  Head Flying Hours
0x03  0x018  4            1193  ---  Head Load Events
0x03  0x020  4               0  ---  Number of Reallocated Logical Sectors
0x03  0x028  4               0  ---  Read Recovery Attempts
0x03  0x030  4               0  ---  Number of Mechanical Start Failures
0x03  0x038  4               0  ---  Number of Realloc. Candidate Logical Sectors
0x04  =====  =               =  ===  == General Errors Statistics (rev 1) ==
0x04  0x008  4               0  ---  Number of Reported Uncorrectable Errors
0x04  0x010  4               0  ---  Resets Between Cmd Acceptance and Completion
                                |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value
 
SATA Phy Event Counters (GP Log 0x11)
ID      Size     Value  Description
0x000a  2            3  Device-to-host register FISes sent due to a COMRESET
0x0001  2            0  Command failed due to ICRC error
0x0003  2            0  R_ERR response for device-to-host data FIS
0x0004  2            0  R_ERR response for host-to-device data FIS
0x0006  2            0  R_ERR response for device-to-host non-data FIS
0x0007  2            0  R_ERR response for host-to-device non-data FIS

交換後SSDの情報

交換後SSD CSSD-S6B960CG3VX 960GBのhdparam
$ sudo hdparm -I /dev/sdb
 
/dev/sdb:
 
ATA device, with non-removable media
	Model Number:       CSSD-S6B960CG3VX                        
	Serial Number:      83260797180800569533
	Firmware Revision:  SBFM61.3
	Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
	Supported: 11 10 9 8 7 6 5 
	Likely used: 11
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	--
	CHS current addressable sectors:    16514064
	LBA    user addressable sectors:   268435455
	LBA48  user addressable sectors:  1875385008
	Logical  Sector size:                   512 bytes
	Physical Sector size:                   512 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:      915715 MBytes
	device size with M = 1000*1000:      960197 MBytes (960 GB)
	cache/buffer size  = unknown
	Form Factor: 2.5 inch
	Nominal Media Rotation Rate: Solid State Device
Capabilities:
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, no device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 16
	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	NOP cmd
	   *	DOWNLOAD_MICROCODE
	    	SET_MAX security extension
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	FLUSH_CACHE_EXT
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	WRITE_{DMA|MULTIPLE}_FUA_EXT
	   *	WRITE_UNCORRECTABLE_EXT command
	   *	{READ,WRITE}_DMA_EXT_GPL commands
	   *	Segmented DOWNLOAD_MICROCODE
	   *	Gen1 signaling speed (1.5Gb/s)
	   *	Gen2 signaling speed (3.0Gb/s)
	   *	Gen3 signaling speed (6.0Gb/s)
	   *	Native Command Queueing (NCQ)
	   *	Phy event counters
	   *	READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
	    	DMA Setup Auto-Activate optimization
	    	Device-initiated interface power management
	   *	Software settings preservation
	   *	DOWNLOAD MICROCODE DMA command
	   *	SET MAX SETPASSWORD/UNLOCK DMA commands
	   *	WRITE BUFFER DMA command
	   *	READ BUFFER DMA command
	   *	DEVICE CONFIGURATION SET/IDENTIFY DMA commands
	   *	Data Set Management TRIM supported (limit 8 blocks)
Security: 
	Master password revision code = 65534
		supported
	not	enabled
	not	locked
	not	frozen
	not	expired: security count
		supported: enhanced erase
	20min for SECURITY ERASE UNIT. 60min for ENHANCED SECURITY ERASE UNIT.
Checksum: correct
交換後SSD CSSD-S6B960CG3VX 960GBのsmartctl
$ sudo smartctl -x /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-5.0.0-37-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
 
=== START OF INFORMATION SECTION ===
Device Model:     CSSD-S6B960CG3VX
Serial Number:    83260797180800569533
Firmware Version: SBFM61.3
User Capacity:    960,197,124,096 bytes [960 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   Unknown(0x0ff8) (minor revision not indicated)
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 1.5 Gb/s)
Local Time is:    Sat Dec 28 12:27:03 2019 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is:   Unavailable
APM feature is:   Unavailable
Rd look-ahead is: Enabled
Write cache is:   Enabled
ATA Security is:  Disabled, NOT FROZEN [SEC1]
Wt Cache Reorder: Unavailable
 
=== START OF READ SMART DATA SECTION ===
SMART Status not supported: Incomplete response, ATA output registers missing
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.
 
General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		(65535) seconds.
Offline data collection
capabilities: 			 (0x79) SMART execute Offline immediate.
					No Auto Offline data collection support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 (  30) minutes.
Conveyance self-test routine
recommended polling time: 	 (   6) minutes.
 
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
  1 Raw_Read_Error_Rate     PO-R--   100   100   050    -    0
  9 Power_On_Hours          -O--C-   100   100   000    -    0
 12 Power_Cycle_Count       -O--C-   100   100   000    -    11
168 Unknown_Attribute       -O--C-   100   100   000    -    0
170 Unknown_Attribute       PO----   100   100   010    -    1126
173 Unknown_Attribute       -O--C-   100   100   000    -    1
192 Power-Off_Retract_Count -O--C-   100   100   000    -    7
194 Temperature_Celsius     PO---K   067   067   000    -    33 (Min/Max 33/33)
218 Unknown_Attribute       PO-R--   100   100   050    -    0
231 Temperature_Celsius     PO--C-   100   100   000    -    100
241 Total_LBAs_Written      -O--C-   100   100   000    -    2
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning
 
General Purpose Log Directory Version 1
SMART           Log Directory Version 1 [multi-sector log support]
Address    Access  R/W   Size  Description
0x00       GPL,SL  R/O      1  Log Directory
0x01           SL  R/O      1  Summary SMART error log
0x02           SL  R/O     51  Comprehensive SMART error log
0x03       GPL     R/O     64  Ext. Comprehensive SMART error log
0x04       GPL,SL  R/O      8  Device Statistics log
0x06           SL  R/O      1  SMART self-test log
0x07       GPL     R/O      1  Extended self-test log
0x09           SL  R/W      1  Selective self-test log
0x10       GPL     R/O      1  SATA NCQ Queued Error log
0x11       GPL     R/O      1  SATA Phy Event Counters log
0x30       GPL,SL  R/O      9  IDENTIFY DEVICE data log
0x80-0x9f  GPL,SL  R/W     16  Host vendor specific log
 
SMART Extended Comprehensive Error Log Version: 1 (64 sectors)
No Errors Logged
 
SMART Extended Self-test Log Version: 1 (1 sectors)
No self-tests have been logged.  [To run self-tests, use: smartctl -t]
 
SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
 
SCT Commands not supported
 
Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4              11  ---  Lifetime Power-On Resets
0x01  0x010  4               0  ---  Power-on Hours
0x01  0x018  6         4245504  ---  Logical Sectors Written
0x01  0x028  6         2146810  ---  Logical Sectors Read
0x04  =====  =               =  ===  == General Errors Statistics (rev 1) ==
0x04  0x008  4               0  ---  Number of Reported Uncorrectable Errors
0x05  =====  =               =  ===  == Temperature Statistics (rev 1) ==
0x05  0x008  1              33  ---  Current Temperature
0x05  0x020  1              33  ---  Highest Temperature
0x05  0x028  1              33  ---  Lowest Temperature
0x06  =====  =               =  ===  == Transport Statistics (rev 1) ==
0x06  0x008  4              10  ---  Number of Hardware Resets
0x06  0x018  4               0  ---  Number of Interface CRC Errors
0x07  =====  =               =  ===  == Solid State Device Statistics (rev 1) ==
0x07  0x008  1               0  ---  Percentage Used Endurance Indicator
                                |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value
 
SATA Phy Event Counters (GP Log 0x11)
ID      Size     Value  Description
0x0001  2            0  Command failed due to ICRC error
0x0003  2            0  R_ERR response for device-to-host data FIS
0x0004  2            0  R_ERR response for host-to-device data FIS
0x0006  2            0  R_ERR response for device-to-host non-data FIS
0x0007  2            0  R_ERR response for host-to-device non-data FIS
0x0008  2            0  Device-to-host non-data FIS retries
0x0009  4            3  Transition from drive PhyRdy to drive PhyNRdy
0x000a  4            4  Device-to-host register FISes sent due to a COMRESET
0x000f  2            0  R_ERR response for host-to-device data FIS, CRC
0x0010  2            0  R_ERR response for host-to-device data FIS, non-CRC
0x0012  2            0  R_ERR response for host-to-device non-data FIS, CRC
0x0013  2            0  R_ERR response for host-to-device non-data FIS, non-CRC

TRIMコマンドに対応しているのを示している部分を赤で着色した。なお、交換前のHDDもTRIMコマンドをサポートしていたので、システム側から見れば交換前後で何ら変わらないことになる。

コピー前のパーティション情報

$ sudo parted --list all
モデル: TOSHIBA TransMemory (scsi)
ディスク /dev/sda: 15.5GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: loop
ディスクフラグ: 
 
番号  開始   終了    サイズ  ファイルシステム  フラグ
 1    0.00B  15.5GB  15.5GB  fat32
 
モデル: ATA ST1000LM049-2GH1 (scsi)
ディスク /dev/sdb: 1000GB
セクタサイズ (論理/物理): 512B/4096B
パーティションテーブル: gpt
ディスクフラグ: 
 
番号  開始    終了    サイズ  ファイルシステム  名前                  フラグ
 1    1049kB  274MB   273MB   fat32             EF                    boot, hidden, esp
 2    274MB   290MB   16.8MB                    Mi                    msftres
 3    290MB   86.2GB  85.9GB  ntfs                                    msftdata
 4    86.2GB  87.2GB  1043MB  ntfs                                    msftdata
 5    87.2GB  95.8GB  8590MB  linux-swap(v1)    Basic data partition  msftdata
 6    95.8GB  139GB   42.9GB  ext4              Basic data partition  msftdata
 7    139GB   182GB   42.9GB                    Basic data partition  msftdata
 8    182GB   225GB   42.9GB                    Basic data partition  msftdata
 9    225GB   246GB   21.5GB  ntfs              Basic data partition  msftdata
10    246GB   493GB   247GB   ntfs              Basic data partition  msftdata
11    493GB   740GB   247GB   ntfs              Basic data partition  msftdata
12    740GB   959GB   219GB   ext4              Basic data partition
 
エラー: /dev/sdb: ディスクラベルが認識できません。
モデル: Innostor Ext. HDD (scsi)                                          
ディスク /dev/sdb: 960GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: unknown
ディスクフラグ: 

交換前の末尾パーティションを縮小

hdparamから得た情報では、交換前のハードディスクの論理セクタ数が『LBA48 user addressable sectors: 1953525168』で、交換後のSSDの論理セクタ数が『LBA48 user addressable sectors: 1875385008』である。

交換前の最終パーティションを縮小しなければ、dd コマンドでまるごとコピーできない。

交換前ハードディスク ST1000LM049 1.0TBのセクタ単位でのパーティション
$ parted /dev/sda
(parted) unit s                                                       
(parted) print
モデル: ATA ST1000LM049-2GH1 (scsi)
ディスク /dev/sda: 1953525168s
セクタサイズ (論理/物理): 512B/4096B
パーティションテーブル: gpt
ディスクフラグ: 
 
番号  開始         終了         サイズ      ファイルシステム  名前                  フラグ
 1    2048s        534527s      532480s     fat32             EF                    boot, hidden, esp
 2    534528s      567295s      32768s                        Mi                    msftres
 3    567296s      168339455s   167772160s  ntfs                                    msftdata
 4    168339456s   170377215s   2037760s    ntfs                                    msftdata
 5    170377216s   187154431s   16777216s   linux-swap(v1)    Basic data partition  msftdata
 6    187154432s   271040511s   83886080s   ext4              Basic data partition  msftdata
 7    271040512s   354926591s   83886080s                     Basic data partition  msftdata
 8    354926592s   438812671s   83886080s                     Basic data partition  msftdata
 9    438812672s   480755711s   41943040s   ntfs              Basic data partition  msftdata
10    480755712s   963100671s   482344960s  ntfs              Basic data partition  msftdata
11    963100672s   1445445631s  482344960s  ntfs              Basic data partition  msftdata
12    1445445632s  1927790591s  482344960s  ext4              Basic data partition

パーティション12を、現在の容量
230 GBytes (230×1024×1024×1024/512 = 482344960セクタ)を、
新たな容量 204 GBytes (204×1024×1024×1024/512 = 427819008セクタ) に縮小すれば、
末尾のセクタが 1445445632 + 427819008 = 1873264639 になるので、
1873264639 < 1875385008 となって新しいSSDの最大セクタ数内に収まる。

パーティションの縮小
$ resize2fs /dev/sda12 427819008s
Resizing the filesystem on /dev/sda12 to 53477376 (4k) blocks.
Begin pass 3 (max = 1840)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/sda12 is now 53477376 (4k) blocks long.
$ parted /dev/sda
(parted) unit s
(parted) resizepart 12 427819008s

resize2fsのメッセージで『53477376 (4k) blocks』は、4K/512B=8 より 53477376 block × 8 = 427819008 sector と指定したセクタ数となっているのが確認できる。

パーティションの縮小は、コマンドラインでの入力に不安がある場合は、gparted のGUIを使うほうが簡単かもしれない。(ただし、セクタ単位での指定が出来ず、縮小後のパーティションサイズをちゃんと計算して「204G」と指定するのがコツ)

新しいディスクのGPTパーティションテーブルを作成

あまり意味ないかもしれないが、念の為、未フォーマットの新しいSSDにGPTパーティションテーブルでの初期化を掛けておく。

$ sudo parted /dev/sdb
GNU Parted 3.2
/dev/sdb を使用
GNU Parted へようこそ! コマンド一覧を見るには 'help' と入力してください。
(parted) mklabel                                                          
新しいディスクラベル? gpt                                                 
警告: いま存在している /dev/sdb のディスクラベルは破壊され、このディスクの全データが失われます。続行しますか?
はい(Y)/Yes/いいえ(N)/No? y                                               
(parted) quit                                                             
通知: 必要であれば /etc/fstab を更新するのを忘れないようにしてください。
 
$ sudo partprobe /dev/sdb                   
$ sudo parted --list all
モデル: ATA ST1000LM049-2GH1 (scsi)
ディスク /dev/sda: 1000GB
セクタサイズ (論理/物理): 512B/4096B
パーティションテーブル: gpt
ディスクフラグ: 
 
番号  開始    終了    サイズ  ファイルシステム  名前                  フラグ
 1    1049kB  274MB   273MB   fat32             EF                    boot, hidden, esp
 2    274MB   290MB   16.8MB                    Mi                    msftres
 3    290MB   86.2GB  85.9GB  ntfs                                    msftdata
 4    86.2GB  87.2GB  1043MB  ntfs                                    msftdata
 5    87.2GB  95.8GB  8590MB  linux-swap(v1)    Basic data partition  msftdata
 6    95.8GB  139GB   42.9GB  ext4              Basic data partition  msftdata
 7    139GB   182GB   42.9GB                    Basic data partition  msftdata
 8    182GB   225GB   42.9GB                    Basic data partition  msftdata
 9    225GB   246GB   21.5GB  ntfs              Basic data partition  msftdata
10    246GB   493GB   247GB   ntfs              Basic data partition  msftdata
11    493GB   740GB   247GB   ntfs              Basic data partition  msftdata
12    740GB   959GB   219GB   ext4              Basic data partition
 
モデル: Innostor Ext. HDD (scsi)
ディスク /dev/sdb: 960GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: gpt
ディスクフラグ: 
 
番号  開始  終了  サイズ  ファイルシステム  名前  フラグ

UbuntuライブDVD(USBメモリー)でコンピューターを起動

USBメモリーが/dev/sdaとして認識されるため、ここから先は/dev/sdbが交換前ハードディスク、/dev/sdcが交換後SSDに割り付けられている。

ddコマンドによるディスク全体のコピー(クローン)

$ sudo dd if=/dev/sdb of=/dev/sdc bs=1M conv=noerror,sync status=progress
960165314560 bytes (960 GB, 894 GiB) copied, 10433 s, 92.0 MB/s
dd: '/dev/sdc' の書き込みエラー: デバイスに空き領域がありません
915716+0 レコード入力
915715+0 レコード出力
960197124096 bytes (960 GB, 894 GiB) copied, 10455.9 s, 91.8 MB/s

コピー(クローン)後にGPTパーティションが認識できないのを修正

$ sudo parted --list all
モデル: TOSHIBA TransMemory (scsi)
ディスク /dev/sda: 15.5GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: loop
ディスクフラグ: 
 
番号  開始   終了    サイズ  ファイルシステム  フラグ
 1    0.00B  15.5GB  15.5GB  fat32
 
モデル: ATA ST1000LM049-2GH1 (scsi)
ディスク /dev/sdb: 1000GB
セクタサイズ (論理/物理): 512B/4096B
パーティションテーブル: gpt
ディスクフラグ: 
 
番号  開始    終了    サイズ  ファイルシステム  名前                  フラグ
 1    1049kB  274MB   273MB   fat32             EF                    boot, hidden, esp
 2    274MB   290MB   16.8MB                    Mi                    msftres
 3    290MB   86.2GB  85.9GB  ntfs                                    msftdata
 4    86.2GB  87.2GB  1043MB  ntfs                                    msftdata
 5    87.2GB  95.8GB  8590MB  linux-swap(v1)    Basic data partition  msftdata
 6    95.8GB  139GB   42.9GB  ext4              Basic data partition  msftdata
 7    139GB   182GB   42.9GB                    Basic data partition  msftdata
 8    182GB   225GB   42.9GB                    Basic data partition  msftdata
 9    225GB   246GB   21.5GB  ntfs              Basic data partition  msftdata
10    246GB   493GB   247GB   ntfs              Basic data partition  msftdata
11    493GB   740GB   247GB   ntfs              Basic data partition  msftdata
12    740GB   959GB   219GB   ext4              Basic data partition
 
エラー: 無効な引数です: /dev/sdc から読み込み中のシークでエラーが発生しました。
やりなおし(R)/Retry/無視(I)/Ignore/取消(C)/Cancel? c                      
モデル: Innostor Ext. HDD (scsi)
ディスク /dev/sdc: 960GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: unknown
ディスクフラグ: 

元のディスクから、新しいディスクにパーティション構造をコピーする

$ sudo sgdisk --backup=sdb-table.dat /dev/sdb
The operation has completed successfully.
 
$ sudo sgdisk --load-backup=sdb-table.dat /dev/sdc
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
 
Warning! One or more CRCs don't match. You should repair the disk!
 
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Warning! Current disk size doesn't match that of the backup!
Adjusting sizes to match, but subsequent problems are possible!
The operation has completed successfully.

この方法以外にも、gdiskコマンドを用いてGPTパーティションテーブルを復旧する方法もある。

Ubuntu 18.04でのSSDとしての設定

ドライブがSSDとして認識されているか確認

$ cat /sys/block/sda/queue/rotational
0

IOスケジューラが 最も推奨される none となっていることを確認 ([ ... ] で囲まれているモードが有効)。

選択肢としては「Deadline」「CFQ」「Noop(何もしない)」と、それぞれをマルチスレッドに対応させた「MQ Deadline」「BFQ」がある。

$ cat /sys/block/sda/queue/scheduler 
[mq-deadline] none

残念ながら、HDDの時の標準設定のMQ Deadlineのままだが、

“It is worth noting that there is little difference in throughput between the mq-deadline/none/bfq I/O schedulers when using fast multi-queue SSD configurations or fast NVME devices. In these cases it may be preferable to use the 'none' I/O scheduler to reduce CPU overhead. ” (Ubuntu wiki : IOSchedulers

ということなので、わざわざ変更する必要もないか…

次に、TRIMコマンドが自動的に実行されるかの確認をする

fstrim.timer サービスが有効であることを確認 (赤で着色した部分が enable)

$ sudo systemctl list-unit-files | grep trim
fstrim.service                                                   static         
fstrim.timer                                                     enabled 

タイマーの間隔を確認 (赤で着色した部分で、1週間毎にタイマーが起動される設定。タイマーの残存時間は、SSDの交換日が2日前だったので、タイマー5日残りは正常に動いている証拠)

$ sudo systemctl status fstrim
● fstrim.service - Discard unused blocks
   Loaded: loaded (/lib/systemd/system/fstrim.service; static; vendor preset: enabled)
   Active: inactive (dead)
 
$ sudo systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
   Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Tue 2019-12-31 12:33:40 JST; 33min ago
  Trigger: Mon 2020-01-06 00:00:00 JST; 5 days left
     Docs: man:fstrim
 
12月 31 12:33:40 M720q-Ubuntu1804 systemd[1]: Started Discard unused blocks once a week.

また、この1週間の設定がされている設定ファイルは

/etc/systemd/system/timers.target.wants/fstrim.timer
[Unit]
Description=Discard unused blocks once a week
Documentation=man:fstrim
ConditionVirtualization=!container
 
[Timer]
OnCalendar=weekly
AccuracySec=1h
Persistent=true
 
[Install]
WantedBy=timers.target

実行されたログの確認は、次のコマンドで出るのだが…

$ sudo journalctl -u fstrim
-- Logs begin at Tue 2019-12-31 12:33:38 JST, end at Tue 2019-12-31 13:17:57 JST. --
-- No entries --

/var/tmp と /tmp を ramdisk (tmpfs)に置いているので、仮に記録がそこに残るとすれば設定を見直さなければ… (1週間待って様子を確認する)

1週間後の確認 (/var/log/syslogをチェック)

/var/log/syslog
Jan  6 07:27:22 M720q-Ubuntu1804 systemd[1]: Started PackageKit Daemon.
Jan  6 07:27:22 M720q-Ubuntu1804 gnome-session[1115]: gnome-session-binary[1115]: WARNING: App 'spice-vdagent.desktop' exited with code 1
Jan  6 07:27:22 M720q-Ubuntu1804 gnome-session-binary[1115]: WARNING: App 'spice-vdagent.desktop' exited with code 1
Jan  6 07:27:22 M720q-Ubuntu1804 fstrim[923]: /boot/efi: 221.4 MiB (232161280 バイト) に切り揃えました
Jan  6 07:27:22 M720q-Ubuntu1804 fstrim[923]: /mnt/temp: 5 GiB (5374173184 バイト) に切り揃えました
Jan  6 07:27:22 M720q-Ubuntu1804 fstrim[923]: /: 13.4 GiB (14325870592 バイト) に切り揃えました
Jan  6 07:27:22 M720q-Ubuntu1804 systemd[1]: Started Discard unused blocks.
Jan  6 07:27:22 M720q-Ubuntu1804 bluetoothd[951]: Failed to set mode: Blocked through rfkill (0x12)