[wplug] Zeroing out a swap partition

Pat Barron pat at lectroid.com
Thu Jul 21 14:56:39 EDT 2016


I think when I make "testing VMs" like this in the future, I'm just 
going to make a swap file rather than a partition, to make this easier.

In my case, just doing " > nameofswapfile" doesn't help directly - I 
need the contents of the file to be literally zero'ed out - overwritten 
with blocks of zeros - rather than just truncated. Because that way, the 
VM image will compress better.  Normally, I would do this with something 
like "scrub -p fillzero nameofswapfile".

Of course, if I truncate the swap file, and then run "scrub -p fillzero 
-X /name_of_a_temporary_dir", which zero-fills all free space in the 
filesystem (by allocating all available space into files, and then 
scrubbing those files and unlinking them) - which I need to do anyway 
because all free space has to be zero-filled too - then I guess that 
accomplishes the same goal.  ;-)

--Pat.

On 7/21/2016 2:11 PM, Hal wrote:
> On Thu, Jul 21, 2016 at 11:47:31AM -0400, Pat Barron wrote:
>> Can anyone suggest an "easy" way to zero out the contents of a swap
>> partition, without affecting the "formatting" of the partition?  (On
>> RHEL / CentOS / Fedora, if that matters....)
> Could you change to using a swap file entering " > nameofswapfile "
>
> I zero many files that way preserving the tree..
>



More information about the wplug mailing list