Constant rebooting after power loss
cptsalek at gmail.com
Fri Apr 1 18:09:34 UTC 2011
On 1 April 2011 19:38, Adam Vande More <amvandemore at gmail.com> wrote:
> On Fri, Apr 1, 2011 at 12:02 PM, Chris H <firstname.lastname@example.org> wrote:
>> On Fri, April 1, 2011 6:29 am, Marko Lerota wrote:
>> > I read that ZFS don't need fsck because the files are always consistent
>> filesystem regardless
>> > of power loses. That the corruption can occur only if disks are damaged.
>> But not
>> > when power goes down.
>> Complete nonsense. The information you read was false.
> No, it's really not. ZFS's lack of recovery tools at least in the
> beginning were basically non existent. This is because ZFS uses a COW
> model with an atomic data management unit design which by it's nature
> addresses thing like fsck, and sudden power loss.
By copy on write and its' b-tree ZFS ensures consistency, however,
this does not mean that there's no data loss. Writes are done in a
transaction group, including an updated version of the b-tree. Only if
all the new information has been written successfully the new b-tree
"is tagged as valid" and becomes active. (Which is the reason why you
can't rm files in a full pool.)
If there's a power failure during a write ZFS recovers automatically
during the mount (or zpool import, not sure on this one) _by deleting
the inconsistent data_ and thus reverting to the last known state.
Additionally, a transaction group may consist of several writes that
reach a total size (I think 128Kb per default). If there are small and
slow writes (e.g.to a Logfie) these are cached up to 30 seconds. If a
power failure or any other kind of discruptive failure happens you'll
loose all the information cached.
More information about the freebsd-stable