Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question consists of two parts:

How to find out what is the writing mode of ext4?

How to configure an existing ext4 (a journaling file system) to do writes to a file in place such that shredding/wiping can be effective.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Ext[234] always does update in place. You don't have to do anything.

share|improve this answer
    
You may have misunderstood the question (or maybe it was me). Note: "such that shredding/wiping can be effective", the question is about how to make the file system overwrite, delete and update files instead of just changing the inodes and metadata. –  Stefano Palazzo Jan 20 '11 at 19:41
    
Yes, and my answer is that is the normal way things work. If you open a file and overwrite its contents, then it is overwritten in place. –  psusi Jan 20 '11 at 21:46
    
Correct, that's the ext4 default: data=ordered (*) All data are forced directly out to the main file system prior to its metadata being committed to the journal. –  m33lky Jan 21 '11 at 5:07
    
However, I'm still not entirely sure what happens during multiple shredding passes: does the file system commit just the last version similar to the way dirty pages are saved? –  m33lky Jan 21 '11 at 5:12
1  
shred forces the data out between passes. –  psusi Jan 21 '11 at 21:12
add comment

I'm not sure this accurately answers the question. If a file is open for reading (say, by a shared library with its contents loaded in memory), you really don't want those contents over-written unexpectedly. So, I believe the normal way (ie when data=ordered) is to write the data to disk, update the inodes/metadata, point the directory entry to the new file, but leave the old file in-place and allocated until all references to it are removed (that is, all processes have released any file_open handles).

In that case, shred/wipe might force an fsync, but the old file is still very much active which means it won't get shredded.

share|improve this answer
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.