1
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze
Unit OS10: Fault Tolerance
3
Roadmap for Section 10.1 The Notion of Fault-Tolerance - - PDF document
Unit OS10: Fault Tolerance Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Roadmap for Section 10.1 The Notion of Fault-Tolerance Fault-Tolerance Support in NTFS Volume Management - Striped
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze
3
4
5
6
7
8
9
NTFS performs automatic recovery Based on update records and checkpoints in Log file Update records store sub operations that change File System structure NTFS writes checkpoint every 5 sec. Includes copy of transaction table and dirty page table Checkpoint includes LSNs of the log records containing the tables; really a series of records - interleaved with update records Recovery depends on two NTFS in-memory tables: Transaction table: keeps track of active transactions (not completed) (sub operations of these transactions must be removed from disk) Dirty page table: records which pages in cache contain modifications to file system structure that have not yet been written to disk
Dirty page table Update record Transaction table Checkpoint record Update record Update record Begin of checkpoint operation End of checkpoint operation
10
Analysis pass
Redo pass
modification that might not have been flushed to disk
Undo pass
11
Transaction 1 was committed before power failure Transaction 2 was still active
Power might fail again during recovery; NTFS would have to redo its undo operations
LSN 4044 LSN 4045 LSN 4046 LSN 4047 LSN 4048 LSN 4049 „Transaction committed“ record Redo: Allocate/Initialize an MFT file record Undo: Deallocate the file record Redo: Add the filename to the index Undo: Remove the filename from the index Redo: Set bits 3-9 in the bitmap Undo: Clear bits 3-9 in the bitmap Power failure
12
13
14
Disks are a physical storage device such as a hard disk, a 3.5-inch floppy disk, or a CD-ROM A disk is divided into sectors, addressable blocks of fixed size
Sector sizes are determined by hardware All current x86-processor hard disk sectors are 512 bytes, and CD-ROM sectors are typically 2048 bytes Future x86 systems might support larger hard disk sector sizes
Partitions are collections of contiguous sectors on a disk A partition table or other disk-management database stores a partition's starting sector, size, and other characteristics Simple volumes are objects that represent sectors from a single partition that file system drivers manage as a single unit Multipartition volumes are objects that represent sectors from multiple partitions and that file system drivers manage as a single unit
Multipartition volumes offer performance, reliability, and sizing features that simple volumes do not
15
Two disk partitioning schemes used by Windows:
Basic disk partitioning Dynamic disk partitioning
Basic disks rely on MS-DOS-style disk partitioning
Are really Windows legacy disks Partition information for each disk stored on disk Multipartition information not stored on disk
can be lost when disk moved, OS reinstalled
Dynamic disks implement a more flexible partitioning scheme
Configuration of multipartition volumes is on disk and mirrored across the dynamic disks of the same computer. This allows for easy migration and minimizes chances of disk configuration loss. Disadvantage is that partitioning is not understood by other OS’s Laptops only support basic disks usually only disk and disks not removable
All disks are basic disks unless created new as dynamic disks or converted
16
Boot code 1 2 3 4 Partitiion table Boot partition Partition 1 Partition 2 Partition 3 (extended) Partition 4 Partitions within an extended partition MBR Boot sector Extended partition boot record
17
The first record of each primary partition is a boot record One primary partition can be marked “bootable” Each partition has a partition type (FAT, FAT32, NTFS, …)
Like a subdisk, complete with its own MBR
Lost of system is reinstalled or disk is moved to another system
18
The dynamic disk partitioning scheme is defined by a component called Logical Disk Manager (LDM)
LDM consists of a service and driver components Dynamic disk partitioning scheme was co-developed with Veritas Software, porting LDM from UNIX implementations
LDM maintains one unified database that stores all partitioning information, for all disks in the system.
Database also stores multipartition configuration Database occupies last 1 MB of each dynamic disk, and is mirrored across a system’s dynamic disks
Veritas offers add-on software that allows dynamic disks to be managed in subsets called disk groups
Master boot record LDM partition area LDM database 1 MB
19
20
21
Single logical volume composed of a maximum of 32 areas of free space on one or more disks NTFS volume sets can be dynamically increased in size (only bitmap file which stores allocation status needs to be extended) FtDisk/DMIO hide physical configuration of disks from file system Tool: Windows Disk Management MMC snap-in Spanned volumes were called volume sets in Windows NT 4.0
C: (100 MB) E: (100 MB) D: (100 MB) D: (100 MB) Volume set D:
two disks
22
Stripes are narrow: 64KB Data tends to be distributed evenly among disks Multiple pending read/write ops. will operate on different disks Latency for disk I/O is often reduced (parallel seek operations)
(150 MB) (150 MB) (150 MB)
1 2 4 3
23
Mirror sets (RAID-1) Stripe sets with parity (RAID-5) Sector sparing
Contents of a partition on one disk are duplicated on another disk FtDisk/DMIO write same data to both locations Read operations are done simultaneously on both disks (load balancing)
C: C: (mirror)
24
25
parity
26
27
28
29
NTFS filename Standard info Security desc. Data Data
4 1588 3 1 1049 2 2 1355 Number of clusters Starting LCN Starting VCN VCN 0 1 LCN 1355 1356 Data VCN 3 4 5 6 LCN 1588 1589 1590 1591 Data VCN 2 LCN 1049 NTFS filename Standard info Security desc. Data 1 1357 Number of clusters Starting LCN Starting VCN Bad VCN 0 LCN 1357
30
31
Any Windows system can be a DFS client Windows NT/2000/2003 Server include DFS server component
Like a virtual UNC path A single namespace can map to physical resources residing
32
33
34
35
36
37
Allows to efficiently update files over a limited-bandwidth network
RDC replicates only the changes when files are updated
38
39
40
41
42
43
This is an intermediate NDIS driver NLB also has user-mode management components
Increases linearly with increased throughput on network interface
44
45
46
47
48
49
LAN (Ethernet) Laptop Laptop Laptop Firewall Firewall ASP.NET app server ASP.NET app server SQL Server SQL Server Cluster storage ASP.NET app server ASP.NET app server LAN (Ethernet)
NLB Cluster NLB Cluster Server Cluster
50
Chapter 12 - File Systems NTFS Recovery Support (from pp. 775) Chapter 13 - Networking Network Load Balancing and File Replication Service (from pp. 841) Chapter 10 - Storage Management Volume Management (from pp. 622)
http://www.microsoft.com/windowsserver2003/technologies/storage/d fs/default.mspx
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/te chnologies/clustering/nlbfaq.mspx
http://www.microsoft.com/windowsserver2003/techinfo/overview/bdmt dm/default.mspx
51