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 Jan,Monday 7 2008, at 1:18 PM, Christian Baer wrote:

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:

You can create journal on external device, too.

- An entry is made in the journal stating that the given file is to be

Entry in journal is created from modified filesystem blocks e.g. directory inode and other fs-information. you can journal non fs data with ext3 ,too

- 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


If you have had hard crash after entry 1 is done but 2 not you don't care because filesystem is consistent and nonfs data wasn't written yet.

If you have had hard crash after entry 1 is done and 2 partially you have to redo this journal entry and all entries after it.

If you have had hard crash after entry 1 and 2 was done don't care because filesystem is consistent.

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

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. :-)



Home | Main Index | Thread Index | Old Index