Page 1 of 1

Filling unused partition space with zeros

Posted: Mon Aug 06, 2012 3:05 pm
by gwpl
Hello.

I've been looking for a tool for filling unused partition space with zeros - in "smart" way, I mean without touching and changing internal data structures. (This can be used, for deduplication purposes of partition images; compression of such backup partition imagesl , their analysis and research based on them).

Thanks to folks from stackexchange:

http://unix.stackexchange.com/questions ... -ext3-ext4

I've found

Code: Select all

Zerofree
tool. But it's for ext2,3,4. I'd like to have things like that for other filesystems as well (especially btrfs - http://unix.stackexchange.com/questions ... eros-btrfs ).

As far as I know FSArchiver, copies only "used" space of partition (with it's all metadata, attrs, xattrs etc).
I suppose it needs to have a kind of function

Code: Select all

is_this_block_used()
for checking if some block is used or not.

Would it be a problem to implement tool, like Zerofree, for filling unused space of partitions (especially file images of partitions) with zeros based on FSArchiver codebase ?

Re: Filling unused partition space with zeros

Posted: Mon Sep 03, 2012 9:02 pm
by admin
fsarchiver works at the file level so it does not need this.

Re: Filling unused partition space with zeros

Posted: Tue Sep 18, 2012 7:02 pm
by gwpl
I thought that it following date are available to fsarchiver :

B - a set of all blocks on partition
U - a set of used blocks, containing data (those have to be backup)

so what am I asking is as simple as:

F - a set of free blocks
F = B-U