Question: I recently installed Linux Mint 18.2 on a brand new PC containing 2 SanDisk SSDs. The installation completed without error.

After setting up all of the software needed on this new PC, I’ve noticed the performance of the disk is absurdly slow — the write speeds in particular. For example, dd is showing about 3.5MB/s on average:

$ dd bs=1M count=256 if=/dev/zero of=test conv=fdatasync256+0 records in256+0 records out268435456 bytes (268 MB, 256 MiB) copied, 61.9192 s, 4.3 MB/s$ dd bs=1M count=256 if=/dev/urandom of=test conv=fdatasync256+0 records in256+0 records out268435456 bytes (268 MB, 256 MiB) copied, 86.7794 s, 3.1 MB/s

I’m not sure where to even begin looking to diagnose or fix this. It is rendering this otherwise very fast PC almost unusable.

The filesystem installed is ext4, and is mounted with options noatime,errors=remount-ro in /etc/fstab.

I’ve tried lowering/disabling Advanced Power Management (hdparm -B 254 /dev/sda) and I’ve also manually run TRIM on the root fs (fstrim /). Neither of these seemed to make any difference.

I’m pretty confident it shouldn’t take 15 sec to copy a 25MiB file onto the same disk and partition as the original file itself:

$ stat test ?File: ‘test’ ?Size: 26214400 ?Blocks: 51200 ?IO Block: 4096 ?regular fileDevice: 801h/2049d ?Inode: 10880436 ?Links: 1Access: (0664/-rw-rw-r–) ?Uid: ( 1000/ ?aps) ?Gid: ( 1000/ ?aps)Access: 2017-10-14 15:48:24.460658106 -0500Modify: 2017-10-14 15:37:22.577357279 -0500Change: 2017-10-14 15:37:22.577357279 -0500 Birth: -$ time -v cp test test.out ?Command being timed: “cp test test.out” ?User time (seconds): 0.03 ?System time (seconds): 0.00 ?Percent of CPU this job got: 0% ?Elapsed (wall clock) time (h:mm:ss or m:ss): 0:14.36 ?Average shared text size (kbytes): 0 ?Average unshared data size (kbytes): 0 ?Average stack size (kbytes): 0 ?Average total size (kbytes): 0 ?Maximum resident set size (kbytes): 2188 ?Average resident set size (kbytes): 0 ?Major (requiring I/O) page faults: 0 ?Minor (reclaiming a frame) page faults: 134 ?Voluntary context switches: 1452 ?Involuntary context switches: 1 ?Swaps: 0 ?File system inputs: 0 ?File system outputs: 51200 ?Socket messages sent: 0 ?Socket messages received: 0 ?Signals delivered: 0 ?Page size (bytes): 4096 ?Exit status: 0

hdparm shows the following details:

$ sudo hdparm -I /dev/sda/dev/sda:ATA device, with non-removable media ?Model Number: ?SanDisk SD8TB8U512G1001 ??Serial Number: ?165125801567 ?Firmware Revision: ?X4133101 ?Media Serial Num: ?Media Manufacturer: ?Transport: ?Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0Standards: ?Used: unknown (minor revision code 0x0110) ?Supported: 9 8 7 6 5 ?Likely used: 9Configuration: ?Logical ?max current ?cylinders 16383 0 ?heads ?16 ?0 ?sectors/track 63 ?0 ?– ?LBA ?user addressable sectors: ?268435455 ?LBA48 ?user addressable sectors: 1000215216 ?Logical ?Sector size: ??512 bytes ?Physical Sector size: ??512 bytes ?Logical Sector-0 offset: ??0 bytes ?device size with M = 1024*1024: ?488386 MBytes ?device size with M = 1000*1000: ?512110 MBytes (512 GB) ?cache/buffer size ?= unknown ?Form Factor: 2.5 inch ?Nominal Media Rotation Rate: Solid State DeviceCapabilities: ?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 = 1 Current = 1 ?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=120nsCommands/features: ?Enabled Supported: ?* ?SMART feature set ?Security Mode feature set ?* ?Power Management feature set ?* ?Write cache ?* ?Look-ahead ?* ?WRITE_BUFFER command ?* ?READ_BUFFER command ?* ?DOWNLOAD_MICROCODE ?* ?Advanced Power Management feature set ?SET_MAX security extension ?* ?48-bit Address feature set ?* ?Mandatory FLUSH_CACHE ?* ?FLUSH_CACHE_EXT ?* ?SMART error logging ?* ?SMART self-test ?* ?General Purpose Logging feature set ?* ?64-bit World wide name ?* ?WRITE_UNCORRECTABLE_EXT command ?* ?{READ,WRITE}_DMA_EXT_GPL commands ?* ?Segmented DOWNLOAD_MICROCODE ?unknown 119[8] ?* ?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 ?Device Sleep (DEVSLP) ?* ?reserved 69[4] ?* ?DOWNLOAD MICROCODE DMA command ?* ?WRITE BUFFER DMA command ?* ?READ BUFFER DMA command ?* ?Data Set Management TRIM supported (limit 8 blocks) ?* ?Deterministic read ZEROs after TRIMSecurity: ?Master password revision code = 1 ?supported ?not enabled ?not locked ?frozen ?not expired: security count ?supported: enhanced erase ?2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT. Logical Unit WWN Device Identifier: 5001b448b48ce759 ?NAA ?: 5 ?IEEE OUI ?: 001b44 ?Unique ID : 8b48ce759Device Sleep: ?DEVSLP Exit Timeout (DETO): 30 ms (drive) ?Minimum DEVSLP Assertion Time (MDAT): 30 ms (drive)Checksum: correct

The second SSD installed in the PC is currently unformatted. Would it be possible to prepare that other disk in a way that will solve this problem, while retaining this current Mint’s user-space installation/configuration copied onto it? It will be a nightmare to have to re-install all of the software that has been setup on this slow disk.


Edit

System specs from inxi:

$ inxi -FzSystem: ?Host: dapadev Kernel: 4.8.0-53-generic i686 (32 bit) Desktop: Cinnamon 3.4.3 ?Distro: Linux Mint 18.2 SonyaMachine: ?System: LENOVO product: 30B7000YUS v: ThinkStation P710 ?Mobo: LENOVO model: 1030 v: SBB0J05441 WIN 3305058809791 Bios: LENOVO v: S01KT40A date: 05/04/2017CPU: ?Octa core Intel Xeon E5-2620 v4 (-HT-MCP-) cache: 20480 KB ?clock speeds: max: 3000 MHz 1: 2099 MHz 2: 2100 MHz 3: 2120 MHz 4: 2100 MHz 5: 2099 MHz 6: 2100 MHz ?7: 2299 MHz 8: 2100 MHzGraphics: ?Card: NVIDIA GK107GL [Quadro K420] ?Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau) ?Resolution: 1680×1050@59.95hz ?GLX Renderer: Quadro K420/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 375.66Audio: ?Card-1 NVIDIA GK107 HDMI Audio Controller driver: snd_hda_intel Sound: ALSA v: k4.8.0-53-generic ?Card-2 Intel C610/X99 series HD Audio Controller driver: snd_hda_intelNetwork: ?Card-1: Intel Ethernet Connection (2) I218-LM driver: e1000e ?IF: eth0 state: up speed: 1000 Mbps duplex: full mac: ?Card-2: Intel I210 Gigabit Network Connection driver: igb ?IF: eth1 state: down mac: ?Card-3: Intel I210 Gigabit Network Connection driver: igb ?IF: eth2 state: up speed: 100 Mbps duplex: full mac: Drives: ?HDD Total Size: 2024.4GB (2.1% used) ID-1: /dev/sda model: SanDisk_SD8TB8U5 size: 512.1GB ?ID-2: /dev/sdb model: SanDisk_SD8TB8U5 size: 512.1GB ID-3: /dev/sdc model: ST1000DM003 size: 1000.2GBPartition: ID-1: / size: 438G used: 8.9G (3%) fs: ext4 dev: /dev/sda1 ?ID-2: swap-1 size: 34.24GB used: 0.00GB (0%) fs: swap dev: /dev/sda5RAID: ?No RAID devices: /proc/mdstat, md_mod kernel module presentSensors: ?System Temperatures: cpu: 43.0C mobo: N/A gpu: 53C ?Fan Speeds (in rpm): cpu: N/AInfo: ?Processes: 275 Uptime: 3 days Memory: 1887.9/32323.8MB Client: Shell (bash) inxi: 2.2.35

Drive details from lsblk:

$ lsblk -SfaltNAME HCTL ?TYPE VENDOR ?MODEL ?REV TRAN ?NAME FSTYPE LABEL UUID MOUNTPOINT NAME ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED ?RQ-SIZE ?RA WSAMEsdb ?3:0:0:0 ?disk ATA ?SanDisk SD8TB8U5 3101 sata ?sdb ??sdb ?0 ?512 ?0 ?512 ?512 ?0 deadline ?128 128 ?0Bsr0 ?6:0:0:0 ?rom ?PLDS ?DVD-RW DH16AFSH ?DL3M sata ?sr0 ??sr0 ?0 ?512 ?0 ?512 ?512 ?1 deadline ?128 128 ?0Bsdc ?4:0:0:0 ?disk ATA ?ST1000DM003-1SB1 CC62 sata ?sdc ??sdc ?0 ?4096 ?0 ?4096 ?512 ?1 deadline ?128 128 ?0Bsda ?2:0:0:0 ?disk ATA ?SanDisk SD8TB8U5 3101 sata ?sda ??sda ?0 ?512 ?0 ?512 ?512 ?0 deadline ?128 128 ?0B

Drive details from smartctl:

$ sudo smartctl -a /dev/sdasmartctl 6.5 2016-01-24 r4214 [i686-linux-4.8.0-53-generic] (local build)Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org=== START OF INFORMATION SECTION ===Device Model: ?SanDisk SD8TB8U512G1001Serial Number: ?165125801567LU WWN Device Id: 5 001b44 8b48ce759Firmware Version: X4133101User Capacity: ?512,110,190,592 bytes [512 GB]Sector Size: ?512 bytes logical/physicalRotation Rate: ?Solid State DeviceForm Factor: ?2.5 inchesDevice is: ?Not in smartctl database [for details use: -P showall]ATA Version is: ?ACS-2 T13/2015-D revision 3SATA Version is: ?SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)Local Time is: ?Sat Oct 14 16:05:13 2017 CDTSMART support is: Available – device has SMART capability.SMART support is: Enabled=== START OF READ SMART DATA SECTION ===SMART overall-health self-assessment test result: PASSEDGeneral SMART Values:Offline data collection status: ?(0x00) Offline data collection activity ?was never started. ?Auto Offline Data Collection: Disabled.Self-test execution status: ?( ?16) The self-test routine was aborted by ?the host.Total time to complete Offline data collection: ?( ?0) seconds.Offline data collectioncapabilities: ?(0x11) SMART execute Offline immediate. ?No Auto Offline data collection support. ?Suspend Offline collection upon new ?command. ?No Offline surface scan supported. ?Self-test supported. ?No Conveyance Self-test supported. ?No 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 routinerecommended polling time: ?( ?10) minutes.SMART Attributes Data Structure revision number: 4Vendor Specific SMART Attributes with Thresholds:ID# ATTRIBUTE_NAME ?FLAG ?VALUE WORST THRESH TYPE ?UPDATED ?WHEN_FAILED RAW_VALUE ?5 Reallocated_Sector_Ct ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0 ?9 Power_On_Hours ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?519 12 Power_Cycle_Count ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?309170 Unknown_Attribute ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0171 Unknown_Attribute ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0172 Unknown_Attribute ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0173 Unknown_Attribute ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0174 Unknown_Attribute ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?48178 Used_Rsvd_Blk_Cnt_Chip ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0180 Unused_Rsvd_Blk_Cnt_Tot 0x0033 ?100 ?100 ?010 ?Pre-fail ?Always ?- ?100184 End-to-End_Error ?0x0033 ?100 ?100 ?097 ?Pre-fail ?Always ?- ?0187 Reported_Uncorrect ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0194 Temperature_Celsius ?0x0022 ?068 ?033 ?— ?Old_age ?Always ?- ?32 (Min/Max 23/33)199 UDMA_CRC_Error_Count ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?0233 Media_Wearout_Indicator 0x0033 ?100 ?100 ?001 ?Pre-fail ?Always ?- ?16772743234 Unknown_Attribute ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?90241 Total_LBAs_Written ?0x0030 ?253 ?253 ?— ?Old_age ?Offline ?- ?101242 Total_LBAs_Read ?0x0030 ?253 ?253 ?— ?Old_age ?Offline ?- ?13249 Unknown_Attribute ?0x0032 ?100 ?100 ?— ?Old_age ?Always ?- ?40SMART Error Log Version: 1No Errors LoggedSMART Self-test log structure revision number 1Num ?Test_Description ?Status ??Remaining ?LifeTime(hours) ?LBA_of_first_error# 1 ?Short offline ?Aborted by host ?00% ?519 ?-Selective Self-tests/Logging not supported

Answer: With a SSD, you should definitely see speeds of at least 100 MiB/s. Usually more.

For the second part of your question, yes you can duplicate the exact contents of your installation to a new disk.

To diagnose your slow disk, you can try a couple of things in addition to what others have suggested:

  • see dmesg for any messages about timeouts regarding sda/sdb and similar
  • change the cable
  • try the disk in a different computer
  • boot a different distro (i.e. live USB) and check disk speed with different kernel
  • try a different SSD on the same cable, same port and same distro
  • run a smartctl -a to see if it reports something suspicious
  • try a blkdiscard or full erase (some older/low quality SSDs might still suffer badly due to performance degradation)
  • see if you can update SSD firmware
  • try the manufacturer diagnostic tools