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.

I would think that for a file to be deleted from a virtual disk file, all the data that exists after the deleted file would have to be re-written to the file. this seams to be true for archives like zip, rar and tar, but how are virtual disks seamingly able to remove data from the middle of the file without re-writing the rest of the data?

share|improve this question

1 Answer 1

In exactly the same way you can delete a file normally and the OS doesn't have to rebuild the entire filesystem. "Virtual disks" are filesystems no different from ones sitting in partitions on disk drives, they just happen to live in a file inside of another filesystem.

share|improve this answer
    
Might be worth mentioning that this is accomplished by simply marking the relevant portion of the file (or more generally storage area) inside the VD as unused. On systems where sparse files are supported the relevant range may be marked sparse, but it doesn't have to be. –  Michael Kjörling Aug 28 '13 at 20:38
    
@MichaelKjörling Very true, so no real removal takes place, with all the security issues that implies. –  wingedsubmariner Aug 28 '13 at 21:04

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.