Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I zero out the empty space in a volume group? I've got a Virtual Machine contained in a Logical Volume. This logical volume itself contains sda1 for boot partition and sda2 as physical volume for the volume group vmvg.

The volume group vmvg contains two logical volumes. It has about 5-6 GB free space. I need to fill this space with zeroes (/dev/zero).

How do I go about doing this?

share|improve this question
    
I'm wondering why @soandos edited my post? He removed the line "Thanks in advance guys". lol.. I'm new here, perhaps I'm not allowed to thank in advance? –  Sparctus Dec 2 '11 at 15:05
    
It does not add anything to the question, and is therefore considered "fluff" that should be removed. Welcome to superuser. –  soandos Dec 2 '11 at 15:34
    
@Sparctus The best way to offer thanks is to upvote answers that you find useful (in addition to accepting one for being the most help) –  Paul Dec 2 '11 at 21:25
    
Ironically now there are four sub posts fluffing about not adding fluff. Nice. Maybe just leave it alone next time. –  xenithorb May 26 '13 at 20:36
add comment

1 Answer

up vote 4 down vote accepted

Create a volume that consumes the empty space, then

dd if=/dev/zero of=/dev/mapper/vg-emptyspace

(where vg-emptyspace is replaced by the volume you created)

Then delete the volume.

share|improve this answer
    
Thank you Paul. This thought occurred to me after I posted my question, but wasn't too sure. Thanks for the affirmation :) –  Sparctus Dec 2 '11 at 15:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.