NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Which file-system is good for power down?



On Mon, 7 Jan 2008 09:46:56 +0100 Adam Hamsik wrote:

>> The difference is that soft updates (softdeps) will save any data that
>> actually did make it to the disk prior to the power going down. In
>> case of ext3 that is not necessarily the case. Especially if the load
>> on the  drive is heavy and it doesn't support tagged command queuing. I
>> could happen that data is actually written to the disk but can't be
>> found because  the meta data wasn't written in time.

> This is not true metadata must be committed before system can write  
> any data to fs(in ordered mode data are keeped in transactions and can  
> be written to disk only when transaction is in commiting state).

Ok, I guess I used the word "metadata" the wrong way. I also considered
the journal to be metadata.

The way I understand journaling is (in a very primitive modell). A file is
to be created and written to disk. The system does these steps:

- An entry is made in the journal stating that the given file is to be
  created.
- The file is created (written to disk), the directory is updated as are
  the inode and the other fs-information.
- An entry is made in the journal stating that the file was created
  successfully.

This list is (as stated) very rough and the steps are probably broken down
far more like updating the journal for the entry in the directory and
inodes etc.

The way I understand it, any data that is actually written to the disk
without the journal being updated is lost. Or did I get that wrong?

> Journaling and softdeps are different techniques for keeping  
> filesystem in consitent state after reboot, their task is not protect  
> data.

Depends on how you define "protection". :-) If a filesystem is completely
broken after a crash you could lose a lot more data than was still in the
memory. Being able to restore the file system and the stored data is
protection in a way. :-)

Regards,
Chris



Home | Main Index | Thread Index | Old Index