V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
skdlv
V2EX  ›  硬件

移动 USB-NVME-SSD 碰到 Trim 错误想知道原因以及如何解决

  •  
  •   skdlv · 299 天前 · 688 次点击
    这是一个创建于 299 天前的主题,其中的信息可能已经有所发展或是发生改变。

    设备是 CHIPFANCIER UME NANO ,我安装了 linux 当移动办公存储使用,下班就拔回家用,整个系统在上面。用一段时间之后会有 linux 的 btrfs trim 失败提示,也就是 async unmap/discard 。

    虽然使用没问题,smart 也没报错,但是我想知道这是为什么,怀疑是 UASP 协议下 JMS583 的主控兼容问题 ,但是又不懂深层具体什么原因导致。懂的大佬请赐教解答

    关闭 uas 协议会识别成 512n 的磁盘而不是 4k 512e ,并且关闭 uas 无 unmap 问题

    # dmesg
    kernel: sd 4:0:0:0: [sda] tag#16 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
    kernel: sd 4:0:0:0: [sda] tag#16 Sense Key : Illegal Request [current] 
    kernel: sd 4:0:0:0: [sda] tag#16 Add. Sense: Logical block address out of range
    kernel: sd 4:0:0:0: [sda] tag#16 CDB: Unmap/Read sub-channel 42 00 00 00 00 00 00 00 18 00
    kernel: critical target error, dev sda, sector 108845600 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio class 2
    
    # mount
    /dev/sda2 on / type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,subvolid=269,subvol=/rootfs)
    # lsusb -tv
    /:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/10p, 10000M
        ID 1d6b:0003 Linux Foundation 3.0 root hub
        |__ Port 002: Dev 002, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 0bda:0411 Realtek Semiconductor Corp. Hub
        |__ Port 004: Dev 003, If 0, Class=Mass Storage, Driver=uas, 10000M
            ID 152d:0583 JMicron Technology Corp. / JMicron USA Technology Corp. JMS583Gen 2 to PCIe Gen3x2 Bridge
    # lsblk --discard
    NAME        DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
    sda                0        4K       4G         0
    ├─sda1             0        4K       4G         0
    └─sda2             0        4K       4G         0
    # grep /sys/fs/btrfs/UUID/discard/*
    ./discard_bitmap_bytes:7436533760
    ./discard_bytes_saved:4769325056
    ./discard_extent_bytes:18189688832
    ./discardable_bytes:437780480
    ./discardable_extents:13871
    ./iops_limit:1000
    ./kbps_limit:0
    ./max_discard_size:67108864
    # smartctl -a /dev/sda
    SMART/Health Information (NVMe Log 0x02)
    Critical Warning:                   0x00
    Temperature:                        37 Celsius
    Available Spare:                    100%
    Available Spare Threshold:          10%
    Percentage Used:                    0%
    Data Units Read:                    2,659,947 [1.36 TB]
    Data Units Written:                 2,701,427 [1.38 TB]
    Host Read Commands:                 36,026,467
    Host Write Commands:                34,915,194
    Controller Busy Time:               176
    Power Cycles:                       259
    Power On Hours:                     1,134
    Unsafe Shutdowns:                   181
    Media and Data Integrity Errors:    0
    Error Information Log Entries:      0
    Warning  Comp. Temperature Time:    0
    Critical Comp. Temperature Time:    0
    Temperature Sensor 1:               41 Celsius
    Temperature Sensor 3:               38 Celsius
    
    Error Information (NVMe Log 0x01, 16 of 64 entries)
    No Errors Logged
    
    Self-tests not supported
    # fdisk -l /dev/sda
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3442 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:44 · PVG 19:44 · LAX 03:44 · JFK 06:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.