Error "format failed" with "/disk format-drive diskx file-system=trim" on CCR running 7.20.6

Dear all,

I understand that since routerOS v7.18 a new format command was introduced to permit trim on SSD/nvme drives (ref: v7.18.2 [stable] is released! )

Usage being:

/disk format-drive <diskx> file-system=trim

Has someone successfully performed such format?

If yes, what is your setup?

I can’t seem to make use of this feature.

I have a CCR2004-16G-2S+ running routerOS v7.20.6 with 1 USB port, on which is plugged a nvme (ref: https://sabrent.com/products/ec-snve)

It’s properly detected: I can format this nvme drive in ext4 and use it without issue.

But I can’t use this trim command. When running:

/disk format-drive usb1 file-system=trim

I get the error message "format failed"

I realize there aren’t a lot of topics on this in this forum.

The only other post found (response-less) : Do MikroTik devices do TRIM on NVMe SSD

Is there something I am overlooking?

Just my thinking: since "trim" isn't file system type and doesn't uniquely identify one (e.g. ext4 of exfat) ... could it be that one is actually supposed to run two commands to complete the process:

/disk/format file-system=ext4 <diskX>
/disk/format file-system=trim <diskX>

i.e. first format file system and then set the trim property of the (now already) existing file system?

or maybe this doesn't "format" the disk, but simply erase the whole drive by using the TRIM command to mark the whole drive as unused.

Which means it's not intended for performing periodic maintenance TRIM on drive with data. Issuing the command after the format file-system=ext4 command will make the drive having no file system again (the whole drive is full of zeros and has no more ext4 metadata).

Agree trim it’s not a filesystem per say (as would ext4 or fat), but running this trim command after successful ext4 format still result in the error message.

Same when running this trim command before a ext4 format: error message pops - which leads me to believe it doesn’t act as command to erase the entire disk.

Hi All,

I opened a support ticket and got some response that I’m sharing here:

Trim in it's current implementation works as a discard, trimming all blocks from the storage device, in turn, deleting all the data on the device.
We will see what we can do to implement a regular trim and add more information to the documentation. Unfortunately we can't give any ETAs for the arrival in this feature, but this is likely to be added in the future.

So, in summary:

  • CGGXANNX was correct: that command erase the entire disk
  • I expecting the equivalent of fstrim - which is not operational now at routerOS, likely to be available in the future, ETA unknown.
1 Like