Is there a way to "zero out" unused sectors on UFS2? - BSD

This is a discussion on Is there a way to "zero out" unused sectors on UFS2? - BSD ; On Wed, 16 Jul 2008 21:55:24 -0700 (PDT) googlegroups@sensation.net.au wrote: > I'm wondering whether it's possible to run something to write zeros to > sectors which are not in use, this way I can do a snapshot and bzip > ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Is there a way to "zero out" unused sectors on UFS2?

  1. Re: Is there a way to "zero out" unused sectors on UFS2?

    On Wed, 16 Jul 2008 21:55:24 -0700 (PDT)
    googlegroups@sensation.net.au wrote:

    > I'm wondering whether it's possible to run something to write zeros to
    > sectors which are not in use, this way I can do a snapshot and bzip
    > the entire "file." At the moment the snapshot file is littered with
    > the contents of past files and indexes which increases the archived
    > size significantly. Any way - short of a file level copy - to null out
    > this unused data?
    >
    > (Perhaps there's even some security setting which nulls out the
    > contents of a file when it's deleted?)
    >
    > Thanks in advance.


    cd /usr/ports/security/bcwipe
    make install clean

  2. Re: Is there a way to "zero out" unused sectors on UFS2?

    On Wed, 16 Jul 2008 21:55:24 -0700 (PDT)
    googlegroups@sensation.net.au wrote:


    > (Perhaps there's even some security setting which nulls out the
    > contents of a file when it's deleted?)


    cd /usr/ports/security/wipe or cd /usr/ports/security/destroy. Nuke
    your files with one of those programs instead of deleting them.



  3. Is there a way to "zero out" unused sectors on UFS2?

    I'm wondering whether it's possible to run something to write zeros to
    sectors which are not in use, this way I can do a snapshot and bzip
    the entire "file." At the moment the snapshot file is littered with
    the contents of past files and indexes which increases the archived
    size significantly. Any way - short of a file level copy - to null out
    this unused data?

    (Perhaps there's even some security setting which nulls out the
    contents of a file when it's deleted?)

    Thanks in advance.

  4. Re: Is there a way to "zero out" unused sectors on UFS2?

    On Wed, 16 Jul 2008 13:04:57 -0400, Timmy wrote:

    > On Wed, 16 Jul 2008 21:55:24 -0700 (PDT) googlegroups@sensation.net.au
    > wrote:
    >
    >
    >> (Perhaps there's even some security setting which nulls out the
    >> contents of a file when it's deleted?)

    >
    > cd /usr/ports/security/wipe or cd /usr/ports/security/destroy. Nuke your
    > files with one of those programs instead of deleting them.


    Or just use the -P option to rm. I imagine that the caveat in the BUGS
    section of the rm manual (wrt use on LFS or similar file systems)
    probably applies to the applications in ports, too.

    To the OP: if you're after a compact serialization of the file system at
    a snapshot, (for a backup, perhaps), then how about using dump to do the
    snapshot (-L) and the serialization? dump | gzip works fine for me, but
    I might be using it for something different from you...

    Cheers,

    --
    Andrew

  5. Re: Is there a way to "zero out" unused sectors on UFS2?

    On Jul 17, 3:37 pm, Andrew Reilly users.org> wrote:
    > On Wed, 16 Jul 2008 13:04:57 -0400, Timmy wrote:
    > > On Wed, 16 Jul 2008 21:55:24 -0700 (PDT) googlegro...@sensation.net.au
    > > wrote:

    >
    > >> (Perhaps there's even some security setting which nulls out the
    > >> contents of a file when it's deleted?)

    >
    > > cd /usr/ports/security/wipe or cd /usr/ports/security/destroy. Nuke your
    > > files with one of those programs instead of deleting them.

    >
    > Or just use the -P option to rm. I imagine that the caveat in the BUGS
    > section of the rm manual (wrt use on LFS or similar file systems)
    > probably applies to the applications in ports, too.


    Hmm, that's a step in the right direction, but I don't really want to
    obliterate evidence of a particular file for security reasons...
    ideally it would either be a standalone program that can work through
    the entire file system and null out unused sectors (which I guess
    could be risky), or some sort of default option for fopen() and the
    like that would "null on truncate" or similar.

    > To the OP: if you're after a compact serialization of the file system at
    > a snapshot, (for a backup, perhaps), then how about using dump to do the
    > snapshot (-L) and the serialization? dump | gzip works fine for me, but
    > I might be using it for something different from you...


    I'm trying to avoid file level backups because there's a lot of small
    files. The snapshot takes long enough!

  6. Re: Is there a way to "zero out" unused sectors on UFS2?

    On Thu, 17 Jul 2008 05:13:29 -0700 (PDT),
    googlegroups@sensation.net.au wrote:
    > ideally it would either be a standalone program that can work through
    > the entire file system and null out unused sectors (which I guess
    > could be risky), [...]


    As gleaned from this very group:

    dd if=/dev/zero of=$FILE && rm $FILE

    Add a suitable mktemp substitution to initialise FILE and only do run it
    when (temporarily) filling your filesystem to the brim isn't a problem.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

+ Reply to Thread