Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

A Debian Virtual machine runs as a Guest VirtualBox VM. It's filesystem is EXT3. The host system loses power and after booting up the host system and guest VM, I find that the VM's filesystem has been rolled back to a previous state, losing changes made to the filesystem some time before losing power. The operations that were rolled back had been fully completed before the loss of power (files fully copied, file handles closed, etc.), but it's possible and even likely that other write operations were occuring on the VM at the point of the crash.

So I am trying to figure out if it's the filesystem recovery process that rolls back filesystem operations after encountering corruption post power loss, or is it possibly related to VirtualBox and the way it ignores flush requests for performance gains by default (discussed here)

Are there any other factors that would result in the filesystem being rolled back after losing power?

Edit: tested a simplified scenario with the same VM on a Windows host by booting it up, creating a pair of files on the filesystem and killing the VirtualBox.exe process running the VM. After booting up the VM the files created before killing the process are gone. I have varied the time between writing the files and killing the VirtualBox process between a few seconds to a few minutes with the same results. There was no IO activity on the test VM in that peroid of time, except of course for the usual Linux activity, whatever that may be. Also tried the same test on a Debian VM with ext2 instead of ext3 with the exact same results. Looks like it is more VirtualBox related than filesystem related.

Also, during the tests, VirtualBox was configured with the following additional settings:

"VBoxInternal/Devices/piix3ide/0/LUN#[x]/Config/FlushInterval" 1
"VBoxInternal/Devices/piix3ide/0/LUN#[x]/Config/IgnoreFlush" 0

So it looks like they don't have any effect on this particular problem.

share|improve this question

1 Answer 1

ext3 is a journaled file system, and if the journals are corrupt after a power failure, it is better to have your filesystem lose the journaled changes, than getting a corrupted filesystem. so in general, it is for your protection.

anything else that corrupts the journal or otherwise causing journals getting lost would have the same effect (faulty cables, for instance).

there are more detailed discussions, for example, here:

http://unix.stackexchange.com/questions/12699/do-journaling-filesystems-guarantee-against-corruption-after-a-power-failure

share|improve this answer
    
Sorry, not sure I am reading this right, are you saying that ext3 IS doing the rollback? –  Sevas Nov 28 '12 at 17:21
    
yes, if the journals are corrupt (likely when you lose power suddenly), then they will not be committed, and thus your filesystem will show a state without the latest journal entries committed (applied), which is likely what you are seeing. –  johnshen64 Nov 28 '12 at 17:39

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.