[Pkg-zfsonlinux-devel] Bug#982505: Bug#982505: Bug#982505: zfsutils-linux: trim cronjob triggers "cannot trim" e-mails on spinning rust

Colm Buckley colm at tuatha.org
Thu Feb 11 19:48:24 GMT 2021


I did have a quick look in the zpool trim code and it's a bit difficult to
achieve what is being suggested; that error is generated deep in libzfs not
in the mainline of the zpool command, so capturing it or declaring it
not-an-error with a flag would not be super clean. It's possible, but it
might not be quick.

Short-term fix; parse the output of 'zpool status -t' to figure out if any
devices support trim and only trim when there's at least one which does;
something like:

zpool status -tLP "$pool" | fgrep /dev/ | fgrep -qv 'trim unsupported' &&
zpool trim "$pool"

... but there might be corner cases which this doesn't catch.

Colm



On Thu, 11 Feb 2021 at 17:45, Christoph Biedl <
debian.axhn at manchmal.in-ulm.de> wrote:

> Petter Reinholdtsen wrote...
>
> > Any idea how to figure out if trimming is possible/useful?
>
> Haven't checked, but in the meantime I figured a sane solution was
> something like Colm suggested: Have upstream modifiy the zpool command
> so - at least when providing an option like "--cron-mode" - it is silent
> as long as there is no error, and it considers that particular situation
> not an error. Then you could also remove the "|| true" again which has
> potential of hiding errors where it should not.
>
>     Christoph
> _______________________________________________
> Pkg-zfsonlinux-devel mailing list
> Pkg-zfsonlinux-devel at alioth-lists.debian.net
>
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-zfsonlinux-devel



-- 
Colm Buckley | colm at tuatha.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-zfsonlinux-devel/attachments/20210211/05d08ec0/attachment.html>


More information about the Pkg-zfsonlinux-devel mailing list