220 likes | 278 Views
Advanced File System (AdvFS) Introduction. Chapter Four. Topics. Features Architecture On Disk Format BAS FAS Logging and Transactions In-Memory Structures. Features. Flexible Storage Assignment through Domains Ease of Administration Extent Based File Storage Allocation
E N D
Advanced File System (AdvFS) Introduction Chapter Four
Topics • Features • Architecture • On Disk Format • BAS • FAS • Logging and Transactions • In-Memory Structures
Features • Flexible Storage Assignment through Domains • Ease of Administration • Extent Based File Storage Allocation • Sequential Access Performance • Logging • Reliable Operation and Fast Reboot • File System Read-Only Clones • On-line Backup • File Striping • Performance • Trashcan Directories • User controlled restore utility
File Domains and Filesets File Domain Volumes (Disk Partitions) Filesets Filesets != Partitions
Volumes • Physical Storage Building Blocks for a File Domain • Any Logical UNIX Block Device • "Real" Disk Partition • Hardware RAID Logical Disk • LSM Volume • Administered from /etc/fdmns /etc/fdmns/users_dmn: total o lrwxrwxrwx 1 root system 10 Jun 1 21:50 rz10c -> /dev/rz10c lrwxrwxrwx 1 root system 9 Jun 1 21:50 rz8e -> /dev/rz8e
Filesets • A file/directory tree mapped to a domain • Created with mkfset or dxadvfs • Mounted like a filesystem • Administered from /etc/fstab file users_domain#users_fs /users advfs rq,userquota
Extent Based Storage extent 1 extent 2 logical file Extent Map Disk Space extent 1 extent 2
Extents • Set of Contiguous Pages • AdvFS attempts to write a file with a few large extents # showfile -x /usr/bin/X11/dxadvfs ID Vol PgSz Pages XtntType Segs SegSz Log Perf File 4714.8001 1 16 812 simple ** ** off 100% dxadvfs extentMap: 1 pageOff pageCnt vol volBlock blockCnt 0 812 1 1560816 12992 extentCnt: 1
Why Logging • Many file system operations involve several widely separated writes to disk • a transaction • Crash in between them leaves the on disk file system inconsistent - See UFS and fsck
"log" tagN Directory 1 2 3 Logging a Transaction 3 2 6 Tag Directory 1 Bitfile Metadata Table Commit Log 4 5 intentions commit record
AdvFS Logging • Advfs Transaction • Modifications to its own Metadata (internal structures) • NOT user file data • For each transaction AdvFS • Writes a series of log records describing all changes for an operation to disk and then • Performs changes (writes changed blocks to disk) • In case of crash • On reboot • On-disk log indicates which transactions are complete.
Fileset Clones Application Domain write read COW Backup tool read write after clone is created, before any writes first write to a block in the original (master) fileset access to COW write blocks in the cloned fileset
Clone Issues • apps shouldn't be writing to master when clone is created. • Fortunately cloning time is < second due to COW • a clone != a backup. • A clone is a tool for minimizing down time for a fileset due to backups • make clone of fileset • backup from clone • delete clone
File Striping Domain File 1 2 3 4 5 ..
Trashcan Dir rm mv Trash Cans
Commands File Domains mkfdmn addvol rmvol balance defragement Filesets mkfset chfsets clonefset Files migrate stripe mktrashcan
AdvFS Architecture VFS File Access Subsystem (FAS) VFS operations vnode operations Bitfile Access Subsystem (BAS) Domains and Volumes Bitfiles Transaction Management Block Device Interface
AdvFS Components (1 of 2) • File Access Subsystem (FAS) - the POSIX file system layer in AdvFS, translates VFS file system requests into BAS requests. Components: • Mount, Unmount, Initialization • Directory operations (lookup, create, delete) • File operations (create, read, write, stat, delete, rename) • Bitfile Access Subsystem (BAS) - the bitfile layer in AdvFS Components: • Domain ops (create, delete, open, close) • Bitfile set ops (create, delete, clone, open, close) • Bitfile ops (create, delete, open, close, migrate, read, write, add & remove stg) • Transactions management ops (start, stop, fail, pin pg, pin record, locking, recovery)
AdvFS Components (2 of 2) • Buffer cache ops (pin & unpin page, ref & deref page, flush bitfile, flush cache, prefetch pages, I/O queuing) • Volume ops (add, remove) • Hierarchical Storage Management ops (shelve, unshelve)
Required AdvFS Skills (1 of 2) • You will need to be able to perform the following: • Create an AdvFS file domain with multiple disks and file sets. • Create an AdvFS clone file set. • Create an AdvFS striped file. • Add and remove volumes to a file domain. • Defragment a file domain.
Required AdvFS Skills ( 2 of 2) • Balance a file domain. • Add and change file set attributes, in particular, file set quotas. • Use the showfdmn and showfsets commands to obtain information about an AdvFS file domain. • Use the showfile command to obtain information about an AdvFS file. • Recreate the AdvFS management structure contained in /etc/fdmns using mkdir and ln.
Exercise Break • EX00) • Create a file domain using at least two volumes that contains as least two filesets. If you have only one disk, you may have to repartition it to get the two volumes.