0% found this document useful (0 votes)
11 views19 pages

File System Introduction

This is the introduction of how file system works.

Uploaded by

ashisarabieel58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
11 views19 pages

File System Introduction

This is the introduction of how file system works.

Uploaded by

ashisarabieel58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 19
© ites 2 collection of correlated information whichis “ite storage Tike magnetic disks, optical disks, and tapes. It is a method of data ren ufatisused.asametum for giving input and receiving output from that program. ingore a files a sequence of bits, bytes, or records whose meaning is defined by ge cestorand user, Every File has a logical location where they are located fr storage recorded on secondary or sintriecal properties of a File System poe gen fhebeg yer, are important properties of a file system: ; 1. Files are stored on disk or other storage and do not disappear when a user logs off. Files have names and are associated with access permission that permits controlled sharing 3. Files could be arranged or more complex structures to reflect the relationship between them. ex crgly wey Functions of File Create file, find space on disk, and make an entry in the directory. Write to file, requires positioning within the file Read from file involves positioning within the file Delete directory entry, regain disk space. Reposition: move read/write position. pope 414. File Concepts © scanned with OKEN Scanner xt ters, Toxt file : It has a sequence of charac Image file : It has visual information such as photographs, vectors art and so op Source file : It has subroutines and function that are compiled ra Object file : It has a sequence of bytes, organized into bytes and used by the linke, Executable file : The binary code that the loader brings to memory for execution stored in an exe file, ae ene Attributes / Components of a File A file's attributes vary from operating system to another but typically consist of : ee Name: Name is the symbolic file name and is the only information kept in human readable form. 'dentifier: This unique tag is a number that identifies the file within the file system; it is in non-human-readable form of the file. Ron-humar-readable form 0 ‘Type: This information is needed for systems which support different types of files or its format. ‘4. Location: This information is a pointer to a device which points to the location of the file on the device where it is stored. 5: Size: The current size of the file (which is in bytes, words, etc.) which possibly the maximum allowed size gets included in this attribute. 6 Protection: Access-control information establishes who can do the reading, writing, executing, ete. 7 Date, Time & user identification: This information might be kept for the creation of the file, its last modification and last used. These data might be useful for in the field of protection, security, and monitoring its usage @ scanned with OKEN Scanner 3.2.8 RAID Structure Redundant Array of Independent Disks (RAID) was first introduced by David A. satesan and Garth Gibson atthe Univesity Califia at Bein rear eo Ntind RAID is to combine multiple small, inexpensive disk drives into an array te asomplish performance or redundancy goals not attainable with one large and expencive ‘This array of drives will appear to the computer as a single logical storage unit or ave. Functions of RAID ‘Storing the same data in different places on multiple hard disks and improves storage performance. It provides better throughput 3. Data fault tolerance Raid Technology ‘There are 7 levels of RAID schemes:They are = 1. RAIDO, 2. RAID, 3. RAID 2, 4. RAID3, 5. RAIDS, 6. RAIDS, 7. RAID 6. complicated and outdated Out of above 7 RAIDs, RAID Level 2,9 and 4a much compte 7 now a days. RAIDs 0,15 and 6 are used in servers IDs 0,15 and 6 are a © scanned with OKEN Scanner The common characteristic i all these level > Aset of physica disk drives. The operating system views these separate disks as a single logical dis > Data is distributed across the physical dives of the array. ys used to store parity information. > Redundant disk capa » Parity information can help in recovering data in case of disk failure RAID O RAID level 0, often called “striping”. The idea behind this level is data tobe stone divided into some pars called strips and loaded these strips across the member ofthe di, of the array. Advantages of RAID 0 1. It isa very fast method. 2. Performance-oriented disk mapping method. 3. Performance is better than a single drive since the workload is balanced by te array members. 4, This method is very useful for high-performance systems. Disadvantages of RAID O 1. No redundancy of data 2. Itoffers no fault tolerance. 3. When any disk member fails, it affects the entire array. RAD1 RAID level 1 uses at least two duplicate hard drives and store the same blocks of information between them. So, it is often called “Mirroring”. If one of the mirrored drives failure due to a mechanical problem or does not respond then the remaining drive will continue to serve and provide correct data. ‘Advantages of RAID 1 1. _ It provides high reliability. 2. Fault tolerance, recovery from failure is simple. 3. Good performance Disadvantages of RAID 1 1. Very cost to implement because of mirroring data, 2. Minimum 2 drives need to implement RAID 1 al. Tara Puscarens © scanned with OKEN Scanner ae Hy eee eee anaaneete 02 sl vel is called “Hamming code”, gad level 18 code”. The strips are ver RAD gle byte or Word. The hamming code acne a gti ote as sas Ufach data disk and the bits of the code are sted across corresponding bit nas on ultiple disks, are stored in the corresponding bit = 0 pisadvantages of RAID 2 4, RAID level 2s rarely implemented ADS RAID level 3 requires only a single redundant disk. RAID 3 ' isk. loys parallel access sin data distributed in small strips. Instead of an error corresponding oe single ‘rity bits computed for the set of individual bits inthe same position on all of the data {as In the event of a drive failure, the parity drive is accessed and data is reconstructed jam the remaining devices Advantages of RAID 3 1. RAID 3 can achieve very high data transfer rates. 2. Any 1/O request will involve the parallel transfer of data from all of the data disks. Disadvantages of RAID 3 1. RAID level 3 is also rarely implemented. 2. Only processes one 1/0 ata time. RAID 4 “This level uses dedicated parity drive to protect data disks are stripped, as in RAID level 0. Parity information for the stripe is calculated and stored on a parity disk. If one of thedata disks failed is the information re-built on aseparate disk using the parity information. lithe parity disk fails, the parity information is recalculated on a spare disk. It is better suited to the transaction I/O rather than large file transfers. ia haps Te te de Itdistributes the parity strips across all Its the most common type of RAID level 5, It distibutes the pani SSeS oT disks, RAID 5 eliminates the write bottlenecks. The only it has is the arty a ulations Process, But with modemn CPUs and software of RAID that is not even a very big bottlen« Advantages of RAIDS 1. Highest (read) data transmission rate. i 2. Low ratio of ECC (Parity) disks to data disks, means high efficiency. © scanned with OKEN Scanner Disadvantages of RAID 5 1 4. RAID 6 Most complex controller design Difficult to rebuild in the event of disk failure. The high overhead for small writes, To change 1 byte in a file, the ent; must be read, the byte changed, the parity information recalculated entire stripe rewritten, ie strip and the Disk failure has a medium impact on throughput. In RAID 6 method, two different Parity calculations are carried out and stored in Separate blocks on different disks. So, this scheme needs N+2 disks (2 for Parity). Advantages of RAID 6 1. It provides extremely high data availabilty. Benefits of RAID 1. RAID technology prevents data loss due to disk failure. 2. RAID technology can be implemented in hardware or software. 3. Servers make use of RAID technology. 4 To prevent fail of Operating system RAID technology is beneficial. © scanned with OKEN Scanner 4am ee , ok scheduling west ait ls Unser speeds are nite primarily by sck times nd vy. When mllpleFSAUES A Lobe processed there is aso some inherent s \ dor lhe ego 0 Be proces, iy ismeasured by theamount of data transferred divided bythe total amount first request being made to the last transer being completed, (fora series ne mil foo th ies) ON ponith and acs tie cn be inprove by pceing esi snd ge ik equet inlude the disk address, memory address, number of sectors to Pe vate the eqs fo ain or wing cp seeding Fae Ft Saisie tensa a bt te varen. Consider in he following sequence the wid swing fom finder 12210 14 and then back to 124: queue = 96,185, 37,122 14,124, 68,87 head stats a 53 0 14 97 586567 80 t2zta4 1 SSTF Scheduling : Shortest Seck Time Fist scheduling is more efficient, but may lead to starvation if a constant stream of requests arrives for the same general area ofthe disk, SSTF reduces the total head movement to 236 cylinders, down from 640 required for the same set of requests under FCPS. Note, however that the distance could be ‘reduce still further to 208 by stating with 37 and then 14 first before processing, ‘he rest of the requests ———————————————— _ AR © scanned with OKEN Scanner ee queue = 68, 188,97, 12,14, 124.65, 67 head stata 53 014 37 s36se7 90 122124 189190 Figure-SSTF disk scheduling 3. SCAN Scheduling : The SCAN algorithm, a.ka. the elevator algorithm moves back * and forth from one end of the disk to the other, similarly to an elevator processing requests in a tall building, queue = 98, 188,97, 122, 14, 124, 85,67 ead ata a 53 014 a7 Si6567 99 122124 183109 par lar it dil iia Figure- SCAN disk scheduling Under the SCAN algorithm, If a request arrives just ahead of the moving head then ‘twill be processed right away, but if it arrives just after the head has passed, then will have to wait for the head to pass going the other way on the return trip. This leads toa fairly wide variation in access times which can be improved upon. Consider, for example, when the head reaches the high end of the disk: Request with high cylinder numbers just missed the passing head, which means they areal fairly recent requests, whereas requests with low numbers may have been wating foramuch longer time, Making the retum scan from high tolow then ends upaccsié -ecent requests first and making older requests vit that much longer. 09] ss Toa Praca © scanned with OKEN Scanner OPERATING sysTeM senoduling: The CitcularSCAN algorithm improves, ie Ai ets in a circle queue fashion - Once the el ae ‘ js 10 the other end without processing any requests starts 9 is ging of the dik 18 Any requests, and then starts again fro em «58,18, 1205.7 head starts at 53 98 122124 Figure-C-SCAN disk scheduling 4, LOOK Scheduling : LOOK scheduling improves uponSCAN by looking ahead at the queue of pending requests, and not moving the heads any farther towards the end. of the disk than is necessary. The following diagram illustrates the circular form of LOOK: ’ ueve = 88, 185,57, 122, 6, 124, 65,67 hoad starts at 5 37 536567 99 120124 Figure-C-LOOKalsk scheduling UL Selection of a Disk-Scheduling Algorithm ‘ With very low loads all algorithms are equal, since there will normally only be one Tequest to process at a time. Forslighty larger loads, SSTF offers beter performance than FCFS, but may Tead to stary 8. when loads become heavy enough. Tone. a iS (© Scanned with OKEN Scanner eA ate starvation problem, Y For busier systems, SCAN and LOOK algorithms Y The actual optimal algorithm may be something even more complex than iy, discussed here, but the incremental improvements are generally not worthy additional overhead. , all filesystem access times can be made by inteligey ¥ Some improvement to over f those structures are placed y placement of directory and/or inode information. I the middle of the disk instead of at the beginning of the disk, then the maximum distance from those structures to data blocks is reduced to only one-half ofthe diy size. If those structures can be further distributed and furthermore have their dat, blocks stored as close as possible to the corresponding directory structures, then tha, reduces still further the overall time to find the disk block numbers and then access the corresponding data blocks. Y¥ — Onmodem disks the rotational latency can be almost as significant as the seek time, however it is not within the OSes control to account for that, because modem disks do not reveal their internal sector mapping schemes, (particularly when bad blocks have been remapped to spare sectors) Some disk manufacturers provide for disk scheduling algorithms directly on their disk controllers, ( which do know the actual geometry of the disk as well as any remapping ), so that if a series of requests are sent from the computer to the controller then those requests can be processed in an optimal order. Unfortunately there are some considerations that the OS must take into account that are beyond the abilities of the on-board disk-scheduling algorithms, such as priorities of some requests over others, or the need to process certain requests in a particular order. For this reason OSes may elect to spoon-feed requests to the disk controller one at atime in certain situations. © scanned with OKEN Scanner o~ssumques, 3.2.2 Page Replacement procecr® Page replacement algorithm decides which memory page is to be replaced. The B 'S of replacement is sometimes called swap out or write to disk. Page replacement is ‘one when the requested page is not found in the main inemory (page faul!). Tata Pusticarions ih a © scanned with OKEN Scanner STM mw a aos ar ar vontig un 280 fu jopnn nnapeaan por (iuesesaenodcaie re tinue ong sas aeqenejo rage hae Tyr moonbon aed xp uo paseg wzey Sutmorioy ayy ye © Pepeo ag, 2151 ® pur ‘oidure; PE Yo) "83 30 4; tin (590 By 9 20) Ine agp BUtsea:54, POP Boner ot “Asv2 pue aiduis 6 Od YBroy, 7 “ty ‘wawobre wewsceidereBed out 6)4 d ow) aezeiou iene ued aIgETEAL SOLES; Jo saquume 7 ‘er non sana 4N290 uv yey ora 20 ‘Jeumdo seme 2008) abeg ae EE PEELE age AE le fell |g Red ee (2) fo) fz] Bag teen eabHOLe rig tig oF Zr oe og boy Suns evga, ‘SI 38ed ct urns, Paget 8d 02 ‘tdta0¥9 Suro re *esfed 90 pu ononb v9 mb 249 jo peoy ag Se sa8ed mau sy @ scanned with OKEN Scanner paws = anueuniopsad ayy utes unynoug seat juga 20} pasn ag oUt aBed yoyo oyTOUE 20 Sonrpasd Aq 110 avewrrosdde o} An stung 08ye juourereydos-afied jsous npesd oy sunpuodye mau pasodoud rap uonenjena pue uosteduos oy) 0} xreunyouag sore © Soyer fupasoysosinbas t asmeaq ‘Sonoexd ut patousoydiy aq YOUUED 110 4 (-1a0 se peg se 22 Lg 4p Superxpur ‘sunpEsOsIe eq poummbas ase syne) ofted aasy uo exp SwIE|> Yoo DHL -210N ) ‘unquo8je yewndo omy se syney aed (enxd) Auew se sawn ¢ astnbas oF uous _-2angny yp uy aun ysoBu0] a4p 405 posn 2q 10 dus sy unpuo8ye sty “NIW 40 440 Parte? st pue -Ayououe s,pejag wos) 294305 ‘Sinepa8ed ajqissod ye Jo 1samOT ‘Maweae|de1-o6ed jewydo uv 40 y>uv9s a © scanned with OKEN Scanner Ae sting we 0129394230924 254764 eee e as pogetramo8 gu Page Replacement je preition behind LRU, the Least Recently Use, algorithm is thatthe page that Fee ot been used inthe longest times the one that will not be used again nthe near pepe. (Note the distinction between FIFO and LRU: The former looks at the iit toad time, and the later looks atthe oldest use time) sme view LRU as analogous to OPT, except looking backwards in time instead of fGvards. (OPT has the interesting property that for any reference string $ and its ccverse R, OPT will generate the same number of page faults for Sand for R. ft turns Jot that LRU has this same property.) igure illustrates LRU for our sample string yielding 12 page faults, (3s compared to 15 for FIFO and 9 for OPT.) roerece sting ro1203042303212017 ae Ge a page ames vent algorithm Fig.: LRU page-op ¢ LRUis considered a good replacement policy, and is often used. The problem is how ceactly to implement it. There are two simple approaches commonly used: 4. Counters. Every memory access increments a counter, and the current value of this counter is stored in the page table entry for that page. Then finding the LRU page involves simple searching the table for the page with the smallest counter value, Note that overflowing of the counter must be considgred. 2 Stack, Another approach is to usea stack, afd whenever pageis act8sséd, pull that page from the middle ofthe stack and place ton the top. ThefE RU page me & Ca] Ta Pusuicarions © scanned with OKEN Scanner will always be at the hottory of the stack. Because this requires from the middle af the stack, a doubly linked list fs the re structure, reMOvING Object, Note that both implementations of LRU require hardware support, either fog incrementing the counter or for managing the stack, as these operations must by Performed for every memory access. N her LRU or OPT exhibit Belady’s anomaly, Both belong, to a class of pa, replacement algorithms called slack algorithms, which can never exhibit Belady, anomaly, A stack algorithn is one in which the pay n memory for a frame ger of size N will always be a subset of the pages kept for a frame size of N + 1. In the case of LRU, (and particularly the stack implementation thereof ), the top N pages of the stack will be the same for all frame set sizes of N or anything larger. releronce sting 47071012127 42 : a tt it : ; ; : : ; : elie Se ; ‘ LRU-Annraviestt @ scanned with OKEN Scanner 4.1.3 Directory Structure The directory can be viewed as a symbol table that translates file names into their directory entries. If we take such a view, we see that the directory itself can be organized in many ways. We want to be able to insert entries, to delete entries, to search for a name entry, and to list all the entries in the directory. In this section, we examine several schemes for defining the logical structure of the directory system. Tara Pusuicarots © scanned with OKEN Scanner ‘siouvanang viv Pret siasn ayp & povease | Krowanipqns Ou Hung ne KOSH Yoox ayy apIsuE Aldon ayesedas aroxp payeass ancy si. ‘MoF>q fund ayy anzasqo ‘Azoyzaup yewy aprsur Azojsaupqns Aue ayeax> joue> ay ayy “aopanp vons soiva1a J9sn v a0uo Inq “Aso}.aNp Yoos ayy epIsUE ApPaNIP A101 ayran siasn ay ‘ounjanays A4o20usp [a49[-O6 UI : RIDE AIO}OUP 1OAB/-OML “Ba START ATT wou axy Aq pooeydos uit Hay pasonsop 108 UM ay pIO ALA p=TEED ‘ae aes aur opm ay axp 3} wong. ways ayy uy J9sn our Aq post UT my “era a jouueo soem 8 Sanjanae OHS fas oBUNS Jo APeMeIP BuO STILL me Ls veou ‘oyoap yoot ayy ye wasaid axe srasn yn oyy Aq paves pa ‘ed “21d A HP HE MOA UTE oe UF DBS WED NOX Sy 29 uy auosand are siasn yesonas ayy Aq patea1> ‘2kojanpgns sean 01 powo ou oh oer oh 3 Sim sb woysoion veneer ody © scanned with OKEN Scanner Kaoyoanp aseq any se pasapisu0> st 20}294Ip § 495N Ya AUAIO “OO: Med “Axoyautp 280q a4 Se $10} Suuopisuos fq paquosap st ayy ponsop ayy xo wied ax “BI9HY + Gied aIn|O5ay + aumpnas opaNp SM UF aT 249 2120} 0 ged yo sod&y on are arauy, ped ayy Sussn uoReD9] sTaup Aq pasado” are say ayy any, ore. == Ce ie 7 ote] ] Asoy2a110 baasn eaesn | e950 [psn pei J9pun ing S9}y 94 20} oureU auies 2H PIS Ajezedas aq sayy day oF osm yDe 29209099... ‘sady apy yuasaygyp 403 SOHO) 249 Asn 0} smofpe asny>r WALSAS ONIIVEBaO 2 wan [rain] ou we) yasn Auo129110 © scanned with OKEN Scanner suouvorang viv tuow2110 zssen | ra95n | ston -souorsasrp wuased ‘omy ancy gg pur 23 ayy Supsey AzorSas9p axp yup 995 WED NOK sojag wEsBEIP ays UE ‘squuy aun Suysn ayy pareys yey 0} ssaode aney Oya souo}>auEp s95n saYO ayn Aq payuiod aq ue> Azoysamp v ur ayy pareys v “os "souo}zanp yuared Sucur axcy S1aIy e 20 Aro}2001p w sMomTe armas KLo;aNP sup sy ~aManNS Lo} yess “wpe ayy q paajos aq ue> woigoud smu. : osmanaag Alo}29s10 yder5-o1/9koy spsn soipo atp wey) ped saHOYS © YEN GORA sn uso sy Jo ayy e ss9098 ue> 19sn & 'ajduexD 104 “Jasn JUALDYHIP v Jo Say PAREYS 24) ss990e 0} sasn a4 40y Sea 2enaWmULKse Ue Saptaoud aumanays LOIP 203 gL, © scanned with OKEN Scanner

You might also like