Re: Zero-clearing all zero-clearable bytes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 23 Nov 2008, Tetsuo Handa wrote:
> What I wanted to do is "Zero-clearing *all zero-clearable* bytes".

Other than acessing the fs directly with something fs-specific that knows
how to do it, the following trick comes to mind:

1. compress all files to a tar.bz2.
2. remove all files
3. zero fs using dd to a file (will zero all blocks except for the ones used
by the tar.bz2
4. unpack tar.bz2
5. remove tar.bz2
6. redo the dd trick. This will now zero all blocks that were in use by
the tar.bz2.

Of course, this only works if the (kernel, glibc, tar) are not writing
random junk to the unused parts of a fs block.

The cost is from 1 to 3 rm'ed inodes left behind.  If you use two
filesystems (i.e. tar to outside the filesystem), you avoid that
possibility.

> I wished there is a utility to zero-fill such bytes.

So do I.  And a IOCTL/syscall/whatever that we could use to sanitize (i.e.
fill with an user-supplied byte) half-used blocks, so that we could have it
on the most used filesystems (ext2, ext3, xfs, reiser...), and that we could
implement scrub-erasing of unused filesystem areas properly.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux