This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Wednesday, May 20 Check your scores Check calendar Guest Speaker: Greg KroahHartman Friday in class Very important ... do not miss! Calendar Updates Friday, May 22: Monday, May 25: Project #4 Plan of Attack is due before midnight Memorial Day (HOLIDAY) Rob's Project #4 Seminar (DO NOT MISS THIS!) Quiz #2 (no change) Wednesday, May 27: Friday, May 29: Wednesday, June 3: Project #4 is due before midnight Guest Speaker Friday Greg KroahHartman is the current Linux kernel maintainer for more driver subsystems than he wants to admit, along with the driver core, sysfs, kobject, kref, and debugfs code. He also helped start the linuxhotplug and udev projects, and is one half of the kernel stable maintainer team. He works for SuSE Labs / Novell and does various kernel related things for them, and is the author of the book, "Linux Kernel in a Nutshell", and the coauthor of the book, "Linux Device Drivers, 3rd Edition". Today's topics Example File Systems General file system interface Virtual File Systems (VFS) Review for Quiz #2 Example File Systems ... to show that major differences exist among various "real" file systems Microsoft Linux FAT NTFS ext ext2 ext3 ext4 Microsoft FAT32 Still common on small disks and floppies File Allocation Table Disk space allocated in clusters Hardwaredependent FAT updates High fragmentation File / directory names: 8.3 Max file size: 232 1 bytes Max volume size: 264 Provides undelete Critical and timeconsuming Performance degrades on larger devices Microsoft NTFS Master File Table (multiple copies) Metadata for each file Directories are graphs, not trees (but may be viewed as trees) Disk space allocation is contiguous if possible Allocation, security, content keywords Reliable Minimizes fragmentation Copyonwrite Journaling Easier recovery Multiple streams File / directory names Max file size: 264 1 bytes (Vista), 2321 (XP) Max volume size: 264 216 Native encryption available Not useful on small devices No undelete 256 characters, not casesensitive Linux ext2 Supported since 1993 Organized in "block groups" to avoid external fragmentation No journaling 1 KiB 2 KiB 4 KiB Limits: Block size:
max. file size: 16 GiB 256 GiB 2 TiB max. filesystem size: still used, forward compatible with ext3 8 KiB* 2 TiB 64 TiB 8 TiB 16 TiB 32 TiB *8KiB block size if architecture permits Linux ext3 Still most common Mostly backward compatible with ext2 Treebased directory indexes for directories spanning multiple blocks Limits: similar to ext2 Default max number of files/directories is V / 213 Most inherited utilities work V is volume size in bytes Linux ext3 Journaling system (3 "levels")
1. Journal 2. Ordered Slowest, safest File metadata / data written twice Medium speed Usual default Forces file data update before metadata update Fastest, risky Journals only metadata 3. Writeback Linux ext3 No defrag tool No undelete Must set barrier=1 in /etc/fstab to enable checksumming for journal writing Not default Linux ext4 Included in kernel since 2.6.19 Supports larger volumes Recommended in most recent releases Default in 2.6.28 and up Up to 1 exabyte (260) Extents Delayed allocation Larger blocks allocated to avoid fragmentation Faster handling of video and other timecritical files Saves time Less fragmentation Journaling Defragmentation ext3 / ext4 are forward / backward compatible Except extents File System Mounting A file system must be mounted before it can be accessed. Attaches file system to OS directory structure Verification of file system validity Determines access paths Default file system usually mounted when system boots A file system is mounted at a mount point. Implemented as an empty directory OS view of a File System OS views a mounted file system as subdirectories of the mount point OS interacts with a mounted file system through a File System Interface OS maintains structures of metadata information about a file system, directories, files, etc. OS doesn't interpret actual data stored in a file. General File System Interface
Example Structure: perprocess File Control Block (FCB) maintains metadata for a file that is currently open (in use by an active process). File pointer: pointer to last read/write location, per process that has the file open Fileopen count: counter of number of times a file is open to allow process to lock file if necessary, etc. Access rights: perprocess access mode information Cache of data access information etc. General File System Interface
Example Structure: OpenFile Table Most OS implementations use two: Also called File Information Table (FIT) a systemwide openfile table a perprocess openfile table for each process that uses the file contains pointers to the FCBs for each open file counter of number of times a file is open to allow removal of when last process closes it each table contains pointers to entries in the systemwide open file table General File System Interface Files are treated as logical structures by application programs Calls to file system operations hide the details of device implementations Manage files by name (not by location on the external device) Directory structures on the external device manage actual storage/access General OS I/O Subsystem Most operating systems have at least one "built in" file system (native, default) Robust operating systems have some method of interacting with some of the other file systems Handling Alien File Systems Of course, there are MANY different file systems Each has its own way of handling About 80 File structure Directory structure Disk allocation Etc. Virtual File System Virtual File Systems Subsystem of the OS that implements the file system interface for userspace Provides a set of system calls that work regardless of the "real" file system and underlying hardware File system should be transparent to users/applications open(), read(), write(), etc. Quiz #2 Friday, May 29 Coverage: Calculator and one 4x6 notecard encouraged Lectures 18 24 Greg KH seminar Chapters 12, 13 Homework #4 Project #3 No sharing Quiz #2 Topics Devices Device characteristics Character, block Ports Blocking, nonblocking I/O Disks Access method, transfer time, etc Sectors, logical blocks, etc. Quiz #2 Topics I/O Scheduling Algorithms Scheduling structures Calculations FCFS, LOOK, CLOOK, SSTF Reference strings Merging Aging / deadlines Seek/access time Quiz #2 Topics Disk allocation Contiguous, linked, indexed Freespace management
Bitvector, linked blocks, etc. Protection / consistency Directories Journaling Backup / recovery Structure, implementation Attributes, operations access methods Quiz #2 Topics File Systems Data, metadata Attributes, operations, access methods File structure File access Sequential, record, complex Sequential, direct, indexed Simulation ext4, nfs, etc. Examples Device drivers/controllers Mounting/mount point Quiz #2 Topics Virtual File Systems OS/FS interface Data structures Generic commands, etc. File Control Block, OpenFile Table, etc. Linux VFS Superblock, dentry, inode, file Questions? Keep reading include/linux/fs.h include/linux/file.h include/linux/dcache.h fs/libfs.c ...
View Full Document
This note was uploaded on 06/28/2009 for the course CS 411 taught by Professor Staff during the Spring '08 term at Oregon State.
- Spring '08
- Operating Systems