Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: AORUS NVMe Gen4 SSD - TRIM not working

  1. #1
    Join Date
    Nov 2017
    Beans
    30

    AORUS NVMe Gen4 SSD - TRIM not working

    I just assembled a X570 board with a AORUS NVMe Gen4 SSD NVME 1TB, and I went to set up a weekly TRIM cron, and fstrim fails. I do a lot of compiling which requires a lot of writing and deleting, so it is going to be important to trim the drive on a regular basis.
    According to Gigabyte - "TRIM & S.M.A.R.T supported".

    *EDIT* I realize Ubuntu 18.04 runs a weekly job to TRIM, but it just uses fstrim which does not work.

    What I've done so far.

    $ sudo fstrim -a -v
    fstrim: /boot/efi: FITRIM ioctl failed: Input/output error

    Checking it out with hdparm
    $ sudo hdparm -I /dev/nvme0n1p2 | grep TRIM
    HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device

    dmsg print
    [11786.271949] print_req_error: I/O error, dev nvme0n1, sector 1144536 flags 803

    It just appears nvme is treated differently than SSD, but I'm not sure what commands need to be run. Any thoughts on where to go next?

    Thanks,

    David

    *Edit* I am running a newer kernel.
    Ryzen-3900x:~/Desktop$ uname -a
    Linux Ryzen-3900x 5.1.16-050116-generic #201907031232 SMP Wed Jul 3 12:35:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    Last edited by backspin; July 16th, 2019 at 03:28 AM.

  2. #2
    Join Date
    Nov 2017
    Beans
    30

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    More information

    sudo nvme list
    Node............. SN Model ................Namespace ..............Usage .............Format ........FW ..........Rev
    ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
    /dev/nvme0n1 SNXXXXXX GIGABYTE GP-ASM2NE6100TTTD 1 1.00 TB / 1.00 TB 512 B + 0 B EGFM11.0


    sudo nvme smart-log /dev/nvme0n1

    Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
    critical_warning : 0
    temperature : 41 C
    available_spare : 100%
    available_spare_threshold : 5%
    percentage_used : 0%
    data_units_read : 37,319
    data_units_written : 241,653
    host_read_commands : 1,072,833
    host_write_commands : 1,150,325
    controller_busy_time : 2
    power_cycles : 3
    power_on_hours : 5
    unsafe_shutdowns : 2
    media_errors : 0
    num_err_log_entries : 72
    Warning Temperature Time : 0
    Critical Composite Temperature Time : 0
    Thermal Management T1 Trans Count : 0
    Thermal Management T2 Trans Count : 0
    Thermal Management T1 Total Time : 0
    Thermal Management T2 Total Time : 0
    Last edited by backspin; July 16th, 2019 at 03:09 AM.

  3. #3
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    Does this apply?
    AMD Releases BIOS Fix To Motherboard Partners For Booting Newer Linux Distributions July 2019
    https://www.phoronix.com/scan.php?pa...Linux-Zen2-Fix
    https://www.phoronix.com/scan.php?pa...0x-linux&num=2

    And those fixes are from AMD, so may be a bit before Motherboard vendor has it available.

    Have you updated firmware on SSD?
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #4
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,270

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    systemd will take care of trim. Trim works on my Western Digital NVMe SSD, so at least for this drive, NVMe is not treated differently. System is Ubuntu 18.04

    You have to enable* trim before it will work:
    Code:
    systemctl enable fstrim.timer
    then reboot, and it should begin monitoring.

    The timer triggers fsck at 00:00 Monday or it occurs first login after that time, then resets to next Monday.

    Check status:
    Code:
    dmn@Tyana:~$ 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 Fri 2019-07-12 12:42:36 MST; 39min ago
      Trigger: Mon 2019-07-15 00:00:00 MST; 2 days left
         Docs: man:fstrim
    You can check if its working from examining journalctl:
    Code:
    dmn@Tyana:~$ journalctl | grep fstrim | grep Jul
    Jul 01 12:33:47 Tyana fstrim[1217]: /: 5.9 GiB (6330462208 bytes) trimmed
    Jul 08 00:20:42 Tyana fstrim[1237]: /: 6 GiB (6420729856 bytes) trimmed
    * it may already be enabled by default in Ubuntu. In other distros, it isn't.
    Last edited by Dennis N; July 16th, 2019 at 11:41 AM.

  5. #5
    Join Date
    Nov 2017
    Beans
    30

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    @Dennis N




    Thanks -- Yes, I looked into the systmctl weekly job and it is enabled, but I don't believe it is going to work. The reason is when I looked into the command it runs; it runs fstrim, and I've run that manually many times and it fails. So, I don't believe it is going to successfully TRIM.

    I really appreciate the insight, but am thinking it might be related to the fstrim utility not knowing how to interact with the nvme.

  6. #6
    Join Date
    Nov 2017
    Beans
    30

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    Adding additional dmesg information from the Ubuntu's automated fstrim attempt.

    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] print_req_error: I/O error, dev nvme0n1, sector 4160 flags 803
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] amd_iommu_report_page_fault: 28 callbacks suppressed
    [Fri Jul 19 17:05:08 2019] AMD-Vi: Event logged [IO_PAGE_FAULT device=01:00.0 domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] AMD-Vi: Event logged [IO_PAGE_FAULT device=01:00.0 domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:08 2019] print_req_error: I/O error, dev nvme0n1, sector 1141976 flags 803
    [Fri Jul 19 17:05:59 2019] amd_iommu_report_page_fault: 2 callbacks suppressed
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] print_req_error: I/O error, dev nvme0n1, sector 4160 flags 803
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] nvme 0000:01:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] AMD-Vi: Event logged [IO_PAGE_FAULT device=01:00.0 domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] AMD-Vi: Event logged [IO_PAGE_FAULT device=01:00.0 domain=0x0000 address=0x0 flags=0x0000]
    [Fri Jul 19 17:05:59 2019] print_req_error: I/O error, dev nvme0n1, sector 1141976 flags 803

  7. #7
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    Have you checked to see if there is a firmware update for your SSD?
    Many have needed firmware updates, even if new.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  8. #8
    Join Date
    Nov 2017
    Beans
    30

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    Quote Originally Posted by oldfred View Post
    Have you checked to see if there is a firmware update for your SSD?
    Many have needed firmware updates, even if new.
    I'll be checking for firmware updates today.

  9. #9
    Join Date
    Oct 2004
    Location
    Albuquerque New Mexico, U
    Beans
    974
    Distro
    Ubuntu Development Release

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    I just ran fstrim manually on my Samsung 970 Pro NVMe device on my ASUS Crosshair VIII (one of the few things that actually works at the moment on the x570 motherboard), so I don't think there is an intrinsic problem with fstrim and NVMe devices.
    regards

  10. #10
    Join Date
    Nov 2017
    Beans
    30

    Re: AORUS NVMe Gen4 SSD - TRIM not working

    Quote Originally Posted by rbmorse View Post
    I just ran fstrim manually on my Samsung 970 Pro NVMe device on my ASUS Crosshair VIII (one of the few things that actually works at the moment on the x570 motherboard), so I don't think there is an intrinsic problem with fstrim and NVMe devices.

    Thanks for checking... Others seem to be working fine with NVMe, so I figure it probably has something to do with interfacing with Gigabytes new PCI Gen4 NVMe. Looks like it is on the latest firmware, though it is likely the first version. I've tried running fstrim with several kernel versions and all fail with the same result.

    davidc502@Ryzen-3900x:~$ sudo nvme fw-log /dev/nvme0n1
    Firmware Log for device:nvme0n1
    afi : 0x1
    frs1 : 0x302e31314d464745 (EGFM11.0)

    Here is another way to get the firmware version. In BOLD

    davidc502@Ryzen-3900x:~$ sudo nvme list /dev/nvme0n1
    Node SN Model Namespace Usage Format FW Rev
    ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
    /dev/nvme0n1 SN1xxxxxxxx GIGABYTE GP-ASM2NE6100TTTD 1 1.00 TB / 1.00 TB 512 B + 0 B EGFM11.0

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •