v15stanford.edu-File_System_Crash_Recovery - File System...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
http://w w w .stanford.edu/~ouster/cgi-bin/cs140-w inter12/lecture.php?topic=recovery January 11, 2012 File System Crash Recovery File System Crash Recovery Lecture Notes for CS 140 Winter 2012 John Ousterhout Readings for this topic from Operating System Concepts : Section 11.7 The problem: crashes can happen anywhere, even in the middle of operations: Lost data: information cached in main memory may not have been written to disk yet. E.g. original Unix: up to 30 seconds worth of changes Inconsistency: If a modification modifies multiple blocks, a crash could occur when some of the blocks have been written to disk but not the others. Examples: Adding block to file: free list was updated to indicate block in use, but file descriptor wasn't yet written to point to block. Creating link to a file: new directory entry refers to file descriptor, but reference count wasn't updated in file descriptor. Approach #1: repair during reboot Example: Unix fsck ("file system check") During every system boot fsck is executed. Checks to see if disk was shut down cleanly; if so, no more work to do. If disk didn't shut down cleanly (e.g., system crash, power failure, etc.), then scan disk contents, identify inconsistencies, repair them. Example: block in file and also in free list Example: reference count for a file descriptor doesn't match the number of links in directories Example: block in two different files
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/02/2012 for the course CS 140 taught by Professor Rosenblum during the Winter '08 term at Stanford.

Page1 / 3

v15stanford.edu-File_System_Crash_Recovery - File System...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online