Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: "Devon B." <devon.b@virtualcomplete.com>, linux-btrfs@vger.kernel.org
Subject: Re: Accepting discard to free space from disk images
Date: Mon, 9 Feb 2015 20:42:56 +0500	[thread overview]
Message-ID: <20150209204256.51278106@natsu> (raw)
In-Reply-To: <54D8D1A9.1070006@virtualcomplete.com>

On Mon, 09 Feb 2015 10:26:33 -0500
"Devon B." <devon.b@virtualcomplete.com> wrote:

> If you don't mind me asking, what version kernel are you running and are 
> you using any special mount options?

Well actually I did not claim I have working discard through 'loop', but your
post made me curious.

$ sudo dd if=/dev/zero of=100g bs=1M seek=100000 count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00221052 s, 474 MB/s

$ sudo mkfs.ext4 100g
[...]

$ du -hsc 100g 
133M	100g
133M	total

$ sudo mount -o loop 100g /mnt/tmp1/

(then in a new terminal window):
$ cd /mnt/tmp1/
$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0       96G   60M   92G   1% /mnt/tmp1
$ sudo dd if=/dev/zero of=zerofile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.944377 s, 1.1 GB/s
$ sync

(back to the original one):
$ du -hsc 100g 
1.2G	100g
1.2G	total

(2nd window):
$ sudo fstrim .

(back to the original one):
$ du -hsc 100g 
133M	100g
133M	total

So it does work for me just fine even with 'loop'.
Kernel version 3.14.32, mount options
rw,noatime,nodiratime,compress=zlib,space_cache,inode_cache.

-- 
With respect,
Roman

  parent reply	other threads:[~2015-02-09 15:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09  5:17 Accepting discard to free space from disk images Devon B.
2015-02-09  6:40 ` Roman Mamedov
2015-02-09  8:39   ` Hugo Mills
2015-02-09  9:12     ` Roman Mamedov
2015-02-09  9:15       ` Hugo Mills
     [not found]   ` <54D8D1A9.1070006@virtualcomplete.com>
2015-02-09 15:42     ` Roman Mamedov [this message]
2015-02-09 15:45       ` Roman Mamedov
     [not found]         ` <54D8E946.8060900@virtualcomplete.com>
2015-02-09 17:27           ` Roman Mamedov
2015-02-09 18:08         ` Devon B.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150209204256.51278106@natsu \
    --to=rm@romanrm.net \
    --cc=devon.b@virtualcomplete.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox