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.

When a logical volume is destroyed, the data still exists on the hard disk and is still accessible (using a tool like dd) to any volumes allocated on top of those blocks which haven't been written to with new data.

Does such a tool or utility exist in Linux/Unix which could mark these blocks on a hard drive as 'dirty' which would then cause the specific block to be zeroed on the first read or write of the block?

An example of this in practice is on Amazon Elastic Block Storage. According to the Amazon EBS documentation:

When you create a new EBS volume or restore a volume from a snapshot, the back-end storage blocks are allocated to you immediately. However, the first time you access a block of storage, it must be either wiped clean (for new volumes) or instantiated from its snapshot (for restored volumes) before you can access the block. This preliminary action takes time and can cause a 5 to 50 percent loss of IOPS for your volume the first time each block is accessed. Performance is restored after the data is accessed once.

The safest option is to zero out the entire destroyed volume before reallocation but that reduces IOPS of the hard drive to other volumes so that'd be a last resort option (this is just a test environment with some VMs for myself). Is there a built in solution which replicates what Amazon EBS does above?

share|improve this question
    
"zero out the entire destroyed volume before reallocation but that thrashes the hard drive" why would this "thrash" the hard drive? –  rickhg12hs Jan 5 at 8:41
    
Maybe 'thrashing' was the wrong word, I intended to mean that at scale, it would require a lot of writes to the drive. You'd need to write zeroes to every block in the volume which reduces IOPS to other VM's for that brief period. –  Suhail Patel Jan 5 at 9:42

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.