[kwlug-disc] SMART for SSDs

B.S. bs27975 at yahoo.ca
Fri Jul 31 12:23:29 EDT 2015



>________________________________
> From: Khalid Baheyeldin <kb at 2bits.com>
>To: KWLUG discussion <kwlug-disc at kwlug.org> 
>Sent: Friday, July 31, 2015 10:28 AM
>Subject: Re: [kwlug-disc] SMART for SSDs
> 
>
>
>On Fri, Jul 31, 2015 at 1:38 AM, B.S. <bs27975 at yahoo.ca> wrote:
>
>Be fair ... article notes bug presents itself 'if the system is using linux md raid with raid0 or raid10'.
>>
>>[From bug fix patch: This fixes a data corruption bug when using discard on top of MD linear,
>>raid0 and raid10 personalities.]
>>
>
>

>The point here is that for the longest of time, it was thought that the issue was within the Samsung drive, when it was not. To the extent that drivers block certain drives based on such assumptions.

The point taken from the phrasing of your message, though, is ... THERE'S A KERNEL BUG IN THE SSD CODE ... OMG my drive is about to die!!!!!

Evidently not what you intended, but how I took it ... (-:
>From my reading when I first got my SSD, fstab has "defaults,noatime,nodiratime,discard" (ext4).
>>
>
>

>How long have you been running with this? 

Sorry, I can't remember with any certainty. I want to say 3 years, it's been at least 2, but probably longer. smartctl isn't showing me an in service or manufacturing date.


>And what drive model? 

Model: 2.5" 120GB MLC SSD
SSD P/N: PW120GS25SSDR

# smatctl -i /dev/sda

=== START OF INFORMATION SECTION ===
Device Model:     Patriot Wildfire
Serial Number:    PT...
LU WWN Device Id: 0 000120 000000000
Firmware Version: 319ABBF0
User Capacity:    120,034,123,776 bytes [120 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ACS-2 revision 3
Local Time is:    Fri Jul 31
SMART support is: Available - device has SMART capability.
SMART support is: Enabled



>Does hdparm -I /dev/sdX say it has TRIM support?

# hdparm -I /dev/sda

ATA device, with non-removable media
Model Number:       Patriot Wildfire 
Serial Number:      PT...    
Firmware Revision:  319ABBF0
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 0x0110) 
Supported: 9 8 7 6 5 
Likely used: 9
Configuration:
Logical         max     current
cylinders       16383   16383
heads           16      16
sectors/track   63      63
--
CHS current addressable sectors:   16514064
LBA    user addressable sectors:  234441648
LBA48  user addressable sectors:  234441648
Logical  Sector size:                   512 bytes
Physical Sector size:                   512 bytes
Logical Sector-0 offset:                  0 bytes
device size with M = 1024*1024:      114473 MBytes
device size with M = 1000*1000:      120034 MBytes (120 GB)
cache/buffer size  = unknown
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
Advanced power management level: 254
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
*    Advanced Power Management feature set
Power-Up In Standby feature set
*    SET_FEATURES required to spinup after power up
*    48-bit Address 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)
*    Host-initiated interface power management
*    Phy event counters
*    unknown 76[14]
*    unknown 76[15]
*    DMA Setup Auto-Activate optimization
Device-initiated interface power management
*    Software settings preservation
*    SMART Command Transport (SCT) feature set
*    SCT Data Tables (AC5)
*    DOWNLOAD MICROCODE DMA command
*    SET MAX SETPASSWORD/UNLOCK DMA commands
*    WRITE BUFFER DMA command
*    READ BUFFER DMA command
*    Data Set Management TRIM supported (limit 1 block)
*    Deterministic read data after TRIM
Security: 
Master password revision code = 65534
supported
not     enabled
not     locked
frozen
not     expired: security count
not     supported: enhanced erase
2min for SECURITY ERASE UNIT. 
Logical Unit WWN Device Identifier: 0000120000000000
NAA             : 0
IEEE OUI        : 000120
Unique ID       : 000000000
Checksum: correct



# cat /sys/block/sda/queue/rotational0

>Reading further, now, http://linux.die.net/man/8/mkfs.ext3, looks like discard is the default. (discard feels trim related.) I also see that mkfs defaults come from /etc/mke2fs.conf
>>
>
>

>Actually, "discard" is an option for mount

... and where do you think fs-specific mount options are documented?

...
>This only runs on Intel and Samsung SSDs as some SSDs ...

Yes, as your links note, there is some sensitivity to models, and settings changes made when found. Didn't know that, thank you. Good to know.

>So we are back to this selectivity per vendor thing, in utilities and in kernel drivers.


At least it's not every user. Actually, my point about those in the know more than I (so use defaults) is actually reinforced. They will know faster than I what settings to use, and have them programmed in, long before I'm able to buy the drive retail (probably). Perhaps we should spare ourselves the agony of 2nd guessing them and just stay with the defaults. As you noted, they're already taking steps to trim prudently.

Given Lori's notes about longevity ... 2nd guessing may not bring any noticeable difference for the pain involved. Never mind when you figure out later that you misread it the first time. (It's rare that I say things such as this about 2nd guessing. It has been striking me lately as to just how much 'cruft' is in the average install these days, and I just can't keep up with it all, let alone remember if I applied across all systems. nfs, cross-system consistent passwd and group files to facilitate LDAP is what struck me most recently. <sigh>)

Having said that ... I take your point. Only you know when in a server, how used (SQL, etc.), and so on.

Mind you ... does one typically have to think about such things in a cloud server? Isn't the hardware / uptime / trim / so on their problem that you have no control over?





More information about the kwlug-disc mailing list