Jump to content
Ruthalas

Cache Trim Failing? ("FITRIM ioctl failed: Remote I?O error") (SOLVED)

27 posts in this topic Last Reply

Recommended Posts

I am using the Dynamix SSD Trim tool to run trim on my cache at this time each evening.

And each time it runs I get the following error (via email report):

cron for user root /sbin/fstrim -a -v | logger &> /dev/null
Console and webGui login account

    fstrim: /mnt/cache: FITRIM ioctl failed: Remote I/O error

Can anyone help me understand why the trim command is failing?

 

Edited by Ruthalas
Changed screenshot to selectable text

Share this post


Link to post

Likely because the controller doesn't support trim, connect the SSD to one of the onbaord SATA ports.

Share this post


Link to post

So I've tested several firmware version to track down where the issue was introduced and the firmware that I was able to get this working correctly is P16. (LSI HBAs LSI SAS2308/SAS2008)

 

To those who are seeing this error, you might want to downgrade to P16 firmware and your FSTRIM would work with your SSDs (obviously if it is supported).

 

Tested firmware version:

 

P14 -> YES

P15 -> YES

P16 -> YES

P17 -> NO

P18 -> NO

P19 -> NO

P20 -> NO

 

Cheers.

 

Guide and files for 9201-16i and 9207-8i:

 

lsi-flash-efi.zip

 

NOTE: You need to boot the efi shell attached in order to proceed with the flashing process.

Edited by ezhik

Share this post


Link to post
1 hour ago, ezhik said:

to get this working correctly is P16.

That's interesting, so trim working depends on the driver version and the firmware version and the filesystem used, still I wouldn't downgrade firmware because of trim, you might miss on important fixes, especially when used with the newer driver, just use the onboard SATA ports.

Share this post


Link to post
11 minutes ago, johnnie.black said:

That's interesting, so trim working depends on the driver version and the firmware version and the filesystem used, still I wouldn't downgrade firmware because of trim, you might miss on important fixes, especially when used with the newer driver, just use the onboard SATA ports.

1) If you review the release notes between P16 and P20, most fixes are not for IT mode.

2) You are assuming everybody has SATA3 (6gb/s) ports available on their motherboards for SSDs. One of my servers only has SATA2 ports.

3) Drivers are generally built with backwards compatibility and I doubt it for HBAs it would play a big role if you are running it on an older firmware.

Share this post


Link to post
10 minutes ago, ezhik said:

2) You are assuming everybody has SATA3 (6gb/s) ports available on their motherboards for SSDs. One of my servers only has SATA2 ports.

I would prefer using onboard SATA2 than downgraded LSI, though it can be a good option for those users that don't have any onboard SATA ports, like some Dell servers.

Share this post


Link to post
8 hours ago, johnnie.black said:

I would prefer using onboard SATA2 than downgraded LSI, though it can be a good option for those users that don't have any onboard SATA ports, like some Dell servers.

Sacrificing performance over stability makes sense, when that's the case.

 

It is also important to make the distinction that new doesn't always mean good. Majority of us worked in IT for decades (possibly including yourself) and we know that new releases cause all sorts of sh*t storms incompatibility and stability issues.

 

Hence why you always read the release notes and assess whether or not you even need these new updates.

 

Obviously security comes first and we have to deal with repercussions as they come.

 

NOTE: It seems LSI mostly patched the IR firmware and IT doesn't seem to need as many patches.

 

 

Share this post


Link to post
On 3/1/2019 at 11:53 PM, ezhik said:

So I've tested several firmware version to track down where the issue was introduced and the firmware that I was able to get this working correctly is P16. (LSI HBAs LSI SAS2308/SAS2008)

 

To those who are seeing this error, you might want to downgrade to P16 firmware and your FSTRIM would work with your SSDs (obviously if it is supported).

 

Tested firmware version:

 

P14 -> YES

P15 -> YES

P16 -> YES

P17 -> NO

P18 -> NO

P19 -> NO

P20 -> NO

 

Cheers.

Sorry to dredge up an old thread... But I saw my trim was failing on my 9207-8i card. Downgraded to firmware 16, and trim works correctly now. 

 

Thank you for the tip.

Share this post


Link to post
49 minutes ago, JasonJoel said:

Sorry to dredge up an old thread... But I saw my trim was failing on my 9207-8i card. Downgraded to firmware 16, and trim works correctly now. 

 

Thank you for the tip.

Good stuff, glad this is useful. Cheers!

Share this post


Link to post
On 3/2/2019 at 12:53 AM, ezhik said:

So I've tested several firmware version to track down where the issue was introduced and the firmware that I was able to get this working correctly is P16. (LSI HBAs LSI SAS2308/SAS2008)

 

To those who are seeing this error, you might want to downgrade to P16 firmware and your FSTRIM would work with your SSDs (obviously if it is supported).

 

Tested firmware version:

 

P14 -> YES

P15 -> YES

P16 -> YES

P17 -> NO

P18 -> NO

P19 -> NO

P20 -> NO

 

Cheers.

I'm experiencing the same issue. I have a Dell H310 flashed to IT Mode using firmware P20. My trim commands continue failing with the I/0 error. I've read conflicting information about downgrading. Since I'm already in IT mode is there a simpler command to run and do I need to include the SAS address or not? Thanks in advance

Share this post


Link to post
I have a Dell H310 flashed to IT Mode using firmware P20. My trim commands continue failing with the I/0 error.

Currently it will never work with p20, IMHO you're better off using another controller for the SSD(s) than downgrading firmware, but if that's not an option... 

 

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
17 minutes ago, johnnie.black said:

Currently it will never work with p20, IMHO you're better off using another controller for the SSD(s) than downgrading firmware, but if that's not an option... 

 

 

 

I'm aware it does not work on P20. I'm fine with downgrading to p16. I'm just unsure of how to do that, was looking for assistance on downgrading.

Share this post


Link to post
11 hours ago, matt_aggz said:

I'm fine with downgrading to p16. I'm just unsure of how to do that, was looking for assistance on downgrading.

Sorry, your question wasn't clear for me, glad you that sorted out.

Share this post


Link to post
11 hours ago, matt_aggz said:

After much trial and error I was able to downgrade to P16 and Trim is working. Thanks ezhik you saved me many headaches!

Happy to see my research is helping the community!

 

Cheers mate!

Share this post


Link to post

I added an SSD cache drive, and when the trim schedule runs it gives the same error as the OP.
When I run the command manually, I get:

root@Tower$ /sbin/fstrim -a -v
/etc/libvirt: 50 GiB (53685309440 bytes) trimmed on /dev/loop4
/var/lib/docker: 30.6 GiB (32834031616 bytes) trimmed on /dev/loop3
/mnt/cache: 896 GiB (962065899520 bytes) trimmed on /dev/mapper/sdi1
fstrim: /tmp/overlay: FITRIM ioctl failed: Input/output error

Does the "trimmed on /dev/X" part mean that the trim worked, and something after the trim didn't?
I've attached output of the "hdparm -I /dev/sdi" command.
I've changed the cable too, but it didn't make a difference.

hdparm.txt

Share this post


Link to post

Those messages mean that the first 3 trim operation worked and whatever is mounted as /tmp/overlay (which is not a location that exists on a default Unraid install) could not be trimmed.

 

Having said that the figures for /etc/libvirt look a bit strange as the libvirt.img file mounted at that location is normally only 1GB in size :(.  Is yours different for some reason?   Even the figure for the docker.img file is more than I would normally expect unless you increased the size above the default of 20GB for some reason.

 

Share this post


Link to post
33 minutes ago, itimpi said:

Those messages mean that the first 3 trim operation worked and whatever is mounted as /tmp/overlay (which is not a location that exists on a default Unraid install) could not be trimmed.

 

Having said that the figures for /etc/libvirt look a bit strange as the libvirt.img file mounted at that location is normally only 1GB in size :(.  Is yours different for some reason?   Even the figure for the docker.img file is more than I would normally expect unless you increased the size above the default of 20GB for some reason.

 

Ah, that overlayfs is something I have for my "/root" directory. So I can disregard that error then.

I've changed my libvirt.img to 1GB, thanks for the heads up!

Share this post


Link to post

I would like to come back to that post as I installed a LSI Card (flashed onP20) yesterday and had this error message in my inbox this morning (My 2 Cache drives are connected to this Controller).

From reading im not sure what to do now. Do I have to change the libvirt.img and if yes, how? My Docker image is still at 20GB.

Or can I just ignore this warning? Of course, at least I could change the cables on the motherboard...

Edited by Toobie

Share this post


Link to post
11 minutes ago, Toobie said:

Of course, at least I could change the cables on the motherboard...

That would be the recommended thing to do.

Share this post


Link to post
On 12/28/2019 at 7:34 AM, ezhik said:

Happy to see my research is helping the community!

 

Cheers mate!

Can anyone make a simple guide/walkthrough for this. I am running the most current version, but would love to downgrade to have drives trimmed!

Share this post


Link to post
On 3/18/2020 at 8:11 PM, mihcox said:

Can anyone make a simple guide/walkthrough for this. I am running the most current version, but would love to downgrade to have drives trimmed!

lsi-flash-efi.zip

 

This works in EFI via the attached efi shell.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.