%deffont "standard" tfont "standard.ttf", tmfont "kochi-mincho.ttf" %deffont "thick" tfont "thick.ttf", tmfont "goth.ttf" %deffont "typewriter" tfont "typewriter.ttf", tmfont "goth.ttf" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Default settings per each line numbers. %% %default 1 area 90 90, leftfill, size 2, fore "black", back "white", font "thick" %default 2 size 7, vgap 10, prefix " " %default 3 size 2, bar "gray70", vgap 10 %default 4 size 4, fore "black", vgap 30, prefix " ", font "standard" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Default settings that are applied to TAB-indented lines. %% %tab 1 size 4, vgap 40, prefix " ", icon box "blue" 50 %tab 2 size 3, vgap 40, prefix " ", icon arc "red" 50 %tab 3 size 2, vgap 40, prefix " ", icon delta3 "black" 40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page %nodefault %size 7, font "standard", fore "black", back "white", center %size 4 Linux filesystems %size 4 Christoph Hellwig Independent Software Developer Member of the Board LST e.V. hch@lst.de %font "typewriter" http://verein.lst.de/~hch/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page What exactly is filesysten Organization of disk space Storing small data items on big disk Hierachial structure to store these items In Unix everything is a stream of bytes There's more complex file concepts elsewhere I/O device are represented as files Pipes Sockets %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Evolution of the Unix concept CTSS first real multiuser Operating System Introduces a hierachial filesystem with files as byte arrays Multics Adds special files that redirect operations on certain files to I/O devices v4 adds pipes Magic file descriptors that forward output on one to input for the other one v8 adds procfs first virtual filesystem to interface with the kernel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Evolution of the Unix concept (continued) Plan9 takes it to the extreme no more special files but special filesystems everywhere Linux brings plan9 concepts to Unix APIs internally everything is a filesystem, but the traditional APIs are kept preference to add simple filesystems for new kernel interfaces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Standard filesystems %font "typewriter" %size 3 nodev sysfs nodev rootfs nodev bdev nodev proc nodev sockfs nodev usbfs nodev usbdevfs nodev futexfs nodev tmpfs nodev pipefs nodev eventpollfs nodev devpts ext3 xfs nodev ramfs iso9660 hfs nodev nfs nodev nfsd nodev mqueue nodev rpc_pipefs %font "standard" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Standard filesystems (continued) 21 filesystem drivers loaded on my iBook running Debian Sid 4 of them are traditional disk-based filesystems 1 is a network filesystem 6 of them are completely kernel-internal 8 implement various means to communicate with the kernel 2 are in-memory filesystems for user data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page 63 filesystems in the kernel tree on-disk (26) adfs, affs, befs, bfs, cramfs, efs, ext2, ext3, vxfs, hfs, hfsplus, hpfs, isofs, jfs, minix, msdos, ntfs, qnx4, reiserfs, romfs, sysv, udf, ufs, vfat, v7, xfs flash-disk (2) jffs, jffs2 network (6) afs, cifs, nfs, nfs4, smbfs, ncpfs in-memory (3) ramfs, tmpfs, hugetlbfs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page 63 filesystems in the kernel tree (continued) interface (19) autofs, autofs4, binfmt_misc, capifs, devfs, devpts, gadgetfs, hwgfs, ibmasmfs, mqueue, nfsd, openpromfs, oprofilefs, pfmfs, proc, rpc_pipefs, usbdevfs, usbfs, sysfs internal (6) bdev, eventpollfs, futexfs, pipefs, rootfs, sockfs userspace (1) coda %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page On-disk filesystems minix Original Linux filesystem. Very limited in file size and many other attributes. Not very useful these days. ext2 The traditional Linux filesystem for years. Support all the features you except from a Unix filesystem and more sparse files symlinks large file and filesystem sizes extended attributes ... Very stable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page On-disk filesystems (continued) ext3 Based on ext2 but supports journaling for both Metadata and file data. supports hashed directories in Linux 2.6 reiserfs Filesystem based on balances trees and optimized for small file sizes supports journaling for about five years %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page On-disk filesystems (continued) jfs Modern journaled filesystem from IBM. btree-based directories extents xfs Journaled filesystems with bells and whistles from SGI btree-based directories extents parallel direct I/O delayed allocation dmapi online defragmentation race-free dump %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Network filesystems NFS traditional Unix network filesystem no on-the-wire security at all stateless NFSv4 next generation NFS added security, added state new in Linux 2.6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Network filesystems (continued) SMBFS/CIFS Started as the Lan manager (OS/2) file serving protocol Lots of slightly incompatible variants in Microsoft windows products Standardized as CIFS (Common Internet FileSystem) adds posix extensions for Unix systems Two drivers for older and more recent dialects NCFPS Netware remote filesystem obsolete AFS Andrew Filesystem, a sophisticated distributed filesystem very incomplete kernel implementation so far theres two out of tree implementations, both more complete but rather buggy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page In-memory filesystems ramfs simple filesystems that provides POSIX semantics without a backing store. only a few hundred lines of code tmpfs like ramfs but user data is in virtual memory and can be swapped out. used a backing store for SysV and Posix shared memory hugetlbfs very special filesystems backed by big pages hack for databases and HPC apps %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Cluster filesystems OCFSv1 Hack for clustered oracle databases, ported from Windows. no general purpose filesystem OCFSv2 Major overhaul of OCFSv1. borrows directory and journaling code from ext3 supports full Posix semantics very small (about the size of jfs) GFS Shared disk filesystem from Sistina currently two versions: OpenGFS is a fork of GFS when it went closed source "real" GFS opensourced again by redhat wants a huge in-kernel cluster infrastructure Lustre Special distributed fs for large clusters