<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 21, 2016 at 1:32 AM, Gianluca Cecchi <span dir="ltr"><<a href="mailto:gianluca.cecchi@gmail.com" target="_blank">gianluca.cecchi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 1:40 PM, Zdenek Kabelac <span dir="ltr"><<a href="mailto:zkabelac@redhat.com" target="_blank">zkabelac@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_-7714019981560999161gmail-h5"><br></div></div>
Hi<br>
<br>
Please provide listing of all your 'multipath'  leg devices - are<br>
they support TRIM ?<br>
Then 'check' dm device.<br>
<br>
See  (and attach)<br>
<br>
 grep "" /sys/block/*/queue/discard_gra<wbr>nularity<br>
<br>
<br>
Also make sure you are NOT using 'ext2' filesystem which does not support discard on RHEL6 and you are on latest available RHEL6 kernel.<br>
<br>
<br>
Regards<span class="gmail-m_-7714019981560999161gmail-HOEnZb"><font color="#888888"><br>
<br>
Zdenek<br>
<br>
<br>
</font></span></blockquote></div><br></div></span><div class="gmail_extra">Hello,</div><div class="gmail_extra">thanks for answer.</div><div class="gmail_extra">I'm using ext3 filesystem that supports discard.</div><div class="gmail_extra">Currently I'm on this kernel</div><div class="gmail_extra"> </div><div class="gmail_extra"><div class="gmail_extra">[root@dbatest1 ~]# uname -r</div><div class="gmail_extra">2.6.32-431.29.2.el6.x86_64</div><div class="gmail_extra">[root@dbatest1 ~]# </div><div><br></div><div><br></div><div><div>It seems that I was myself able to find a way to online refresh the logical volume and so to successfully run fstrim command against the related file system, without deactivating the lv and most important without generating downtime for my users.</div><div>Please note that what I'm doing is working on a test system where I have the same situation as in production.</div><div>Can you certify my approach and comment about it, so that I can eventually apply in production?</div><div><br></div></div></div></div></blockquote><div><br></div><div>[snip]</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><div></div><div><br></div><div>[root@dbatest1 ~]# dmsetup suspend /dev/dm-4 ; dmsetup reload /dev/dm-4 my_dm_table ; dmsetup resume /dev/dm-4</div><div>[root@dbatest1 ~]# echo $?</div><div>0</div><div>[root@dbatest1 ~]#</div><div><br></div><div>And now the magic:</div><span class="gmail-"><div><br></div><div>[root@dbatest1 ~]# fstrim /ALM/rdoffline</div></span></div></div></div></blockquote><div><br></div><div>[snip]</div><div> </div><div><br></div><div><br></div></div>I hope I wasn't too rude in asking "certification"... actually I meant comment about the method and if anything nasty (eg the instant suspend phase command...) could happen with that method....</div><div class="gmail_extra"><br></div><div class="gmail_extra">If it is  anyway important, I have many multipath devices/ filsystems on this test server and I can proceed to test one by one.</div><div class="gmail_extra">The LUNs indeed support trim.</div><div class="gmail_extra"><br></div><div class="gmail_extra">In particular if I take one of the lun that yet needs to be trimmed, I have:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">[g.cecchi@dbatest1 ~]$ sudo multipath -l 3600a098038303769752b495147377867</div><div class="gmail_extra">3600a098038303769752b495147377867 dm-47 NETAPP,LUN C-Mode</div><div class="gmail_extra">size=2.0G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw</div><div class="gmail_extra">`-+- policy='round-robin 0' prio=0 status=active</div><div class="gmail_extra">  |- 7:0:5:21 sdea 128:32  active undef running</div><div class="gmail_extra">  `- 8:0:5:21 sdem 128:224 active undef running</div><div class="gmail_extra">[g.cecchi@dbatest1 ~]$ </div><div><br></div><div><br></div><div><div>[g.cecchi@dbatest1 ~]$ for dev in sdea sdem</div><div>> do</div><div>> grep "" /sys/block/${dev}/queue/discard_granularity</div><div>> done</div><div>0</div><div>0</div><div>[g.cecchi@dbatest1 ~]$ </div></div><div><br></div><div>and for the multipath device itself</div><div><br></div><div><div>[g.cecchi@dbatest1 ~]$ cat /sys/block/dm-47/queue/discard_granularity </div><div>0</div><div>[g.cecchi@dbatest1 ~]$ </div></div><div><br></div><div><br></div><div>On devices where I was already able to reload/trim (previous post for example), I had 0 too before as result, but now I have for example:</div><div><br></div><div><div>[g.cecchi@dbatest1 ~]$ for dev in sddt sdef; do grep "" /sys/block/${dev}/queue/discard_granularity; done</div><div>1048576</div><div>1048576</div><div>[g.cecchi@dbatest1 ~]$ </div></div><div><br></div><div>and also</div><div><br></div><div><div>[g.cecchi@dbatest1 ~]$ cat /sys/block/dm-4/queue/discard_granularity </div><div>1048576</div><div>[g.cecchi@dbatest1 ~]$ </div></div><div><br></div><div>Hope I clarified ....</div><div><br></div><div>I don't understand though what you meant with 'check' dm device...</div><div><br></div><div>Thanks in advice for any help understanding if this can be the best workflow to be able to run fstrim without giving downtime, in a safe way.</div><div><br></div><div>Gianluca</div></div></div>