[wplug] Zeroing out a swap partition

Pat Barron pat at lectroid.com
Thu Jul 21 12:01:05 EDT 2016


Thanks - I actually didn't know you could make "mkswap" use a specific 
UUID, that at least eliminates one step in the process. ;-)

Ideally I'd like to not have to remake the swap partition after doing 
the thing (e.g., I'd like to zero out the data on the partition, but not 
it's metadata), but that might not be possible. This does make it a 
little easier, though.  I appreciate the help!

--Pat.

On 7/21/2016 11:54 AM, G.Pitman wrote:
> Is this useful?
> http://security.stackexchange.com/questions/29350/swap-file-may-contain-sensitive-data
>
> On Thu, Jul 21, 2016 at 11:47 AM, Pat Barron <pat at lectroid.com> 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....)
>>
>> I tried the "obvious" suggestion of "scrub -p zerofill /dev/<partition>",
>> and that worked, as far as it went.  But then the system no longer
>> "recognized" it as a swap partition.  So to solve that, I ran "mkswap" on
>> the partition, and that too worked - but that changed the UUID of the
>> partition, and it no longer matched what was in /etc/fstab, so the system
>> didn't activate the swap partition on boot.  I fixed that by changing the
>> UUID in /etc/fstab, and it all works now - but it's sort of a pain.
>>
>> Is there a less complicated way to do this, or is this pretty much it?
>>
>> (The reason I want to do this in the first place is that this is actually
>> a VM, and I want to zero out all unallocated / unused space on the virtual
>> disk so the VM's hard drive image compresses better, for purposes of
>> sending it over the network to someone else....)
>>
>> Thanks,
>> --Pat.
>>
>> _______________________________________________
>> wplug mailing list
>> wplug at wplug.org
>> http://www.wplug.org/mailman/listinfo/wplug
>>
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug



More information about the wplug mailing list