1 / 111

File Systems

File Systems. Guide to Operating Systems Second Edition. Objectives. After reading this chapter and completing the exercises you will be able to: Understand the basic functions common to all file systems

sauda
Télécharger la présentation

File Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. File Systems Guide to Operating Systems Second Edition Chapter 3

  2. Objectives After reading this chapter and completing the exercises you will be able to: • Understand the basic functions common to all file systems • Explain the design of the Windows 95 (FAT16) and Windows 95, Windows 98, and Windows Me (FAT32) file systems Chapter 3

  3. Objectives After reading this chapter and completing the exercises you will be able to: • Describe the Windows NT, Windows 2000, and Windows XP file system (NTFS) • Describe the design of the UNIX file system • Describe the basics of the Macintosh file system Chapter 3

  4. Understanding File System Functions • A file system is a design for storing and managing files on storage media • The file systems used by personal computer operating systems perform the following general functions: • Enable files to be organized through directories and folders • Partition and format disks to store and retrieve information • Establish file-naming conventions • Provide utilities for functions such as file compression and disk defragmentation • Provide for file and data integrity • Provide storage media management functions • Enable error recovery or prevention Chapter 3

  5. Understanding File System Functions • The overall purpose of a file system is to create a structure for filing data • A file is a set of data that is grouped in some logical manner, assigned a name, and stored on the disk • The data contained in files can be text, images, music and sounds, video, or Web pages for the Internet • But no matter what kind of data is stored in the file system, it must be converted into digital format—a series of 1s and 0s, or electrical signal “ons” and “offs” —that the computer understands Chapter 3

  6. Understanding File System Functions • There must be a way to write digital information onto disk, track it, update it when necessary, and call it back when the user, or a program under the user’s control, wants it • To achieve all this, the operating system typically groups disk sectors in some logical way, creates a record of this structure, and builds a directory to track the type of data stored in each file Chapter 3

  7. A File System Chapter 3

  8. Understanding File System Functions • In addition to the names of files and where to find them on the disk, directories also store the following information: • Date and time the directory or file was created (a timestamp for that directory or file) • Date and time the directory or file was last modified (another form of timestamp) • Directory or file size • Directory of file attributes, such as security information, or if the directory or file was backed up Chapter 3

  9. Understanding File System Functions • Figure 3-2 illustrates some of the information that is stored for a file in Windows XP, which can be displayed using Windows Explorer or My Computer Chapter 3

  10. Designing a Directory Structure • For users, one of the most important features of a file system is the ability to store information according to a pattern of organization that is enabled by the use of directories • In the early Windows systems and UNIX systems, files are organized by directories, while in later Windows versions and the Mac OS, these are called folders Chapter 3

  11. Designing a Directory Structure • Directories and folders can be organized in a hierarchy that is similar to a tree structure • Some personal computer users keep most of their files in the computer’s primary level or root directory, or they load all application software into a single directory Chapter 3

  12. Designing a Directory Structure • When you design a directory structure consider directories for the following: • Operating system files • Software applications • Work files, such as word processing, graphics, spreadsheets, and database files • Public files that you share over the network • Utilities files • Temporary files Chapter 3

  13. Designing a Directory Structure • The folder structure from the root might be as follows: • Winnt for the system files • Program Files for general software and utilities • Documents and Settings for work files such as spreadsheets and Word documents • Shared for spreadsheets that are shared over the network • Forms for specific types of forms used by the legal forms software • Inetpub for Web pages • Each major folder has subfolders to keep grouped files or applications software separate Chapter 3

  14. Sample Folder Structure for a Windows-based System Chapter 3

  15. Designing a Directory Structure • For UNIX systems, such as Red Hat Linux, a typical directory (or folder) structure is as follows: • bin for user programs and utilities (binary files) • lib for libraries • usr for user files and programs • var for files in which content often varies or that are used only temporarily • tmp for files used only temporarily • dev for devices • mnt for floppy drives, CD-ROM drives, and other removable media that can be mounted • Etc for system and configuration files • sbin for user programs and utilities (system binary files) • home for users’ home directories (or folders) • proc for system resource tracking Chapter 3

  16. Designing a Directory Structure • In the Mac OS, the default folder structure from the root includes: • Applications for software applications • System Folder for system files • Library for library files (such as fonts) • Users for user accounts • Documents for documents Chapter 3

  17. Disk Storage • When a hard disk is delivered from the manufacturer, it is low-level formatted • A low-level format is a software process that marks the location of disk tracks and sectors • Every disk is divided into tracks, which are like several circles around a disk • Each track is divided into sections of equal size called sectors • Figure 3-4 illustrates a hard disk divided into tracks and sectors Chapter 3

  18. Disk Tracks and Sectors Chapter 3

  19. Block Allocation • The operating systems discussed in this book use a method called block allocation to keep track of where specific files are stored on the disk • With block allocation the disk is divided into logical blocks (in MS-DOS and Windows these are called clusters), which are in turn mapped to sectors, heads, and tracks on the disk • The data regarding block allocation is stored on the disk itself, using two techniques Chapter 3

  20. Block Allocation • One technique uses a fixed portion of the disk to store this data, such as the FAT (file allocation table) file system used by MS-DOS and supported by all versions of Windows • The other technique uses various locations on the disk to store a special type of file that is used for directory and file allocation information, such as the New Technology File System (NTFS) and the UNIX file systems Chapter 3

  21. Partitions • Before a file system can be placed on a hard disk, the disk must be partitioned and formatted • Partitioning is the process of blocking a group of tracks and sectors to be used by a particular file system, such as FAT or NTFS • After a disk is partitioned, it must be high-level formatted (usually referred to as just formatted) so that the partition contains the disk divisions and patterns needed by a particular operating system to store files Chapter 3

  22. Partitions • Figure 3-5 illustrates a Windows 2000 system that has multiple partitions (FAT, NTFS, and compact disk file system (CDFS)) used for segmenting data on two hard disks and a CD-ROM drive Chapter 3

  23. Partitions • Partitioning can typically be done only on hard disks or large removable disks • Floppy disks and other low-capacity media do not support partitioning because there simply isn’t enough room on these low-capacity disks to make partitioning practical • On systems in the IBM/Intel PC hardware architecture, typically there is room to store information for up to four partitions on each disk Chapter 3

  24. Partitions • This area is known as the partition table in MS-DOS, Mac OS, and Windows, and the disk label in UNIX • In addition to the disk label and partition table, there is another piece of disk reserved, known as the boot block in UNIX, or the Master Boot Record (MBR) in MS-DOS and Windows • This area hold a tiny program used to begin booting an operating system from a disk Chapter 3

  25. The Basic MS-DOS File System • The first Microsoft file system, called the file allocation table (FAT) file system started with MS-DOS in the early eighties, and later versions of FAT are in many ways similar to the earliest version • FAT uses a file allocation table to store directory information about files, such as filenames, file attributes, and file location • MS-DOS versions prior to 4.0 use the FAT12 file system in which the maximum size of a file system is 32 MB Chapter 3

  26. The Basic MS-DOS File System • Beginning with MS-DOS 4.0, the FAT16 file system is used, in which the maximum size of a volume is 4 GB, and the maximum size for a file is 2 GB • Another important characteristic of FAT is its use of “8.3” filenames, which can be up to eight characters long, followed by a period and an extension of three characters, such as Filename.ext Chapter 3

  27. Partitioning • The FAT file system supports two partitions per hard drive, a primary partition and a secondary partition • The secondary partition may then be divided further into a maximum of three logical drives • Each of these four possible logical drives can hold an individual MS-DOS file system • Although 26 drive definitions are technically possible, MS-DOS reserves drive A: and B: for floppy drives, practically limiting the number of hard drives (including logical drives) to 24 Chapter 3

  28. Partitioning • Each MS-DOS file system is assigned a letter followed by a colon: A:, B:, C:, and so on through Z: • Typically, C: is reserved for the first hard disk or removable disk file system (and is normally the system that contains the boot partition) Chapter 3

  29. Partitioning • If you start a computer in MS-DOS, you can use the fdisk utility to look at the contents of the partition record • When the fdisk command is issued, a menu appears, as shown in Figure 3-7 • You can choose option 4 from the menu in Figure 3-7 to see what partitions are on the disk • This will give you a short overview, as shown in Figure 3-8 Chapter 3

  30. Partitioning Chapter 3

  31. Partitioning • In the leftmost column, you see the partition number and, if applicable, the drive letter associated with the partition • In the Status column, you see that one partition is marked A, which stands for active • When the computer is started, the BIOS looks at the partition record, find the active partition (the partition currently used to store data, and from which the computer boots), and looks at the file system inside that partition to start the operating system Chapter 3

  32. Partitioning • The Volume Label column shows the name of the file system in the partition • The Mbytes column represents the size of the partition in megabytes • Finally, the Usage column indicates how much of the total available disk space is consumed by the file system • You can use the other functions of the fdisk program to delete or add partitions to the drives in your system • To remove a partition, select option 3 from the fdisk menu, which presents you with another menu for selecting which partition you wish to remove Chapter 3

  33. Partitioning • With a new system called large block allocation (LBA), it is now possible to make file systems much larger than 512 MB under MS-DOS • LBA translates larger logical blocks to smaller ones for support of larger physical disks • However, the disk controller and disk must support LBA, and they must be configured for LBA • The trick to LBA is that MS-DOS is told that the sector size of the hard disk is greater than 512 bytes per sector, which results in the ability to have much larger file systems Chapter 3

  34. Formatting • In MS-DOS (and in many Windows versions), the file system is placed on the partition using the format command • This command writes all of the file system structure to the disk • In the case of a floppy disk, it uses the first sector of the disk as the boot block • As with many system-level commands, format includes several additional switches that modify precise program operation Chapter 3

  35. format Command Switches Chapter 3

  36. Formatting • Command lines frequently use switches (extra code) to change the way a particular command operates • The boot block is placed in the first sector on the disk • Next comes the root directory, where the system stores file information, such as name, start cluster, file size, file modification date and time, and file attributes (file characteristics such a Hidden, Read-only, Archive, and so on) Chapter 3

  37. Formatting • The root directory on every partition is a fixed size that can contain a maximum of 512 entries in FAT16 (and unlimited entries in FAT32) • When a file is stored to disk, its data is written in the clusters on the disk • The filename is stored in the directory, along with the number of the first cluster in which the data is stored Chapter 3

  38. Formatting • When the operating system fills the first cluster, data is written to the next free cluster on the disk • When a file is completely written to the disk, the FAT entry for the final cluster is filled with all 1s, which means end of file • At this time, the directory entry for the file is updated with the total file size • This is commonly referred to as the “linked-list” method Chapter 3

  39. Formatting • Clusters are of a fixed length, and if a file does not exactly match the space available in the clusters it uses, you can end up with some unused space at the end of a cluster • Unusable spots are marked in the FAT as bad clusters, and these areas are never used for file storage • Formatting a disk removes all data that was on the disk because you lost the directory and FAT data needed to get to the data Chapter 3

  40. Formatting • On disks that have never been formatted, the format command writes new sector and track markers on the disk • The format process on a hard disk is the same as on a floppy disk, with two exceptions • The first is related to the size of each entry in the FAT table, which is 16 bits long on any disk larger than 16 MB • The second difference is in the cluster size Chapter 3

  41. Hard Disk Cluster Reference Chapter 3

  42. Formatting • The FAT tables and root directory are found at the beginning of each partition, and they are always at the same location • Each item in a directory consists of 32 bytes Chapter 3

  43. Formatting • In each entry, information about the file is stored, including the filename, the file change date and the file size and the file attributes • Apart from the filename, each directory entry also contains some status bits that identify the type of filename contained in each entry • The status bits in use are Volume, Directory, System, Hidden, Read-only, and Archive • The Volume bit indicates a file system volume label, or a nickname for the file system Chapter 3

  44. Formatting • The attrib command can be used to look at or set these attributes • Typing attrib in a directory shows all of the attribute settings for all the files, whereas typing attrib followed by a filename shows only attributes specific to that file Chapter 3

  45. The Windows 95/98/Me FAT File Systems • There are two versions of FAT that can be used with Windows 95, 98, and Me, depending on the version of Windows you are running, and the size of the disk you are using: • FAT16, similar to the system used in MS-DOS/Win 3.x • FAT32, a new system introduced in Windows 95, release 2 (OSR2) Chapter 3

  46. Windows 95/98/Me FAT16 • In Windows 95, there is support for long filenames (LFNs) • A filename in the Windows 95 file system: • Can contain as many as 255 characters • Is not case sensitive • Cannot include spaces and characters such as “/\[ ] :;=, (this applies to both 8.3 filenames and LFNs) • Since LFN characters are stored in Unicode, a coding system that allows for representation of any character in any language, it is possible to use any character known to Windows in a filename Chapter 3

  47. Windows 95/98/Me FAT16 • The advantage of LFNs and Unicode is that LFNs can be read by Mac OS and UNIX systems • Normally, letters and digits are represented by ASCII (American Standard Code for Information Interchange) values • The problem with this standard is that it uses an entire byte to represent each character, which limits the number of characters that can be represented to 255 Chapter 3

  48. Windows 95/98/Me FAT16 • This is not enough to handle all the characters needed to represent world languages, including several different alphabets (Greek, Russian, Japanese, and Hindi, for example) • ASCII deals with this problem by employing different character sets, depending on the characters you’re trying to represent • Unicode is a 16-bit code that allots two bytes for each character, which allows 65,536 characters to be defined Chapter 3

  49. Windows 95/98/Me FAT16 • Two advantages of FAT16 are that, like FAT12, it is a simple file system supported by many small computer operating systems, and it has a low operating system overhead • The disadvantages are that FAT16 become corrupted over time as files are spread among disjointed allocation units (clusters) and pointers to each unit are lost, and FAT16 does not offer many file or directory security or auditing options Chapter 3

  50. FAT32 • To accommodate the increasing capacities of hard disks, and avoid the problem of cluster size, the second release of Windows 95 (OSR2) introduced an improved FAT file system called FAT32 • FAT32 shares characteristics of FAT16 for Windows 95 • FAT32 allows partitions of up to 2 TB (theoretically); blocks can be allocated with clusters as small as 8 KB, and the maximum file size is raised to 4 GB Chapter 3

More Related