Re: [Nbd] TRIM stuff
- To: Wouter Verhelst <w@...112...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] TRIM stuff
- From: Alex Bligh <alex@...872...>
- Date: Fri, 16 Sep 2011 11:24:07 +0100
- Message-id: <417533B017C59548B9874D28@...873...>
- Reply-to: Alex Bligh <alex@...872...>
- In-reply-to: <20110916092653.GD19601@...3...>
- References: <20110916082609.GA19601@...3...> <09186A6CB15FD629B0643AD6@...873...> <20110916092653.GD19601@...3...>
--On 16 September 2011 11:26:53 +0200 Wouter Verhelst <w@...112...> wrote:
I think you can use debugfs's dump_extents command (from memory).
Yes, but that requires an unmounted filesystem. If I want to add this to
the test suite, that's not going to work.
Format a file as an ext4 file system. Loopback mount it. Put your test
disk in there as a file. Do your stuff. Unmount it. Check it.
The loopback mount requires root privileges, but the alternative is
to use the syscall (can't remember). I think that needs root privs
anyway, and won't work if someone is running on a different file
system (who knows is tmpfs supports PUNCH_HOLE).
A heuristic way would be:
* create the file non-sparse with dd from /dev/zero
* run tests
* run du, and check it is significantly smaller (du reports actual
file space taken, in contrast to stat()).
That's only going to work on file systems that support files.
--
Alex Bligh
Reply to: