From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikola Ciprich Subject: how to get discard working on KVM block devices? Date: Sun, 10 Mar 2013 15:09:05 +0100 Message-ID: <20130310140905.GA4640@nik-comp.linuxbox.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Cc: nikola.ciprich@linuxbox.cz To: kvm Return-path: Received: from gwu.lbox.cz ([62.245.111.132]:48987 "EHLO gwu.lbox.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437Ab3CJOmE (ORCPT ); Sun, 10 Mar 2013 10:42:04 -0400 Received: from linuxbox.linuxbox.cz (linuxbox.linuxbox.cz [IPv6:fd97:818a:331c:66::10] (may be forged)) by gwu.lbox.cz (Sendmail) with ESMTP id r2AE8INS020949 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 10 Mar 2013 15:08:18 +0100 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I'm playing with dm-thin target, and I'd like to get discard working =66rom my test KVM virtuals..=20 I've got thinprov pool, on top of which I've got test logical volume. On host, I can issue discard (using fstrim) on it, and thin pool usage lowers correctly, therefore I think it's working well... However, when I export such block device to KVM (using either virtio or scs= i), discard seems not to be working - I can neither issue fstrim, nor mount ext4 with discard option (well, I can mount it, but it reports discard is not supported by underlying device, fstrim reports FITRIM ioctl failed: Operati= on not supported). I tried with kernel 3.8.2 on both host and guest, and qemu-1.4.0. Is there anything special needed to do to get discard working? thanks a lot in advance for any reply BR nik --=20 ------------------------------------- Ing. Nikola CIPRICH LinuxBox.cz, s.r.o. 28. rijna 168, 709 00 Ostrava tel.: +420 591 166 214 fax: +420 596 621 273 mobil: +420 777 093 799 www.linuxbox.cz mobil servis: +420 737 238 656 email servis: servis@linuxbox.cz ------------------------------------- --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEARECAAYFAlE8lAEACgkQ3xdJJrLygV6R0wCbBjTFOltTBOUOml8z2rCQeFg4 qCYAni2yDfo8XmgRibMcVb4uXU0oBDiW =cNFP -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ--