linux c file - Linux

This is a discussion on linux c file - Linux ; I want to write a program that writes 0s to free hard drives space. Not a defragmenter but somethnig that clears files that have been marked deleted and writes over them for privacy so they can't be read or undeleted. ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: linux c file

  1. linux c file

    I want to write a program that writes 0s to free hard drives space. Not
    a defragmenter but somethnig that clears files that have been marked deleted
    and writes over them for privacy so they can't be read or undeleted.
    What non standard headers and functions will I need ? standard C can't
    do this. I will need kernel access I would think.

    Bill



  2. Re: linux c file

    On 2008-04-18, Bill Cunningham wrote:
    > I want to write a program that writes 0s to free hard drives space. Not
    > a defragmenter but somethnig that clears files that have been marked deleted
    > and writes over them for privacy so they can't be read or undeleted.


    That's what the shred utility does.

    > What non standard headers and functions will I need ? standard C can't
    > do this. I will need kernel access I would think.



    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  3. Re: linux c file

    On Fri, 18 Apr 2008 01:04:17 +0000, Bill Cunningham wrote:

    > I want to write a program that writes 0s to free hard drives space. Not
    > a defragmenter but somethnig that clears files that have been marked
    > deleted and writes over them for privacy so they can't be read or
    > undeleted.
    > What non standard headers and functions will I need ? standard C
    > can't
    > do this. I will need kernel access I would think.
    >
    > Bill


    You could do this....

    dd if=/dev/zero of=deleteme
    rm deleteme

    I have in the past done this. It is stupid, but I think it works. Of
    course if you do it as a regular user, and your filesystem has space
    reserved for root, then that space will not be written. Also it is
    stupid, so may cause other problems.....

    stonerfish

  4. Re: linux c file

    On 2008-04-18, jellybean stonerfish wrote:
    > On Fri, 18 Apr 2008 01:23:00 +0000, Chris F.A. Johnson wrote:
    >
    >> On 2008-04-18, Bill Cunningham wrote:
    >>> I want to write a program that writes 0s to free hard drives space.
    >>> Not
    >>> a defragmenter but somethnig that clears files that have been marked
    >>> deleted and writes over them for privacy so they can't be read or
    >>> undeleted.

    >>
    >> That's what the shred utility does.

    >
    >
    > Really? I was under the impression that shred overwrites un-deleted files
    > with zeros, then optionally deletes them. The person wants to overwrite
    > the space that deleted files occupy, with zeros. Big difference. Maybe
    > I should read up on shred again.


    You're probably right, but does "marked deleted" mean the same as
    "deleted"?

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  5. Re: linux c file

    On Fri, 18 Apr 2008 01:23:00 +0000, Chris F.A. Johnson wrote:

    > On 2008-04-18, Bill Cunningham wrote:
    >> I want to write a program that writes 0s to free hard drives space.
    >> Not
    >> a defragmenter but somethnig that clears files that have been marked
    >> deleted and writes over them for privacy so they can't be read or
    >> undeleted.

    >
    > That's what the shred utility does.



    Really? I was under the impression that shred overwrites un-deleted files
    with zeros, then optionally deletes them. The person wants to overwrite
    the space that deleted files occupy, with zeros. Big difference. Maybe
    I should read up on shred again.

    stonerfish

  6. Re: linux c file

    jellybean stonerfish wrote:
    > On Fri, 18 Apr 2008 01:04:17 +0000, Bill Cunningham wrote:
    >
    >> I want to write a program that writes 0s to free hard drives space. Not
    >> a defragmenter but somethnig that clears files that have been marked
    >> deleted and writes over them for privacy so they can't be read or
    >> undeleted.
    >> What non standard headers and functions will I need ? standard C
    >> can't
    >> do this. I will need kernel access I would think.
    >>
    >> Bill

    >
    > You could do this....
    >
    > dd if=/dev/zero of=deleteme
    > rm deleteme
    >
    > I have in the past done this. It is stupid, but I think it works. Of
    > course if you do it as a regular user, and your filesystem has space
    > reserved for root, then that space will not be written. Also it is
    > stupid, so may cause other problems.....
    >
    > stonerfish


    it's stupid on a life system
    but if you want to make a compressed image of your disk
    it's really handy since zeroes are very compressable
    and it beats having to find an equally as large or a larger disk
    as the disk you want to image.

  7. Re: linux c file

    > You're probably right, but does "marked deleted" mean the same as
    > "deleted"?


    When a file is deleted a bit maybe more is changed to deleted. The file
    is still there until it is written over.

    Bill



+ Reply to Thread