Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore MCA613_System Programming and Operating System

MCA613_System Programming and Operating System

Published by Teamlease Edtech Ltd (Amita Chitroda), 2020-10-23 10:20:48

Description: MCA613_System Programming and Operating System

Search

Read the Text Version

File Systems 243 Various file systems have different forms of storing this information. For example, the FAT file system stores this info in a File Allocation Table (FAT), whereas the NTFS file system stores it in a Master File Table (MFT). When a computer needs to read a file, it first goes to the info about files and folders and searches for the record of that file. Then, it looks up the address of the file, goes to the specified place on the disk, and then reads the file data. For contiguous files, where the data is grouped together on the disk, this process is very straightforward. However, files on the disk may be fragmented. That is, they may occupy several non-adjacent disk areas. This is more common than most users realize. After all, when you view a file from Windows Explorer or Finder, it is always represented as a single file. This is because the file system is doing all the work of piecing together the fragments behind the scenes. The info about files and folders stores the addresses of each fragmented piece of data so they can be quickly and reliably retrieved when the computer needs to read the file. This information and how it’s retrieved plays an important role in file recovery. When a computer wants to delete a file, it doesn’t immediately destroy its data. Instead, it makes some changes to the info about files and folders to designate that the file has been deleted. Some operating systems simply mark the file as deleted, retaining all the meta-data about the file until it becomes necessary to overwrite it with meta-data about a new file. This is how Windows file systems handle deletions. Other operating systems, like Mac OS X, completely destroy the file record of the deleted file. While operating systems vary in whether they preserve or delete the info about files and folders immediately, all operating systems leave the actual file data untouched until it becomes necessary to allocate that disk space for another file. If no files are going to be written to the disk, the data information about the file and its data may remain forever. As noted above, the portion of the disk that stores the file data also contains a backup copy of the info about files and folders. This part of the disk may also contain some additional pieces of information about file and folder structure scattered across the entire disk. CU IDOL SELF LEARNING MATERIAL (SLM)

244 System Programming and Operating System File recovery Methods Before we discuss the different methods for file recovery, it’s important to note one thing: If the data on the disk is overwritten, then the old data is gone. No program or commercially available data recovery method can recover it. This is why it’s of the utmost importance that no new files are written to a disk prior to attempting a data recovery. For files that have not been overwritten, there are two file recovery methods. All data recovery software use one or both of these techniques. Method One: File recovery through analysis of the info about files and folders This is the first method that a file recovery program attempts to perform. This is because it can recover files with their original names, paths, date/time stamps, and their data (if successful). The file recovery software starts by trying to read and process the first copy of the info about files and folders. In some cases (such as accidental file deletion), this is the only step that needs to be taken in order to recover the files in their entirety. If the first copy of the info about files and folders is severely damaged, the software scans the disk for the second copy of the info about files and folders. It also attempts to glean additional information about the folders and files structure that may be on the data part of the disk. Then, it processes all this information to reconstruct the original folders and file structure. If the file system on the disk isn’t severely damaged, it is often possible to recover the entire file and folder structure. If the file system on the disk is severely damaged, this recovery method cannot recreate the entire folder structure. Then recovered files will appear in “orphaned” folders. Fig. 11.26 shows these “orphaned” folders in R-Studio. CU IDOL SELF LEARNING MATERIAL (SLM)

File Systems 245 Fig. 11.26: Recovered files and folders structure and “orphaned” folders Method Two: File recovery using search for known file types (raw file recovery) If the first method fails to produce satisfactory results, a raw file search is performed. This second data recovery method can recover file data with greater success than the first method, but it cannot reconstruct the original file names, date/time stamps or the entire folder and file structure of the disk. A search for known file types, or raw file recovery, works by analyzing the contents of the disk for “file signatures.” File signatures are common patterns that signify the beginning or end of a file. Almost every file type has at least one file signature. For example, all files of the png (portable network graphics) file type start with the “‰PNG” string and many MP3 files start with the “ID3” string. Such file signatures can be used to recognize that a piece of data on the disk belongs to a certain file type and can therefore be recovered. After performing a raw file search, R-Studio and R-Undelete will show possibly recoverable files as “Extra Found Files.” These are assigned file extensions based on the identified file signature and given placeholder filenames (sequential numbers). See Fig. 11.27 and Fig. 11.28. CU IDOL SELF LEARNING MATERIAL (SLM)

246 System Programming and Operating System Fig. 11.27: Files recovered using search for Known File Types (Extra Found Files) that are found inside a logical disk Fig. 11.28: Files recovered using search for Known File Types (Extra Found Files) that are found outside a logical disk CU IDOL SELF LEARNING MATERIAL (SLM)

File Systems 247 Limitations of Raw File Recovery Although this method is usually the best technique for recovering data from a heavily damaged file system<, there are some limitations. First is the fact that some file types have a “beginning” and “end” file signature, some have only a “beginning” file signature (and no “end” file signature) and some file types have no immediately recognizable file signature at all. If the data recovery software can identify the “beginning” and “end” file signature, the file can easily be identified and recovered. For files that do not have an “end” file signature, the software can sometimes recover the file by assuming that it ends at the beginning of the next file. For files with no signature, like encrypted disk containers, a raw file search won’t be able to distinguish the data from pieces of unallocated disk space. Each of these circumstances is further complicated by file fragmentation. Furthermore, files without end file signatures may have long “garbage” trails after recovery. Fig. 11.29 illustrates why. Data of File 1 Data of File 2 Data of File 3 Data of File 2 Data of File 4 Unallocated Data of File N File beginning File beginning (Part 1) (part 2) File beginning space File beginning signature signature File beginning File end signature signature File beginning File end File beginning File end File beginning File end File beginning signature signature File beginning File end Fig. 11.29: File data on the disk 11.10 Summary  A file is a named collection of related information that is recorded on secondary storage such as magnetic disks, magnetic tapes and optical disks. In general, a file is a sequence of bits, bytes, lines or records whose meaning is defined by the files creator and user.  File management is defined as the process of manipulating files in computer system, its management includes the process of creating, modifying and deleting the files.  File Access Methods: When a file is used, information is read and accessed into computer memory and there are several ways to access this information of the file. Some systems provide only one access method for files. Other systems, such as those of IBM, support many access methods, and choosing the right one for a particular application is a major design problem. CU IDOL SELF LEARNING MATERIAL (SLM)

248 System Programming and Operating System There are three ways to access a file into a computer system: (a) Sequential-Access, (b) Direct Access, (c) Index sequential Method.  A File Structure should be according to a required format that the operating system can understand. (a) A file has a certain defined structure according to its type. (b) A text file is a sequence of characters organized into lines. (c) A source file is a sequence of procedures and functions. (d) An object file is a sequence of bytes organized into blocks that are understandable by the machine. (e) When operating system defines different file structures, it also contains the code to support these file structure. Unix, MS-DOS support minimum number of file structure.  Allocation Methods: There are various methods which can be used to allocate disk space to the files. Selection of an appropriate allocation method will significantly affect the performance and efficiency of the system. Allocation method provides a way in which the disk will be utilized and the files will be accessed. There are following methods which can be used for allocation. (a) Contiguous Allocation. (b) Extents. (c) Linked Allocation. (d) Clustering. (e) FAT. (f) Indexed Allocation. (g) Linked Indexed Allocation. (h) Multilevel Indexed Allocation. CU IDOL SELF LEARNING MATERIAL (SLM)

File Systems 249  Free Space Management: The process of looking after and managing the free blocks of the disk is called free space management. There are some methods or techniques to implement a free space list. These are as follows: (a) Bitmap (b) Linked list (c) Grouping (d) Counting  File Sharing: File sharing is the practice of sharing or offering access to digital information or resources, including documents, multimedia (audio/video), graphics, computer programs, images and e-books. It is the private or public distribution of data or resources in a network with different levels of sharing privileges.  Backup and recovery: It describes the process of creating and storing copies of data that can be used to protect organizations against data loss. This is sometimes referred to as operational recovery. Recovery from a backup typically involves restoring the data to the original location, or to an alternate location where it can be used in place of the lost or damaged data. A proper backup copy is stored in a separate system or medium, such as tape, from the primary data to protect against the possibility of data loss due to primary hardware or software failure. 11.11 Key Words/Abbreviations  Directory: Information about files is maintained by Directories. A directory can contain multiple files. It can even have directories inside of them. In Windows we also call these directories as folders.  File Attributes: It specifies the characteristics of the files such as type, date of last modification, size, location on disk etc. file attributes help the user to understand the value and location of files. File attributes is one most important feature. It uses to describe all the information regarding particular file. CU IDOL SELF LEARNING MATERIAL (SLM)

250 System Programming and Operating System 11.12 Learning Activity 1. Explain the issues taken care by file system. ----------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------- 2. Explain the allocations methods in file system. ----------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------- 11.13 Unit End Questions (MCQ and Descriptive) A. Descriptive Types Questions 1. What is file system? 2. What are different access methods of File? 3. Explain File system Structure. 4. Explain Directory Structure in detail. 5. Explain different file allocation methods. 6. Explain different methods of free space management. 7. Explain File sharing in detail. 8. Explain File Protection and Recovery in detail. 9. Explain different File Recovery methods. B. Multiple Choice/Objective Type Questions 1. File type can be represented by __________. (a) file name (b) file extension (c) file identifier (d) None of the mentioned CU IDOL SELF LEARNING MATERIAL (SLM)

File Systems 251 2. Access in which records are accessed from and inserted into file, is classified as (a) Direct access (b) Sequential access (c) Random access (d) Duplicate access 3. The file structure that redefines its first record at a base of zero uses the term (a) Relative organization (b) Key fielding (c) Dynamic allocation (d) Hashing 4. Typically, _________ is on an individual block basis where each block contains a pointer to the next block in the chain. (a) chained allocation (b) indexed allocation (c) contiguous allocation (d) variable allocation 5. In free space management, __________ method has negligible space overhead because there is no need for a disk allocation table, merely for a pointer to the beginning of the chain and the length of the first portion. (a) bit tables (b) chained Free Portions (c) indexing (d) free block list Answers 1. (b), 2. (b), 3. (a), 4. (a), 5. (b) 11.14 References Reference Books 1. https://www.amazon.com/Practical-System-Design-Dominic-Giampaolo- ebook/dp/B008I3ARBI 2. https://bookboon.com/en/an-introduction-to-windows-operating-system-ebook Web Resources 1. https://www.tutorialspoint.com/operating_system/os_file_system.htm 2. https://www.geeksforgeeks.org/file-access-methods-in-operating-system/ 3. https://www.techopedia.com/definition/16256/file-sharing 4. https://www.studytonight.com/operating-system/file-system CU IDOL SELF LEARNING MATERIAL (SLM)

252 System Programming and Operating System CU IDOL SELF LEARNING MATERIAL (SLM)


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook