SlideShare a Scribd company logo
1 of 30
File System
Prof. shabbir
File system
ā€¢ A file system is a method for storing and organizing computer files and the
data they contain to make it easy to find and access them.
ā€¢ File systems may use a data storage device such as a hard disk or CD-
ROM and involve maintaining the physical location of the files,
ā€¢ they might provide access to data on a fi le server by acting as clients for a
network protocol or
ā€¢ they may be virtual and exist only as an access method for virtual data
File Concept
ā€¢ Computers can store information on various storage media such as,
magnetic disks, magnetic tapes, optical disks.
ā€¢ The physical storage is converted into a logical storage unit by operating
system.
ā€¢ The logical storage unit is called FILE.
ā€¢ A file is a collection of similar records.
ā€¢ A record is a collection of related fields that can be treated as a unit by
some application program.
ā€¢ A field is some basic element of data.
ā€¢ Any individual field contains a single value. A data base is collection of
related data.
File Concept
ā€¢ Contiguous logical address space
ā€¢ Types:
ā€¢ Data
ā€¢ numeric
ā€¢ character
ā€¢ binary
ā€¢ Program
ā€¢ Contents defined by fileā€™s creator
ā€¢ Many types
ā€¢ Consider text file, source file, executable file
File Attributes
ā€¢ Name ā€“ only information kept in human-readable form
ā€¢ Identifier ā€“ unique tag (number) identifies file within file system
ā€¢ Type ā€“ needed for systems that support different types
ā€¢ Location ā€“ pointer to file location on device
ā€¢ Size ā€“ current file size
ā€¢ Protection ā€“ controls who can do reading, writing, executing
ā€¢ Time, date, and user identification ā€“ data for protection, security,
and usage monitoring
ā€¢ Information about files are kept in the directory structure, which is
maintained on the disk
ā€¢ Many variations, including extended file attributes such as file
checksum
ā€¢ Information kept in the directory structure
File operations: File is an abstract data type
ā€¢ 1. Creating a file : Two steps are needed to create a file.
ā€¢ They are:
ā€¢ 1. Check whether the space is available or not.
ā€¢ 2. If the space is available then made an entry for the new file in the directory. The entry includes name of the file, path of the file, etcā€¦
ā€¢ 2. Writing a file : To write a file, we have to know 2 things.
ā€¢ One is name of the file and
ā€¢ second is the information or data to be written on the file,
ā€¢ the system searches the entered given location for the file.
ā€¢ If the file is found, the system must keep a write pointer to the location in the file where the next write is to take place.
ā€¢ 3. Reading a file : To read a file, first of all we search the directories for the file,
ā€¢ if the file is found, the system needs to keep a read pointer to the location in the file where the next read is to take place.
ā€¢ Once the read has taken place, the read pointer is updated.
ā€¢ 4. Repositioning within a file : The directory is searched for the appropriate entry and the current file position pointer is
repositioned to a given value.
ā€¢ This operation is also called file seek.
ā€¢ 5. Deleting a file : To delete a file, first of all search the directory for named file, then released the file space and erase the
directory entry.
ā€¢ 6. Truncating a file : To truncate a file, remove the file contents only but, the attributes are as it is.
File Types ā€“ Name, Extension
FILE ACCESS METHODS
ā€¢ Files stores information, this information must be accessed and read
into computer memory.
ā€¢ There are so many ways that the information in the file can be
accessed.
ā€¢ 1. Sequential file access: Information in the file is processed in order
i.e. one record after the other.
ā€¢ Magnetic tapes are supporting this type of file accessing.
ā€¢ Eg : A file consisting of 100 records, the current position of read/write head is
45th record, suppose we want to read the 75th record then, it access
sequentially from 45, 46, 47 ā€¦ā€¦.. 74, 75.
ā€¢ So the read/write head traverse all the records between 45 to 75.
Direct access:
ā€¢ 2. Direct access: Direct access is also called relative access.
ā€¢ Here records can read/write randomly without any order.
ā€¢ The direct access method is based on a disk model of a file,
because disks allow random access to any file block.
ā€¢ Eg : A disk containing of 256 blocks, the position of
read/write head is at 95th block.
ā€¢ The block is to be read or write is 250th block.
ā€¢ Then we can access the 250th block directly without any
restrictions.
ā€¢ Eg : CD consists of 10 songs, at present we are listening song
3, If we want to listen song 10, we can shift to 10.
3. Indexed Sequential File access
ā€¢ The main disadvantage in the sequential file is, it takes more time to
access a Record .
ā€¢ Records are organized in sequence based on a key field.
ā€¢ Eg : A file consisting of 60000 records, the master index divide the
total records into 6 blocks, each block consisting of a pointer to
secondary index.
ā€¢ The secondary index divide the 10,000 records into 10 indexes.
ā€¢ Each index consisting of a pointer to its original location.
ā€¢ Each record in the index file consisting of 2 field, A key field and a
pointer field.
Indexed Sequential File access
DIRECTORY STRUCTURE
ā€¢ The directories themselves are simply files
indexing other files, which may in turn be
directories
ā€¢ if a hierarchical indexing scheme is used.
ā€¢ Sometimes the file system consisting of millions
of files, at that situation it is very hard to manage
the files.
ā€¢ To manage these files, grouped these files and load
one group into one partition.
ā€¢ Each partition is called a directory .
ā€¢ a directory structure provides a mechanism for
organizing many files in the file system.
Directory structureā€¦
ā€¢ The typical contents of a directory are:
ā€¢ 1. file name (string uniquely identifying the fi le), type (e.g. text, binary data, executable,
ā€¢ library), organization (for systems that support different organizations);
ā€¢ 2. device (where the file is physically stored), size (in blocks), starting address on device
(to
ā€¢ be used by the device I/O subsystem to physically locate the file);
ā€¢ 3. creator, owner, access information (who is allowed to access the file, and what they
may do with it);
ā€¢ 4. date of creation/of last modification;
ā€¢ 5. locking information (for the system that provide fi le/record locking).
OPERATION ON THE DIRECTORIES :
ā€¢ 1. Searchfor a file:Searcha directorystructureforrequiredfile.
ā€¢ 2. createafile: Newfilesneedtobe created,addedtothe directory.
ā€¢ 3. Delete a file:Whena fileis nolongerneeded,wewantto removeitfromthe directory.
ā€¢ 4. Lista directory:We canknow thelistoffilesinthe directory.
ā€¢ 5. Rename afile: Wheneverwe needtochangethe nameofthe file,wecanchangethe name.
ā€¢ 6. Traversethe filesystem: We needtoaccesseverydirectoryandeveryfilewithina directorystructurewecan
traversethe filesystem
various directory structures
ā€¢ In single level directory all files are contained in the same directory. It is easy to support and
ā€¢ understand. It has some limitations like:
ā€¢ 1. Large number of files (naming).
ā€¢ 2. Ability to support different users/topics (grouping).
The problem here is different users may accidentally use the same names for their files.
E.g : If user 1 creates a files called sample and then later user 2 to creates a file called sample, then user2ā€™s file
will overwrite user 1 file. That's why it is not used in the multi user system.
Two Level Directory
ā€¢ In two level directory structure one is master file directory and the other is user file directory.
ā€¢ Here each user has their own user file directory.
ā€¢ Each entry in the master file directory points to a user fi le directory.
ā€¢ Each user has rights to access their own directory but canā€™t access other userā€™s directory, if
permission is not given by the owner of the second one.
ā€¢ To avoid this problem each user need a private directory,
ā€¢ Names chosen by one user don't interfere with names chosen by a different user.
Tree Level Directory
ā€¢ In Tree level directory the directory structure is a tree
with arbitrary height.
ā€¢ Here users may create their own subdirectories.
ā€¢ Two level directory eliminates name conflicts among
users but it is not satisfactory for users with a large
number of files.
ā€¢ To avoid this create the sub-directory and load the
same type of files into the sub-directory.
ā€¢ so, here each can have as many directories are
needed.
There are 2 types of path
ā€¢ 1. Absoulte path
ā€¢ 2. Relative path
ā€¢ Absoulte path : Begging with root and follows a path
down to specified files giving directory, directory
name on the path.
ā€¢ Relative path : A path from current directory.
ā€¢ Absolute or relative path name
ā€¢ Creating a new file is done in current directory
ā€¢ Delete a file
rm <file-name>
ā€¢ Creating a new subdirectory is done in current
directory
mkdir <dir-name>
Example: if in current directory /mail
mkdir count
Deleting ā€œmailā€ ļƒž deleting the entire subtree rooted
by ā€œmailā€
Acyclic graphdirectory
ā€¢ Multiple users are working on a project, the project files can be
stored in a common sub-directory of the multiple users.
ā€¢ This type of directory is called acyclic graph directory .
ā€¢ The common directory will be declared a shared directory.
ā€¢ The graph contain no cycles with shared files, changes made by
one user are made visible to other users.
ā€¢ A file may now have multiple absolute paths.
ā€¢ when shared directory/file is deleted, all pointers to the
directory/ files also to be removed.
General graph directory:
ā€¢ When we add links to an existing tree structured
directory, the tree structure is destroyed, resulting is a
simple graph structure.
ā€¢ How do we guarantee no cycles?
ā€¢ Allow only links to file not subdirectories
ā€¢ Garbage collection
ā€¢ Every time a new link is added use a cycle
detection algorithm to determine
whether it is OK
ā€¢
File allocation methods
ā€¢ An allocation method refers to how disk blocks are allocated for files.
ā€¢ One main problem in file management is how to allocate space for files so that disk space is utilized
effectively and files can be accessed quickly.
ā€¢ Three major methods of allocating disk space are contiguous, linked, and indexed. Each method
has its advantages and disadvantages.
ā€¢ Accordingly, some systems support all three (e.g. Data Generalā€™s RDOS). More commonly, a
ā€¢ system will use one particular method for all files.
Contiguous allocation
ā€¢ The contiguous allocation method
requires each file to occupy a set of
contiguous address on the disk.
ā€¢ Disk addresses define a linear
ordering on the disk.
ā€¢ each file occupies set of contiguous
blocks
ā€¢ Best performance in most cases
ā€¢ Simple ā€“ only starting location (block
#) and length (number of blocks) are
required
ā€¢ Problems include finding space for file,
knowing file size, external
fragmentation, need for compaction
off-line (downtime) or on-line
Linked.
Linked allocation
ā€¢ Linked allocation ā€“ each file a linked list of blocks o File
ends at nil pointer
ā€¢ No external fragmentation
ā€¢ Each block contains pointer to next block
ā€¢ No compaction, external fragmentation
ā€¢ Free space management system called when new block
needed
ā€¢ Improve efficiency by clustering blocks into groups but
increases internal fragmentation
ā€¢ Reliability can be a problem
ā€¢ Locating a block can take many I/O s and disk seeks FAT
(File Allocation Table) variation
ā€¢ Beginning of volume has table, indexed by block number
ā€¢ Much like a linked list, but faster on disk and cacheable
File allocation table
Indexed allocation
ā€¢ Each file has its own index block(s) of pointers to its data blocks
ā€¢ The indexed allocation method is the solution to the problem of both contiguous and linked
allocation.
ā€¢ This is done by bringing all the pointers together into one location called the index block.
ā€¢ Of course, the index block will occupy some space and thus could be considered as an overhead of
the method.
ā€¢ In indexed allocation, each fi le has its own index block, which is an array of disk sector of
addresses.
ā€¢ The ith entry in the index block points to the ith sector of the file.
ā€¢ The directory contains the address of the index block of a file.
ā€¢ To read the ith sector of the fi le, the pointer in the ith index block entry is read to find the desired
sector.
ā€¢ Indexed allocation supports direct access, without suffering from external fragmentation.
ā€¢ Any free block anywhere on the disk may satisfy a request for more space.
Indexed allocation
Thank
you

More Related Content

Similar to File System Organization and Management

File Management
File ManagementFile Management
File ManagementRamasubbu .P
Ā 
File Systems
File SystemsFile Systems
File SystemsShipra Swati
Ā 
File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating systemEthiopia Satlliet television
Ā 
file management
file managementfile management
file managementSalisu Nura
Ā 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptxYogapriyaJ1
Ā 
File management in OS
File management in OSFile management in OS
File management in OSBhavik Vashi
Ā 
File system1.pptx
File system1.pptxFile system1.pptx
File system1.pptxSamar954063
Ā 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and DeadlocksRohit Jain
Ā 
CNIT 121: 13 Investigating Mac OS X Systems
CNIT 121: 13 Investigating Mac OS X SystemsCNIT 121: 13 Investigating Mac OS X Systems
CNIT 121: 13 Investigating Mac OS X SystemsSam Bowne
Ā 
Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...NoorMustafaSoomro
Ā 
Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file managementKalai Selvi
Ā 
Operations on a directory 54(3
Operations on a directory 54(3Operations on a directory 54(3
Operations on a directory 54(3myrajendra
Ā 
File and directory
File and directoryFile and directory
File and directorySunil Kafle
Ā 
Wk 1 - File organization.pptx
Wk 1 - File organization.pptxWk 1 - File organization.pptx
Wk 1 - File organization.pptxDORCASGABRIEL1
Ā 

Similar to File System Organization and Management (20)

10 File System
10 File System10 File System
10 File System
Ā 
File Management
File ManagementFile Management
File Management
Ā 
File Systems
File SystemsFile Systems
File Systems
Ā 
File Management
File ManagementFile Management
File Management
Ā 
File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating system
Ā 
file management
file managementfile management
file management
Ā 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
Ā 
File management in OS
File management in OSFile management in OS
File management in OS
Ā 
File system1.pptx
File system1.pptxFile system1.pptx
File system1.pptx
Ā 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
Ā 
Systems Programming - File IO
Systems Programming - File IOSystems Programming - File IO
Systems Programming - File IO
Ā 
Windowsforensics
WindowsforensicsWindowsforensics
Windowsforensics
Ā 
Chapter 3
Chapter 3Chapter 3
Chapter 3
Ā 
CNIT 121: 13 Investigating Mac OS X Systems
CNIT 121: 13 Investigating Mac OS X SystemsCNIT 121: 13 Investigating Mac OS X Systems
CNIT 121: 13 Investigating Mac OS X Systems
Ā 
Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...
Ā 
Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
Ā 
Operations on a directory 54(3
Operations on a directory 54(3Operations on a directory 54(3
Operations on a directory 54(3
Ā 
File and directory
File and directoryFile and directory
File and directory
Ā 
File structure
File structureFile structure
File structure
Ā 
Wk 1 - File organization.pptx
Wk 1 - File organization.pptxWk 1 - File organization.pptx
Wk 1 - File organization.pptx
Ā 

More from bcanawakadalcollege

More from bcanawakadalcollege (20)

Intro to Javascript.pptx
Intro to Javascript.pptxIntro to Javascript.pptx
Intro to Javascript.pptx
Ā 
computer and software are changing.pptx
computer and software are changing.pptxcomputer and software are changing.pptx
computer and software are changing.pptx
Ā 
tIME LINE.pptx
tIME LINE.pptxtIME LINE.pptx
tIME LINE.pptx
Ā 
Basic HTML Tags.PPT
Basic HTML Tags.PPTBasic HTML Tags.PPT
Basic HTML Tags.PPT
Ā 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
Ā 
Confusion and Diffusion.pptx
Confusion and Diffusion.pptxConfusion and Diffusion.pptx
Confusion and Diffusion.pptx
Ā 
cypher tex.ppt
cypher tex.pptcypher tex.ppt
cypher tex.ppt
Ā 
17javascript.ppt
17javascript.ppt17javascript.ppt
17javascript.ppt
Ā 
Logic gates and boolean algebra.ppt
Logic gates and boolean algebra.pptLogic gates and boolean algebra.ppt
Logic gates and boolean algebra.ppt
Ā 
Cyber_Crime_Security.pptx
Cyber_Crime_Security.pptxCyber_Crime_Security.pptx
Cyber_Crime_Security.pptx
Ā 
cybercrime_presentation - Copy.ppt
cybercrime_presentation - Copy.pptcybercrime_presentation - Copy.ppt
cybercrime_presentation - Copy.ppt
Ā 
Hidden Surface Removal methods.pptx
Hidden Surface Removal methods.pptxHidden Surface Removal methods.pptx
Hidden Surface Removal methods.pptx
Ā 
Hidden Surface Removal.pptx
Hidden Surface Removal.pptxHidden Surface Removal.pptx
Hidden Surface Removal.pptx
Ā 
Lecture6.orig.ppt
Lecture6.orig.pptLecture6.orig.ppt
Lecture6.orig.ppt
Ā 
Bezier Curve in Computer Graphics.docx
Bezier Curve in Computer Graphics.docxBezier Curve in Computer Graphics.docx
Bezier Curve in Computer Graphics.docx
Ā 
reliable_unreliable.pptx
reliable_unreliable.pptxreliable_unreliable.pptx
reliable_unreliable.pptx
Ā 
2D-transformation-1.pdf
2D-transformation-1.pdf2D-transformation-1.pdf
2D-transformation-1.pdf
Ā 
computer graphics unit 1-I.pptx
computer graphics unit 1-I.pptxcomputer graphics unit 1-I.pptx
computer graphics unit 1-I.pptx
Ā 
CG_1.pdf
CG_1.pdfCG_1.pdf
CG_1.pdf
Ā 
2- THE CHANGING NATURE OF SOFTWARE.pdf
2- THE CHANGING NATURE OF SOFTWARE.pdf2- THE CHANGING NATURE OF SOFTWARE.pdf
2- THE CHANGING NATURE OF SOFTWARE.pdf
Ā 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
Ā 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
Ā 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
Ā 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
Ā 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
Ā 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
Ā 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
Ā 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
Ā 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
Ā 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
Ā 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
Ā 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
Ā 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
Ā 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
Ā 
18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdfssuser54595a
Ā 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
Ā 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
Ā 

Recently uploaded (20)

9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
Ā 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
Ā 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
Ā 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
Ā 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
Ā 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
Ā 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
Ā 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
Ā 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
Ā 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Ā 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
Ā 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
Ā 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
Ā 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Ā 
Model Call Girl in Bikash Puri Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Bikash Puri  Delhi reach out to us at šŸ”9953056974šŸ”Model Call Girl in Bikash Puri  Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Bikash Puri Delhi reach out to us at šŸ”9953056974šŸ”
Ā 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
Ā 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Ā 
18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAŠ”Y_INDEX-DM_23-1-final-eng.pdf
Ā 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
Ā 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
Ā 

File System Organization and Management

  • 2. File system ā€¢ A file system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them. ā€¢ File systems may use a data storage device such as a hard disk or CD- ROM and involve maintaining the physical location of the files, ā€¢ they might provide access to data on a fi le server by acting as clients for a network protocol or ā€¢ they may be virtual and exist only as an access method for virtual data
  • 3. File Concept ā€¢ Computers can store information on various storage media such as, magnetic disks, magnetic tapes, optical disks. ā€¢ The physical storage is converted into a logical storage unit by operating system. ā€¢ The logical storage unit is called FILE. ā€¢ A file is a collection of similar records. ā€¢ A record is a collection of related fields that can be treated as a unit by some application program. ā€¢ A field is some basic element of data. ā€¢ Any individual field contains a single value. A data base is collection of related data.
  • 4. File Concept ā€¢ Contiguous logical address space ā€¢ Types: ā€¢ Data ā€¢ numeric ā€¢ character ā€¢ binary ā€¢ Program ā€¢ Contents defined by fileā€™s creator ā€¢ Many types ā€¢ Consider text file, source file, executable file
  • 5. File Attributes ā€¢ Name ā€“ only information kept in human-readable form ā€¢ Identifier ā€“ unique tag (number) identifies file within file system ā€¢ Type ā€“ needed for systems that support different types ā€¢ Location ā€“ pointer to file location on device ā€¢ Size ā€“ current file size ā€¢ Protection ā€“ controls who can do reading, writing, executing ā€¢ Time, date, and user identification ā€“ data for protection, security, and usage monitoring ā€¢ Information about files are kept in the directory structure, which is maintained on the disk ā€¢ Many variations, including extended file attributes such as file checksum ā€¢ Information kept in the directory structure
  • 6. File operations: File is an abstract data type ā€¢ 1. Creating a file : Two steps are needed to create a file. ā€¢ They are: ā€¢ 1. Check whether the space is available or not. ā€¢ 2. If the space is available then made an entry for the new file in the directory. The entry includes name of the file, path of the file, etcā€¦ ā€¢ 2. Writing a file : To write a file, we have to know 2 things. ā€¢ One is name of the file and ā€¢ second is the information or data to be written on the file, ā€¢ the system searches the entered given location for the file. ā€¢ If the file is found, the system must keep a write pointer to the location in the file where the next write is to take place. ā€¢ 3. Reading a file : To read a file, first of all we search the directories for the file, ā€¢ if the file is found, the system needs to keep a read pointer to the location in the file where the next read is to take place. ā€¢ Once the read has taken place, the read pointer is updated. ā€¢ 4. Repositioning within a file : The directory is searched for the appropriate entry and the current file position pointer is repositioned to a given value. ā€¢ This operation is also called file seek. ā€¢ 5. Deleting a file : To delete a file, first of all search the directory for named file, then released the file space and erase the directory entry. ā€¢ 6. Truncating a file : To truncate a file, remove the file contents only but, the attributes are as it is.
  • 7. File Types ā€“ Name, Extension
  • 8. FILE ACCESS METHODS ā€¢ Files stores information, this information must be accessed and read into computer memory. ā€¢ There are so many ways that the information in the file can be accessed. ā€¢ 1. Sequential file access: Information in the file is processed in order i.e. one record after the other. ā€¢ Magnetic tapes are supporting this type of file accessing. ā€¢ Eg : A file consisting of 100 records, the current position of read/write head is 45th record, suppose we want to read the 75th record then, it access sequentially from 45, 46, 47 ā€¦ā€¦.. 74, 75. ā€¢ So the read/write head traverse all the records between 45 to 75.
  • 9. Direct access: ā€¢ 2. Direct access: Direct access is also called relative access. ā€¢ Here records can read/write randomly without any order. ā€¢ The direct access method is based on a disk model of a file, because disks allow random access to any file block. ā€¢ Eg : A disk containing of 256 blocks, the position of read/write head is at 95th block. ā€¢ The block is to be read or write is 250th block. ā€¢ Then we can access the 250th block directly without any restrictions. ā€¢ Eg : CD consists of 10 songs, at present we are listening song 3, If we want to listen song 10, we can shift to 10.
  • 10.
  • 11. 3. Indexed Sequential File access ā€¢ The main disadvantage in the sequential file is, it takes more time to access a Record . ā€¢ Records are organized in sequence based on a key field. ā€¢ Eg : A file consisting of 60000 records, the master index divide the total records into 6 blocks, each block consisting of a pointer to secondary index. ā€¢ The secondary index divide the 10,000 records into 10 indexes. ā€¢ Each index consisting of a pointer to its original location. ā€¢ Each record in the index file consisting of 2 field, A key field and a pointer field.
  • 13. DIRECTORY STRUCTURE ā€¢ The directories themselves are simply files indexing other files, which may in turn be directories ā€¢ if a hierarchical indexing scheme is used. ā€¢ Sometimes the file system consisting of millions of files, at that situation it is very hard to manage the files. ā€¢ To manage these files, grouped these files and load one group into one partition. ā€¢ Each partition is called a directory . ā€¢ a directory structure provides a mechanism for organizing many files in the file system.
  • 14. Directory structureā€¦ ā€¢ The typical contents of a directory are: ā€¢ 1. file name (string uniquely identifying the fi le), type (e.g. text, binary data, executable, ā€¢ library), organization (for systems that support different organizations); ā€¢ 2. device (where the file is physically stored), size (in blocks), starting address on device (to ā€¢ be used by the device I/O subsystem to physically locate the file); ā€¢ 3. creator, owner, access information (who is allowed to access the file, and what they may do with it); ā€¢ 4. date of creation/of last modification; ā€¢ 5. locking information (for the system that provide fi le/record locking).
  • 15. OPERATION ON THE DIRECTORIES : ā€¢ 1. Searchfor a file:Searcha directorystructureforrequiredfile. ā€¢ 2. createafile: Newfilesneedtobe created,addedtothe directory. ā€¢ 3. Delete a file:Whena fileis nolongerneeded,wewantto removeitfromthe directory. ā€¢ 4. Lista directory:We canknow thelistoffilesinthe directory. ā€¢ 5. Rename afile: Wheneverwe needtochangethe nameofthe file,wecanchangethe name. ā€¢ 6. Traversethe filesystem: We needtoaccesseverydirectoryandeveryfilewithina directorystructurewecan traversethe filesystem
  • 16.
  • 17. various directory structures ā€¢ In single level directory all files are contained in the same directory. It is easy to support and ā€¢ understand. It has some limitations like: ā€¢ 1. Large number of files (naming). ā€¢ 2. Ability to support different users/topics (grouping). The problem here is different users may accidentally use the same names for their files. E.g : If user 1 creates a files called sample and then later user 2 to creates a file called sample, then user2ā€™s file will overwrite user 1 file. That's why it is not used in the multi user system.
  • 18. Two Level Directory ā€¢ In two level directory structure one is master file directory and the other is user file directory. ā€¢ Here each user has their own user file directory. ā€¢ Each entry in the master file directory points to a user fi le directory. ā€¢ Each user has rights to access their own directory but canā€™t access other userā€™s directory, if permission is not given by the owner of the second one.
  • 19. ā€¢ To avoid this problem each user need a private directory, ā€¢ Names chosen by one user don't interfere with names chosen by a different user.
  • 20. Tree Level Directory ā€¢ In Tree level directory the directory structure is a tree with arbitrary height. ā€¢ Here users may create their own subdirectories. ā€¢ Two level directory eliminates name conflicts among users but it is not satisfactory for users with a large number of files. ā€¢ To avoid this create the sub-directory and load the same type of files into the sub-directory. ā€¢ so, here each can have as many directories are needed. There are 2 types of path ā€¢ 1. Absoulte path ā€¢ 2. Relative path ā€¢ Absoulte path : Begging with root and follows a path down to specified files giving directory, directory name on the path. ā€¢ Relative path : A path from current directory.
  • 21. ā€¢ Absolute or relative path name ā€¢ Creating a new file is done in current directory ā€¢ Delete a file rm <file-name> ā€¢ Creating a new subdirectory is done in current directory mkdir <dir-name> Example: if in current directory /mail mkdir count Deleting ā€œmailā€ ļƒž deleting the entire subtree rooted by ā€œmailā€
  • 22. Acyclic graphdirectory ā€¢ Multiple users are working on a project, the project files can be stored in a common sub-directory of the multiple users. ā€¢ This type of directory is called acyclic graph directory . ā€¢ The common directory will be declared a shared directory. ā€¢ The graph contain no cycles with shared files, changes made by one user are made visible to other users. ā€¢ A file may now have multiple absolute paths. ā€¢ when shared directory/file is deleted, all pointers to the directory/ files also to be removed.
  • 23. General graph directory: ā€¢ When we add links to an existing tree structured directory, the tree structure is destroyed, resulting is a simple graph structure. ā€¢ How do we guarantee no cycles? ā€¢ Allow only links to file not subdirectories ā€¢ Garbage collection ā€¢ Every time a new link is added use a cycle detection algorithm to determine whether it is OK ā€¢
  • 24. File allocation methods ā€¢ An allocation method refers to how disk blocks are allocated for files. ā€¢ One main problem in file management is how to allocate space for files so that disk space is utilized effectively and files can be accessed quickly. ā€¢ Three major methods of allocating disk space are contiguous, linked, and indexed. Each method has its advantages and disadvantages. ā€¢ Accordingly, some systems support all three (e.g. Data Generalā€™s RDOS). More commonly, a ā€¢ system will use one particular method for all files.
  • 25. Contiguous allocation ā€¢ The contiguous allocation method requires each file to occupy a set of contiguous address on the disk. ā€¢ Disk addresses define a linear ordering on the disk. ā€¢ each file occupies set of contiguous blocks ā€¢ Best performance in most cases ā€¢ Simple ā€“ only starting location (block #) and length (number of blocks) are required ā€¢ Problems include finding space for file, knowing file size, external fragmentation, need for compaction off-line (downtime) or on-line Linked.
  • 26. Linked allocation ā€¢ Linked allocation ā€“ each file a linked list of blocks o File ends at nil pointer ā€¢ No external fragmentation ā€¢ Each block contains pointer to next block ā€¢ No compaction, external fragmentation ā€¢ Free space management system called when new block needed ā€¢ Improve efficiency by clustering blocks into groups but increases internal fragmentation ā€¢ Reliability can be a problem ā€¢ Locating a block can take many I/O s and disk seeks FAT (File Allocation Table) variation ā€¢ Beginning of volume has table, indexed by block number ā€¢ Much like a linked list, but faster on disk and cacheable
  • 28. Indexed allocation ā€¢ Each file has its own index block(s) of pointers to its data blocks ā€¢ The indexed allocation method is the solution to the problem of both contiguous and linked allocation. ā€¢ This is done by bringing all the pointers together into one location called the index block. ā€¢ Of course, the index block will occupy some space and thus could be considered as an overhead of the method. ā€¢ In indexed allocation, each fi le has its own index block, which is an array of disk sector of addresses. ā€¢ The ith entry in the index block points to the ith sector of the file. ā€¢ The directory contains the address of the index block of a file. ā€¢ To read the ith sector of the fi le, the pointer in the ith index block entry is read to find the desired sector. ā€¢ Indexed allocation supports direct access, without suffering from external fragmentation. ā€¢ Any free block anywhere on the disk may satisfy a request for more space.