Docsity

Operating Systems: Hard Disk Drives, RAID, and File Systems - Lecture Notes, Study notes of Operating Systems

Toggle sidebar
bg1
TCSS 422 B – Spring 2020
School of Engineering and Technology
6/4/2020
L19.1
Slides by Wes J. Lloyd
June 4, 2020 TCSS422: Operating Systems [Spring 2020]
School of Engineering and Technology, University of Washington - Tacoma
HDDs, RAID, Fil e Systems
Final Exa m Review
Wes J. Ll oyd
Sc hoo l of Engi neer ing and T ech nolo gy
Univer sity of Wash ingto n - Taco ma
TCSS 422: OPERATING SYSTEMS
Thi s i s a “cl oud com puti ng” cou rse
Pre vio us y ear’ s co urs e:
ht tp: //f acu lty. was hin gto n.e du/w llo yd/ cou rse s/t css 562
Cou rse int rod uces ma jor clo ud c ompu tin g de liv ery mod els :
Inf ras tru ctur e-a s-a- Ser vic e (Ia aS) , Pl atfo rm (Pa aS), Fun ctio ns
(Fa aS) , Co nta iner (Ca aS) , So ftw are (Sa aS)
Cou rse fea tur es a so ftwa re deve lop ment pro jec t wh ere we
bui ld and eval uate so ftw are enti rel y fo r t he c lou d
Fal l 2 019 f ocu s: d evel opi ng s erv erl ess sof twar e: e .g. dat a
pro ces sin g pi peli nes
Fal l 2 020 focu s: ser verl ess /clo ud- nati ve s oft ware ,
co ntai neri zat ion , cl oud ser vice s
FALL 2020 - TCSS 562
SOFTWARE EN G. F OR C LOUD COMPU TING
June 4, 2020
TCSS422: Operating Systems [Spring 2020]
School of Engineering and Technology, University of Washington - Tacoma
L19.2
Cla ss do es no t hav e pre re qui site s
TCS S 422 p rov ide s goo d fou ndat ion – w e use L inu x
If i nter este d in e nro llin g, c onta ct b y em ail
Can ta ke 1 x 50 0-l evel clas s, c ount s a s 40 0-le vel e lec tive
SAVI NGS: ab le to take gr aduat e cour se and only p ay
und ergrad uate tu ition
DO UBL E-D IP !!
Cla ss take n in la st qu arter of un dergra d can b e used twice
Onc e as a unde rgradu ate el ectiv e towar ds gra duat ion
Onc e as a gra duate el ective to wards t he Maste rs in
Com puter S cienc e & Sy stem s (MSC SS) de gree
June 4, 2020
TCSS422: Operating Systems [Spring 2020]
School of Engineering and Technology, University of Washington - Tacoma
L19.3
TCS S 562 – CL OU D CO MPU TI NG - 2
Ind epe nden t s tudy in “cl oud com puti ng”
Wor k to co llab ora tive ly d raf t a pro pos al
and su bmi t to Dr. Chi nn, CSS Cha ir for Appr ova l
Foc us on v arie ty o f t opi cs r elat ed t o c loud /di str ibut ed s yst ems
Var iabl e c redi ts from 1 t o 5
Inv olve s p arti cip ati on i n w eekl y re sea rch gro up m eeti ng
Spr ing 20 20: cu rrent ly Wed nesday at 1 2:30p
Usu all y 1 or 2 on e-o n-o ne or sm all gro up m eeti ng duri ng week
Con tac t by ema il if inte rest ed
Ide nti fy p ref err ed qu art er( s)
Num ber of cre dits
Can ta ke u p to 10 cre dits TC SS 4 98/ 499 - CS S e lect ive cre dits
NEXT YEAR - TCSS 498/ 499 (AN Y QUARTER )
UNDER GRADUATE RE ADIN /RES EARC H I N CSS
June 4, 2020
TCSS422: Operating Systems [Spring 2020]
School of Engineering and Technology, University of Washington - Tacoma
L19.4
Ple ase co mpl ete th e co urs e e val uati on sur vey at :
TCS S 4 22 B - Co mpu ter Op era tin g S yste ms:
htt ps: //u wt. ias ys tem. or g/s urv ey/ 106 940
Ne w th is q uar ter :
As sign men t 2– av ail able in Jav a or C
Tuto ria l 2– p ara llel pr ime num ber gene rat ion
As sign men t 3– Ke rne l Mo dul e pr ogr ammi ng- tu tor ial for mat
Cou rse ent ire ly o nli ne & rec ord ed
Pap erl ess dai ly f eedb ack sur vey s
Qui zze s wi th mult ipl e at temp ts
Pro ble m so lut ions w/ doc umen t c am
Ope n b ook , no te, and int erne t mi dte rm a nd f ina l ex am
Sli de revi sio ns & ref act orin g fo r 1 00% onl ine deli ver y
June 4, 2020
TCSS422: Operating Systems [Spring 2020]
School of Engineering and Technology, University of Washington - Tacoma
L19.5
CO URSE EVALU ATION: TCS S 422 B
SP RING 2020
Qu esti ons f rom 6/2
Tut oria l 2 (pth rea ds, l ock s, co ndi tion s) – d ue T hur s Ju ne 4
As sign ment 3 – o n Li nux ker nel p rog ramm ing –
of fer ed in “t utor ial” for mat – du e Sa t Ju ne 1 3
Qu iz 4 – P age T able s – o pti onal – p rovi des pra ctic e
pr oble ms – t o be po sted
Ch apte r 37: Har d Di sk Dr ive s
Ch apte r 38 : RA ID (Red un dan t a rra y o f i nex pe nsi ve dis ks )
-ve ry bri ef
Ch apte r 39 /40: Fil e Sy stem s
– v er y b rie f
Pr acti ce F inal Ex am Qu est ions – To day – 2
nd
ho ur
June 4, 2020
TCSS422: Operating Systems [Spring 2020]
School of Engineering and Technology, University of Washington - Tacoma
L19.6
OB JECTI VES – 6/4
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Operating Systems: Hard Disk Drives, RAID, and File Systems - Lecture Notes and more Study notes Operating Systems in PDF only on Docsity!

School of Engineering and Technology

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma HDDs, RAID, File Systems Final Exam Review

Wes J. Lloyd

School of Engineering and Technology

University of Washington - Tacoma TCSS 422: OPERATING SYSTEMS  This is a “cloud computing” course  Previous year’s course: http://faculty.washington.edu/wlloyd/courses/tcss  Course introduces major cloud computing delivery models: Infrastructure-as-a-Service (IaaS), Platform (PaaS), Functions (FaaS), Container (CaaS), Software (SaaS)  Course features a software development project where we build and evaluate software entirely for the cloud  Fall 2019 focus: developing serverless software: e.g. data processing pipelines  Fall 2020 focus: serverless/cloud-native software, containerization, cloud services FALL 2020 - TCSS 562

SOFTWARE ENG. FOR CLOUD COMPUTING

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

 Class does not have prerequisites
 TCSS 422 provides good foundation – we use Linux
 If interested in enrolling, contact by email
 Can take 1 x 500-level class, counts as 400-level elective
 SAVINGS: able to take graduate course and only pay
undergraduate tuition
 DOUBLE-DIP !!
 Class taken in last quarter of undergrad can be used twice

 Once as a undergraduate elective towards graduation  Once as a graduate elective towards the Masters in Computer Science & Systems (MSCSS) degree June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

TCSS 562 – CLOUD COMPUTING - 2

 Independent study in “cloud computing”  Work to collaboratively draft a proposal and submit to Dr. Chinn, CSS Chair for Approval  Focus on variety of topics related to cloud/distributed systems  Variable credits from 1 to 5  Involves participation in weekly research group meeting  Spring 2020: currently Wednesday at 12:30p  Usually 1 or 2 one-on-one or small group meeting during week  Contact by email if interested  Identify preferred quarter(s)  Number of credits  Can take up to 10 credits TCSS 498/499 - CSS elective credits

NEXT YEAR - TCSS 498/499 (ANY QUARTER)

UNDERGRADUATE READIN/RESEARCH IN CSS

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.  Please complete the course evaluation survey at:  TCSS 422 B - Computer Operating Systems:

 https://uwt.iasystem.org/survey/

 New this quarter:  Assignment 2– available in Java or C  Tutorial 2– parallel prime number generation  Assignment 3– Kernel Module programming- tutorial format  Course entirely online & recorded  Paperless daily feedback surveys  Quizzes with multiple attempts  Problem solutions w/ document cam  Open book, note, and internet midterm and final exam  Slide revisions & refactoring for 100% online delivery June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

COURSE EVALUATION: TCSS 422 B

SPRING 2020

 Questions from 6/
 Tutorial 2 (pthreads, locks, conditions) – due Thurs June 4
 Assignment 3 – on Linux kernel programming –
of fered in “tutorial” format – due Sat June 13
 Quiz 4 – Page Tables – optional – provides practice
problems – to be posted
 Chapter 37: Hard Disk Drives
 Chapter 38: RAID ( Redundant ar ray of inexpensiv e disks)- ver y brief
 Chapter 39/40: File Systems – ver y brief
 Practice Final Exam Questions – Today – 2nd^ hour

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

OBJECTIVES – 6/

School of Engineering and Technology

 Please classify your perspective on material covered in
today’s class (35 respondents):
 1-mostly review, 5-equal new/review, 10-mostly new
 Average – 6.44 ( from 7.3)
 Please rate the pace of today’s class:
 1-slow, 5-just right, 10-fast
 Average – 5.56 ( from 5.83)

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

MATERIAL / PACE

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

FEEDBACK FROM 6/

 Questions from 6/
 Tutorial 2 (pthreads, locks, conditions) – due Thurs June 4
 Assignment 3 – on Linux kernel programming –
of fered in “tutorial” format – due Sat June 13
 Quiz 4 – Page Tables – optional – provides practice
problems – to be posted
 Chapter 37: Hard Disk Drives
 Chapter 38: RAID ( Redundant ar ray of inexpensiv e disks)- ver y brief
 Chapter 39/40: File Systems – v er y brief
 Practice Final Exam Questions – Today – 2nd^ hour

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

OBJECTIVES – 6/

 Questions from 6/
 Tutorial 2 (pthreads, locks, conditions) – due Thurs June 4
 Assignment 3 – on Linux kernel programming –
of fered in “tutorial” format – due Sat June 13
 Quiz 4 – Page Tables – optional – provides practice
problems – to be posted
 Chapter 37: Hard Disk Drives
 Chapter 38: RAID ( Redundant ar ray of inexpensiv e disks)- ver y brief
 Chapter 39/40: File Systems – ver y brief
 Practice Final Exam Questions – Today – 2nd^ hour

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

OBJECTIVES – 6/

 Questions from 6/
 Tutorial 2 (pthreads, locks, conditions) – due Thurs June 4
 Assignment 3 – on Linux kernel programming –
of fered in “tutorial” format – due Sat June 13
 Quiz 4 – Page Tables – optional – provides practice
problems – to be posted
 Chapter 37: Hard Disk Drives
 Chapter 38: RAID ( Redundant ar ray of inexpensiv e disks)- ver y brief
 Chapter 39/40: File Systems – v er y brief
 Practice Final Exam Questions – Today – 2nd^ hour

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

OBJECTIVES – 6/

CH. 37: HARD DISK DRIVES June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

School of Engineering and Technology

 Acceleration  coasting  deceleration settling
 Acceleration: the arm gets moving
 Coasting: arm moving at full speed
 Deceleration: arm slow down
 Settling: Head is carefully positioned over track
 Settling time is often high, from .5 to 2ms

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

FOUR PHASES OF SEEK

 Data transfer

 Final phase of I/O: time to read or write to disk

surface

 Complete I/O cycle:

1. Seek (accelerate, coast, decelerate, settle)

2. Wait on rotational latency (until track aligns)

3. Data transfer

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

HDD I/O

 Sectors are offset across tracks to allow time for head to
reposition for sequential reads
 Without track skew, when head is repositioned sector
would have already been passed

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

TRACK SKEW

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

TRACK SKEW - 2

 Buffer to support caching reads and writes
 Improves drive response time
 Up to 256 MB, slowly have been growing
 Two styles
 Writeback cache
 Report write complete immediately when data is
transferred to HDD cache
 Dangerous if power is lost
 Writethrough cache
 Reports write complete only when write is physically
completed on disk

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

HDD CACHE

 Can calculate I/O transfer speed with:  I/O Time:  Ttransfer = DATAsize x RateI/O  Rate of I/O: June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

TRANSFER SPEED

School of Engineering and Technology

 Compare two disks:

  1. Random workload: 4KB (random read on HDD)
  2. Sequential workload: 100MB (contiguous sectors)

    Calculate Trotation from rpm (rpmrps, time for 1 rotation / 2) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

EXAMPLE: I/O SPEED

  1. Random workload: 4KB (random read on HDD)
  2. Sequential workload: 100MB (contiguous sectors) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

EXAMPLE: I/O SPEED

There is a huge gap in drive throughput between random and sequential workloads Ttransfer = Datasize x RateI/O 4 KB 100 MB

 See sample HDD configurations here:

 Up to 20 TB

 https://www.westerndigital.com/products/data-center-
drives#hard-disk-hdd

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

MODERN HDD SPECS

 Disk scheduler: determine how to order I/O requests
 Multiple levels of scheduling: OS and HW
 OS: provides ordering
 HW: further optimizes using intricate details of physical
HDD implementation and state

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

DISK SCHEDULING

 Disk scheduling: which I/O request to schedule next
 Shortest Seek Time First (SSTF)

 Order queue of I/O requests by nearest track June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

DISK SCHEDULING ALGORITHMS - 1

 Problem 1: HDD abstraction
 Drive geometry not available to OS. Nearest-block-first is
a comparable alternate algorithm.
 Problem 2: Starvation
 Steady stream of requests for local tracks may prevent
arm from traversing to other side of platter

 Keeps head local to a few tracks June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

SSTF ISSUES

School of Engineering and Technology

 Good system administrators will always say:

RAID is not a backup! June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

RAID - 2

 RAID Level 0: Simplest form
 Stripe blocks of data across disks in a round-robin
fashion
 Excellent performance and capacity
 Capacity

 Capacity is equal to the sum of all disks

 Performance

 R/W are distributed in round-robin fashion across all disks

 Reliability

 No redundancy June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

RAID LEVEL 0 - STRIPING

 RAID 1 tolerates HDD failure  Two copies of each block across disks  RAID 1 Example with 4 disks, each data block saved twice:  Can suffer the loss of two disks  Just not two even or odd numbered disks !! June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

RAID LEVEL 1 - MIRRORING

 Capacity: RAID 1 is expensive
 The useful capacity is n/
 Reliability: RAID-1 does well
 Can tolerate the loss of disk(s)
 Up to n/2 disk failures tolerated depending on which disk
fails
 Performance: RAID-1 is slow at writing
 Must wait for writes to complete to all disk(s)

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

RAID 1 - EVALUATION

 Raid 5 – trades off space requirement for redundancy  In a 5-disk array, you can only recover from the loss of 1 HDD  5 disk RAID 5: Capacity is 80% of 5 disks  Writes rotate across disks, distributing a parity data  To rebuild data blocks you only need data from 4 disks  Any drive can fail, as long just one drive fails  To recover need: 3 blocks + 1 parity block -or- 4 blocks June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

RAID 5 – PARIT Y DISK

 Capacity: Useful capacity is (n-1) disks  A HDD must be dedicated as a parity disk  Performance  Writes are very slow: roughly = n/  Reads are equivalent to a single disk  Reliability  In RAID 5, a disk may fail, and the RAID keeps running  Rebuilds are slow !!!  Depending on disk size 8-24 hours is not unheard of  RAID 6: Adds a second parity disk for increased resilience June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

RAID 5 – EVALUATION

School of Engineering and Technology

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

RAID COMPARISON

CH. 39: FILESYSTEMS June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

 Questions from 6/
 Tutorial 2 (pthreads, locks, conditions) – due Thurs June 4
 Assignment 3 – on Linux kernel programming –
of fered in “tutorial” format – due Sat June 13
 Quiz 4 – Page Tables – optional – provides practice
problems – to be posted
 Chapter 37: Hard Disk Drives
 Chapter 38: RAID ( Redundant ar ray of inexpensiv e disks)- ver y brief
 Chapter 39/40: File Systems – v er y brief
 Practice Final Exam Questions – Today – 2nd^ hour

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

OBJECTIVES – 6/

 Implemented by the OS as pure software  Provide:

 Data structures: to describe disk content
 Arrays of blocks, index-nodes, trees
 Access methods: provides mapping for OS calls open(),
read(), write(), etc.
 Which structures are read? written? For each call?
 How efficiently does the structure support file operations?

 Many available file systems (A-Z) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE SYSTEMS

 Numerous file systems abound (A -Z)
 ADFA, AdvFS, AFS, AFS, AosFS, AthFS, BFS, BFS, Btrfs,
CFS, CMDFS, CP/M, DDFS, DTFS, DOS 3.x, EAFS, EDS, ext,
etx2, etx3, ext4, ext3cow, FAT, VFAT, FATX, FFS, Fossil,
Files-11, Felx, HFS, HPFS, HTFS, IceFS, ISO 9660, JFS,
JXFS, Lisa FS, LFS, MFS, Minix FS, NILFS, NTFS, NetWare
FS, OneFS, OFS, OS-9, PFS, ProDOS, Qnx5fs, Qnx6fs,
ReFS, ReiserFS, Reiser4, Reliance, Reliance Nitro, RFS,
S51K, SkyFS, SFS, Soup (Apple), SpadFS, STL, TRFS, Tux3,
UDF, UFS, UFS2, VxFS, VLIR, WAFL, XFS, FS, ZFS

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE SYSTEMS: A TO Z

 Disk is divided into blocks  Block size supported by most HDDs is 51 2 bytes  Typical FS block size is 4 KB  An instance of a file system is typically called a par tition  A single physical disk can have multiple partitions (file systems) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE SYSTEM ORGANIZATION

School of Engineering and Technology

 Every inode has an inode number (index value)  Based on inode number, disk location can be calculated  Example: inode number=  Offset into inode region = 32  Size of inode=256 bytes  Inode number x inode size = 8192  Inode location = inode start addr + (inode no. x inode size) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

INODE EXAMPLE

 Every inode has an inode number (index value)  Based on inode number, disk location can be calculated  Example: inode number=  Offset into inode region = 32  Size of inode=256 bytes  Inode number x inode size = 8192  Inode location = inode start addr + (inode no. x inode size) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

INODE EXAMPLE

What is the inode location? 12KB + (32 x 256) 12KB + 8KB = 20 KB  Inodes store all information about a file:  File type (e.g. directory, file, other)  Size, and the number of blocks allocated to a file on disk  R/W/X permissions  Time information June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

INODE EXAMPLE - 2

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

INODES – EXT2 LINUX FS

 Inodes use a multi-level index  First level: includes 12-direct block pointers  Second level: provides 1 indirect block pointer  Points to a Block: contains 1,024 x 4 byte block pointers  Indirect po inter:  1 2 direct block pointers, 1 indirect block ptr to a block  Maximum file size:  (1 2 + 1 ,024 entries) * 4KB = (1 ,036 x 4KB) = 4,144 KB  Need more space?  Can have double and triple indirect block pointers June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

MULTI-LEVEL INDEXING

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

MULTI-LEVEL INDEX - 2

School of Engineering and Technology

 Do uble indirect pointer  First level: include 12-direct block pointers  Second level: include 1 indirect block pointer  Third level: include 1 indirect block pointer  Maximum file size: (entries x 4KB block size)  1 2 + 1 ,024 + (1 ,024 x 1,024) * 4KB  1 ,049,612 x 4KB = 4,198,448 KB  ~ 4GB  Triple indirect po inter  Adds another level & indirect block pointer  Maximum file size: (entries x 4KB block size)  1 2 + 1 ,024 + (1024^2 ) + (1024^3 ) * 4KB = ~ 4TB June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

MULTI-LEVEL INDEX - 3

 Extents have a pointer with a stored length  Each file has multiple extents  A single extent would require contiguous file allocation  In contrast to block pointers:  Extents conserve space better than multi-level indexes, but are less agile at representing file allocations scattered across the disk  Multi-level indexes excel for files w/ blocks scattered across the disk  Don’t care if storage is contiguous because each block has a pointer  File indexing presents a space vs. flexibility tradeoff  Extents (space ef ficient, rigid), multi-level indexes (better for tracking files w/ fragmented blocks) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

EXTENTS

 Multi-level indexing
 ext2, ext
 can you have a disk >4TB w/ ext3 ??
 Extents
 ext4 (default Ubuntu 16.04), XFS (default CentOS 7)
 NTFS, Btrfs (b-tree fs)
 Exhaustive file systems feature comparison
 https://en.wikipedia.org/wiki/Comparison_of_file_systems

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE INDEXING

TCSS 422 WILL RETURN AT ~2:35PM June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L15.

 Questions from 6/
 Tutorial 2 (pthreads, locks, conditions) – due Thurs June 4
 Assignment 3 – on Linux kernel programming –
of fered in “tutorial” format – due Sat June 13
 Quiz 4 – Page Tables – optional – provides practice
problems – to be posted
 Chapter 37: Hard Disk Drives
 Chapter 38: RAID ( Redundant ar ray of inexpensiv e disks)- ver y brief
 Chapter 39/40: File Systems – v er y brief
 Practice Final Exam Questions – Today – 2nd^ hour

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

OBJECTIVES – 6/

 A computer system uses a simple base/bounds register pair to virtualize address spaces. For each traces fill in the missing values of virtual addresses, physical addresses, base, and/or bounds registers. In some cases, it is not possible to provide an exact value. If so, specify a range (e.g. greater than 100), or value that is not a single number. June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

QUESTION 1 – BASE AND BOUNDS

School of Engineering and Technology

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

Q4 - 2

 Free space management involves capturing a description of the computer’s free memory using a data structure, storing this data structure in memory, and OS support to rapidly use this structure to determine an appropriate location for new memory allocations. An efficient implementation is very important when scaling up the number of operations the OS is required to perform.  Consider the use of a linked list for a free space list where each node is represented by placing the following structure in the header of the memory chunk: typedef struct __node_t { int size; struct __node_t *next; } node_t; June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

QUESTION 5 – FREE SPACE MANAGEMENT

 Consider the following free space list:  (a) Consider the next fit allocation strategy. For this free list above, how many comparison operations must be performed to identify a free chunk of 3 0-bytes?  (b) After the last free space identification, the chunk is split and the remaining free space is returned to the free space list. Now, consider the next fit allocation strategy. After finding a free space for the previous request, how many comparisons are required to identify a free chunk of 10-bytes? June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

Q5 - 2

 Now, after the last free space identification the chunk is split and the remaining free space is returned to the free space list. Now consider each of the following free space allocation strategies. How many comparisons are required on the updated free space list to find a free chunk of 2 bytes using:  (c) best fit?  (d) worst fit?  (e) first fit? June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

Q5 - 3

QUESTIONS

EXTRA SLIDES

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L19.

School of Engineering and Technology

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

COMMON FILE CHARACTERISTICS

 Directory contains file name and i number (index)  Extra files for the parent dir and pw d  Can store dirs as linear list, often stored in inodes  XFS uses B-trees to eliminate sequential search of filenames for duplicates when creating a new file June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

DIRECTORIES

 Consider reading a file called “/foo/bar”  Traverse starting at root “/” (inumber = 2) to find file  Read each inode to dereference file block location on disk June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE I/O - READ

 3 block file: 11 reads, 3 writes (last access time) June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE I/O – READ OPERATIONS

 At least Five I/Os to update an existing file
 one to read the data bitmap
 one to write the bitmap (to reflect its new state to disk)
 two more to read and then write the inode
 one to write the actual block itself.

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE I/O - WRITE

June 4, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L20.

FILE I/O – WRITE - 2

  • Slide
  • WJL1 Wes J. Lloyd, 5/30/