Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '14 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 '14 at 9:42

You must log in to answer this question.

Browse other questions tagged .