Operating Systems File Management.

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

File Management.
More on File Management
Chapter 4 : File Systems What is a file system?
Free Space and Allocation Issues
File Systems.
File Management Lecture 3.
Allocation Methods - Contiguous
File Systems Examples.
Chapter 10: File-System Interface
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
File Management Systems
Lecture 10: The FAT, VFAT, and NTFS Filesystems 6/17/2003 CSCE 590 Summer 2003.
File management in UNIX and windows 2000
Ceng Operating Systems
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
1 File Management in Representative Operating Systems.
1 Friday, July 07, 2006 “Vision without action is a daydream, Action without a vision is a nightmare.” - Japanese Proverb.
Operating Systems File systems
Wince File systems. File system on embedded File system choice on embedded is important –File system size can be an issue –Different media are used –
Guide To UNIX Using Linux Third Edition
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Guide To UNIX Using Linux Fourth Edition
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Unix File System Internal Structures By C. Shing ITEC Dept Radford University.
LIS508 lecture 5: storage devices Thomas Krichel
Chapter 8 File Management
BACS 371 Computer Forensics
File Systems (1). Readings r Silbershatz et al: 10.1,10.2,
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
1Fall 2008, Chapter 11 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple.
Bits, Bytes, Files, Hard Drives. Bits, Bytes, Letters and Words ● Bit – single piece of information ● Either a 0 or a 1 ● Byte – 8 bits of information.
IOS110 Introduction to Operating Systems using Windows Session 5 1.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
Chapter Two Exploring the UNIX File System and File Security.
File System Management File system management encompasses the provision of a way to store your data in a computer, as well as a way for you to find and.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
File Storage Organization The majority of space on a device is reserved for the storage of files. When files are created and modified physical blocks are.
Linux+ Guide to Linux Certification, Third Edition
CE Operating Systems Lecture 17 File systems – interface and implementation.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems File systems.
File system In computing, a file system is a method of storing and organizing computer files and the data they contain to make it easy to find and access.
Lecture 19 Linux/Unix – File System
NTFS Filing System CHAPTER 9. New Technology File System (NTFS) Started with Window NT in 1993, Windows XP, 2000, Server 2003, 2008, and Window 7 also.
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
W4118 Operating Systems Instructor: Junfeng Yang.
SVBIT SUBJECT:- Operating System TOPICS:- File Management
Day 28 File System.
File System Implementation
Chapter 11: File System Implementation
Chapter 12: File System Implementation
Day 27 File System.
Chapter 11: File System Implementation
Filesystems.
File Management.
Exploring the UNIX File System and File Security
Chapter 11: File System Implementation
File Managements.
Chapter 11: File System Implementation
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
File-System Structure
Modern PC operating systems
Chapter 11: File System Implementation
Department of Computer Science
Chapter 5 File Systems -Compiled for MCA, PU
Presentation transcript:

Operating Systems File Management

What Is A File? Named collection of data stored on hard disk, CD-ROM etc. Can be programs (both source and object forms) or data. The UNIX/Linux and Windows OS’s do not know anything about the file structure. The application program associated with the file knows how to interpret the file. Interpretation logged by OS

What Is File Management? The creation and deletion of files. The creation and deletion of directories/ folders. The manipulation of files and directories The mapping of files onto disk storage. Backup of files on stable (non volatile) storage.

What is a Directory / Folder? A logical grouping of files. Actually a special type of file. Directories can contain other directories known as sub-directories, creating a tree structure. Hierarchical UNIX/Linux uses the term directory, Windows uses the term folder.

Example of a Directory Structure Windows Explorer The yellow icons are directories (folders). The plus (+) sign next to the directory indicates that it contains sub-directories.

Pathnames In order to uniquely specify a file in a tree-structured directory, a pathname must be used. A pathname prefixes the filename with a list of the directories from the base directory which have to be traversed in order to reach the file. The pathname separator is the forward-slash (/) in UNIX/Linux and the backslash (\) in Windows. At any instant, a process has a current directory, which is where the operating system will look for a file whose pathname is not specified.

Pathname Examples UNIX/Linux Windows Full pathname - /cprogs/work/file1.txt Relative pathname - work/file1.txt Windows Full pathname - C:\CPROGS\WORK\FILE1.TXT Relative pathname – WORK\FILE1.TXT

Common Directory Commands FUNCTION UNIX/Linux Windows/DOS Change Directory cd CD CHDIR Make Directory mkdir MD MKDIR Remove Directory rmdir RD RMDIR List Directory Contents ls DIR Display Current Directory pwd

File Naming UNIX/Linux File names are case-sensitive. File name can be up to 255 characters in length. File name can contain any character except /. Characters that have special meaning to the shell (* > < ? \ ; : | [ ] ( )) should not be included in a file name. Linux does allow spaces in the file name, other flavours of UNIX may not.

File Naming Windows File names are not case sensitive, but the case will be preserved. File name can be up to 255 characters in length. File name can contain any character except / \ “ ; * ? < > |. The portion of the file name after the last dot (.) is known as the extension. The extension is used to specify the nature of the file. Windows also maintains a short file name using the first 8 characters of the file name and the first three characters of the extension.

File Naming Both UNIX/Linux and Windows allow a file to be referenced using wildcard characters. In both OS’s - * can be replaced by zero or more characters; ? can be replaced by one character. UNIX/Linux also supports more complex wild-carding. [a,b,c] - character can be either a, b or c. [a-d] - character can be either a,b,c or d [a-d,f] – character can be either a,b,c,d or f

Hard Disk Partitioning Partitioning is a means of sub-dividing a hard disk. A hard disk must contain at least one partition. There are two types of partitions – primary and extended. A disk can contain up to 4 primary partitions or up to 3 primary and 1 extended partition. One primary partition may be designated as active, this will be used for booting the computer. Different operating systems can be installed on different primary partitions – allowing multi-booting. An extended partition cannot be accessed directly by the operating system but is instead sub-divided into logical drives.

Hard Disk Partitioning In UNIX/Linux the fdisk command is used to manage hard disk partitions. In Windows 2000+ use the DISKPART command or the Disk Management tool.

Hard Disk Initialization In order to be usable by the OS a partition must be initialized. In UNIX/Linux the mkfs command is used, in Windows the command is FORMAT. The initialisation process sets up the necessary structures on a disk partition. In UNIX/Linux an initialized partition is referred to as a file system on Windows it is called a drive.

File Space Allocation Disk space is dynamically allocated to files. Space is allocated in units of fixed size called allocation units or clusters. When a new file is created, it is allocated one cluster. As the file is extended the cluster eventually becomes filled and more clusters are assigned to the file.

File Space Allocation A B C Ideally, successive file clusters should occupy contiguous space on the disk. In general, the disk will contain many different files whose clusters are intermingled with each other. Clusters are released when a file is deleted or shrunk, so free clusters may be intermingled with allocated clusters. A B C End of file A Free cluster End of file B

UNIX/Linux File System 4 classes of files: regular file. directory. character or block special file: device such as a disk, printer, terminal. named pipe: queuing buffer which passes the output of one process to the input of another.

UNIX/Linux File System A file is described by an information block called an inode. Every file on disk has an associated inode. Kernel memory contains a copy of the inode for every open file. A directory entry holds the filename and a reference to its associated inode or its inode number.

UNIX/Linux File System The inode contains all information about a file, except its name. This information includes File access and type information, collectively known as the mode. File ownership information. Time stamps for last modification, last access and last mode modification. File size in bytes. Addresses of physical blocks.

UNIX/Linux File System - Inodes The inode records which disk blocks/clusters have been allocated to a file. This information is stored in 13 “pointers” in the inode structure. The first 10 are direct pointers – they map directly to the physical address of a block of a file. The other 3 pointers point to index blocks which themselves contain lists of pointers. The pointers in the index blocks reference either data blocks or further index blocks.

UNIX/Linux File System – Volume Structure When the mkfs command is run to initialize a partition the following layout is created: Boot block: first stage boot program. Super block: contains details of disk size and allocation of inodes and data blocks. Inodes: storage space for inodes. Data Blocks: rest of disk available for directories and files.

UNIX/Linux File System – Free Space Control When the mkfs command is run it creates a chain of linked blocks. The super block contains the start block in the chain. Each block contains an array of free data block numbers and a pointer to the next block in the chain.

Windows File System Windows 2000+ supports 3 different file systems: FAT also called FAT16 FAT32 NTFS FAT and FAT32 are implemented similarly.

FAT16/FAT32 File System The FAT system maintains a table of entries known as the File Allocation Table (hence the name FAT). The table consists of an array of 16-bit (FAT16) or 32-bit (FAT32) values. The first value in the array identifies the disk system type and the second entry is set to all 1’s. Each of the remaining entries maps to a cluster on the disk.

FAT16/FAT32 File System Each entry records one of five things: the address of the next cluster in a chain a special end of file (EOF) character that indicates the end of a chain a special character to mark a bad cluster a special character to mark a reserved cluster a zero to note that that cluster is unused

FAT16/FAT32 File System Prior to any data being written to the disk, the FAT entries are all set to zero, indicating a free cluster. As file space is allocated, the FAT entries contain pointers to the next entry in the chain. When more file space is requested, the OS searches the FAT for an entry with a value of zero (unused) and allocates it to the file.

FAT16/FAT32 File System – Volume Structure When the FORMAT command is run on a partition to create a FAT file system, the following layout is created: Boot sector: details about the disk’s characteristics and a bootstrap loader. FAT: principal file allocation table. Additional FAT(s): Duplicate table(s) which are updated at the same time as the principal FAT. Root directory File space: The rest of the disk.

Disk Fragmentation Over time, allocation of clusters becomes less contiguous. Deletion and resizing of files may result in free clusters located in random positions on the disk. Such a situation is called fragmentation and can result in reduced performance of the computer. To correct this situation a defragmenting tool must be used which can put all the clusters of a file in contiguous locations and coalesce the free clusters.

Disk Fragmentation Windows comes with a disk defragmenting tool.