In the last episode (Nov 11), Matthias Apitz said:
> What is the best method to overwrite the blocks of a given file with bytes
> of 0x00, i.e.  not to O_TRUNC away the blocks to the freelist of the file
> system, but overwrite the old blocks?
> 
> I've checked
> 
> $ dd if=/dev/zero of=file count=4
> 
> but dd(1) opens the file with O_RDWR|O_CREAT|O_TRUNC which for sure will
> give away the old blocks and adquire new blocks.  Any idea?

conv=notrunc

(note that this will only help with ufs; zfs is always copy-on-write, so
newly-written data never overwrites the old blocks)

-- 
        Dan Nelson
        dnel...@allantgroup.com
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to