Download The Macintosh File System (continued)

Document related concepts

MTS system architecture wikipedia , lookup

Unix wikipedia , lookup

Distributed operating system wikipedia , lookup

Copland (operating system) wikipedia , lookup

Berkeley Software Distribution wikipedia , lookup

Library (computing) wikipedia , lookup

Security-focused operating system wikipedia , lookup

DNIX wikipedia , lookup

Commodore DOS wikipedia , lookup

Windows NT startup process wikipedia , lookup

RSTS/E wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

OS 2200 wikipedia , lookup

System 7 wikipedia , lookup

Batch file wikipedia , lookup

Burroughs MCP wikipedia , lookup

Computer file wikipedia , lookup

Spring (operating system) wikipedia , lookup

File Allocation Table wikipedia , lookup

VS/9 wikipedia , lookup

CP/M wikipedia , lookup

Unix security wikipedia , lookup

Transcript
File Systems
Guide to Operating Systems
Third Edition
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 2000,
Windows XP, and Windows Server 2003 (FAT16,
FAT32, and NTFS)
Guide to Operating Systems, Third Edition
2
Objectives (continued)
• Describe the file systems used by UNIX and
Linux systems, including ufs and ext
• Discuss the NetWare file system and NSS
• Explain the Mac OS X Extended (HFS+) file
system including features added in Mac OS X
version 10.3
Guide to Operating Systems, Third Edition
3
Understanding File System
Functions
• File system is designed for storing
and managing files on storage media
• PC file systems:
– Partition and format disks to store and
retrieve information
– Enable files to be organized through
directories and folders
– Establish file-naming conventions
Guide to Operating Systems, Third Edition
4
Understanding File System
Functions (continued)
• PC file systems (continued):
– Provide utilities to maintain and manage the
file system and storage media
– Provide for file and data integrity
– Enable error recovery or prevention
– Secure the information in files
Guide to Operating Systems, Third Edition
5
Understanding File System
Functions (continued)
• 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
• Data can be text, images, music and sounds,
video, etc
Guide to Operating Systems, Third Edition
6
Understanding File System
Functions (continued)
• Must be a way to write digital information
onto disk, track it, update it, and recall it
• OS 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
Guide to Operating Systems, Third Edition
7
Understanding File System
Functions (continued)
• Directories also store:
– Date and time the directory or file was created
– Date and time the directory or file was last modified
– Directory or file size
– Directory of file attributes
Guide to Operating Systems, Third Edition
8
Designing a Directory
Structure
• Important feature:
– ability to store information according to a pattern
of organization that is enabled by the use of
directories
• Windows versions and the Mac OS, these are
called folders
Guide to Operating Systems, Third Edition
9
Designing a Directory
Structure (continued)
• Directories and folders
– can be organized in a hierarchy that is similar to
a tree structure
• Many keep most of their files in the
computer’s primary level or root directory
Guide to Operating Systems, Third Edition
10
Designing a Directory
Structure (continued)
• 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
Guide to Operating Systems, Third Edition
11
Designing a Directory
Structure (continued)
• The folder structure from the root might be as
follows:
– Windows
– Program Files Documents and Settings
– Shared
– Forms
– Inetpub
Guide to Operating Systems, Third Edition
12
Designing a Directory
Structure (continued)
• For UNIX/Linux systems:
– bin
– lib
– usr
– var
– tmp
Guide to Operating Systems, Third Edition
13
Designing a Directory
Structure (continued)
• For UNIX/Linux systems (continued):
– dev
– mnt
– etc
– sbin
– home
– proc
Guide to Operating Systems, Third Edition
14
Designing a Directory
Structure (continued)
• In Mac OS X:
– Applications
– Applications (Mac OS 9)
– System Folder Library
– System
Guide to Operating Systems, Third Edition
15
Designing a Directory
Structure (continued)
• In Mac OS X (continued):
– Library
– Users
– Documents
Guide to Operating Systems, Third Edition
16
Disk Storage Basics
• Low-level format
– software process that marks the location of disk
tracks and sectors
Guide to Operating Systems, Third Edition
17
Block Allocation
• Block allocation
– keep track of where specific files are stored on the
disk
• Clusters
– Logical blocks mapped to sectors, heads, and tracks
on the disk
Guide to Operating Systems, Third Edition
18
Block Allocation (continued)
• Block allocation information is stored:
– FAT (file allocation table)
– New Technology File System (NTFS)
Guide to Operating Systems, Third Edition
19
Partitions
• Partitioning
– process of blocking a group of tracks and sectors to
be used FAT or NTFS
• High-level formatted
– disk divisions and patterns needed by a particular
operating system to store files
Guide to Operating Systems, Third Edition
20
Partitions (continued)
• Partition table in Mac OS and Windows
• Disk label in UNIX
• Boot block in UNIX Master Boot Record
(MBR) in Windows
– tiny program used to begin booting an operating
system from a disk
Guide to Operating Systems, Third Edition
21
Windows 2000/XP/Server
2003 File Systems
• Three file systems supported:
– FAT16
– FAT32
– NTFS version 5
Guide to Operating Systems, Third Edition
22
Extended FAT16
• Evolved from FAT16 system in earlier versions
of Windows
• Uses long file names
• Uses Unicode
– Coding system
Guide to Operating Systems, Third Edition
23
Extended FAT16 (continued)
• Assigned a letter
followed by a colon:
A:, B:, C:, and so on
through Z:
• Typically, C: is
reserved for the
first hard disk
Guide to Operating Systems, Third Edition
24
Extended FAT16 (continued)
• Format command
– writes the file system structure to the disk
– includes several additional switches that modify
precise program operation
Guide to Operating Systems, Third Edition
25
Extended FAT16 (continued)
• Switches
– (extra code) to change the way a particular
command operates
• File attributes
– file characteristics such a Hidden, Read-only,
Archive, etc.
Guide to Operating Systems, Third Edition
26
Extended FAT16 (continued)
• File stored to disk
– data is written in the clusters on the disk
– Filename stored in the directory
Guide to Operating Systems, Third Edition
27
Extended FAT16 (continued)
• “linked-list” method
• Bad clusters
– areas never used for file storage
• Formatting a disk
– removes all data that was on the disk
• The FAT tables and root directory are found at the
beginning
• Each item in a directory consists of 32 bytes
Guide to Operating Systems, Third Edition
28
Extended FAT16 (continued)
• Status bits
– identify the type of filename contained in each entry
– Volume, Directory, System, Hidden, Read-only, and
Archive
• attrib command
– to look at or set attributes
– typing attrib in a directory shows all settings
Guide to Operating Systems, Third Edition
29
FAT32
• Accommodates larger disks than FAT16
• Allows partitions of up to 2 TB
• Windows 2000, XP, Server 2003
– convert from FAT16 or FAT32 to NTFS
Guide to Operating Systems, Third Edition
30
NTFS
• Advantages of NTFS:
– Ability to compress file and directory contents on
the fly
– Better recoverability and stability
– Less disk fragmentation
– Local file and folder-level security
Guide to Operating Systems, Third Edition
31
NTFS (continued)
• Basic features:
– Long filenames (LFN)
– Built-in security features
– Better file compression than FAT
– Ability to use larger disks and files
Guide to Operating Systems, Third Edition
32
NTFS (continued)
• Basic features:
– File activity tracking for better recovery and
stability than FAT
– POSIX support
– Volume striping and volume extensions
– Less disk fragmentation than FAT
Guide to Operating Systems, Third Edition
33
NTFS (continued)
• Enables the use of LFNs
• Equipped with security features that meet the
U.S. government’s C2 security specifications
– high-level, “top secret” standards for data
protection, system auditing, and system access
Guide to Operating Systems, Third Edition
34
NTFS (continued)
• Large databases
– SQL Server database file might be 20 GB
• Ability to keep a log of file system activity
• Supports POSIX to enable portability of
applications
Guide to Operating Systems, Third Edition
35
NTFS (continued)
• NTFS 5 adds several new features:
– Ability to encrypt files
– No system reboot required after creating an
extended volume
– Ability to reduce drive designations
– Indexing for fast access
– Ability to retain shortcuts and other file information
– Ability to establish disk quotas
Guide to Operating Systems, Third Edition
36
NTFS (continued)
• NTFS 5 files can be encrypted
• Distributed Link Tracking
– available in NTFS 5 so that shortcuts are not lost
when you move files to another volume
• Uses a Master File Table (MFT)
– located at the beginning of the partition
– when a file is made in NTFS, a record for that file
is added to the MFT
Guide to Operating Systems, Third Edition
37
NTFS (continued)
• Basic disks
– use traditional disk management
• Dynamic disks
– setup large volumes on one disk
– extend volumes onto additional physical disks
• chkdsk utility
– much more robust than in other Windows
operating systems
Guide to Operating Systems, Third Edition
38
NTFS (continued)
• CD-ROM File System (CDFS)
– OS can read and write files to CD-ROM
• Universal Disk Format (UDF)
– used on CD-ROM and large capacity Digital Video
Disk-Read Only Memory (DVD-ROM) media
Guide to Operating Systems, Third Edition
39
The UNIX File System
• Works differently from anything discussed up
to this point
• “UNIX file system” is really a misnomer
– many different file systems that can be used
• Extended file system (ext or ext fs)
– native in Linux and installed by default
– ufs UNIX file system (and also ext/ext2/ext3) uses
the concept of information nodes, or inodes
Guide to Operating Systems, Third Edition
40
The UNIX File System
(continued)
• An inode contains
– name of file
– general information about the file
– information (pointer)
• Pointer information based on logical blocks
• Superblock
– information about the layout of blocks, sectors, and
cylinder groups
Guide to Operating Systems, Third Edition
41
The UNIX File System
(continued)
• mount command
– OS told to map the root inode of another file system
onto the empty directory
• Directory is nothing more than a special file
• Two types of devices
– raw devices and block devices
– Raw device has no logical division in blocks,
whereas a block device does
Guide to Operating Systems, Third Edition
42
The UNIX File System
(continued)
• Every device must be represented by a
device inode
• Symbolic link
– to link a directory entry to a file that is on a
different partition
Guide to Operating Systems, Third Edition
43
The NetWare File System
• Novell Storage Services (NSS)
– disk partitions
– storage pools
– volumes
• Storage pools
– ways to divide the use of a disk
– can be a superset of disk partitions
Guide to Operating Systems, Third Edition
44
The NetWare File System
(continued)
• Balanced-tree (b-tree)
– fast file access
– tree structure off the root
• Features of NSS
– file compression
– hot fixes
– journaling
– user disk quotas
Guide to Operating Systems, Third Edition
45
The NetWare File System
(continued)
• Features of NSS
– file flushing
– storage pool expansion
– data shredding
– improved file backup
Guide to Operating Systems, Third Edition
46
The Macintosh File System
• Macintosh Filing System (MFS)
– limited to keeping track of 128 documents,
applications, or folders
• Hierarchical Filing System (HFS)
– at most, 216 (65,536) units
Guide to Operating Systems, Third Edition
47
The Macintosh File System
(continued)
• Boot blocks
– identify the filing system, the names of important
system files, and other important information
• Volume information block
– points to other important areas of information
Guide to Operating Systems, Third Edition
48
The Macintosh File System
(continued)
• Catalog b-tree
– list of all files on the volume
• Extents b-tree
– track the location of the file fragments, or extents
• “medium” filenames
– up to 31 characters in length
Guide to Operating Systems, Third Edition
49
The Macintosh File System
(continued)
• Invisible type codes and creator codes
• Files created with Apple’s SimpleText text
editor have a type code of TEXT, and a creator
code of ttxt
• Mac files an contain two parts, or forks:
– the data fork
– the resource fork
Guide to Operating Systems, Third Edition
50
The Macintosh File System
(continued)
• Data fork
– frequently changing information (such as word
processing data)
• Resource fork
– information that is fixed
Guide to Operating Systems, Third Edition
51
The Macintosh File System
(continued)
• MacBinary
– joins the two forks into one, and safely stores the
type and creator codes and finder flags
• BinHex
– transforms all files into seven-bit files using the
ASCII character set
Guide to Operating Systems, Third Edition
52
The Macintosh File System
(continued)
• Alias
– Apple’s equivalent of the UNIX link and Windows
shortcut
– Files, folders, applications, and disks can be aliased
Guide to Operating Systems, Third Edition
53
The Macintosh File System
(continued)
• Two basic disk utilities:
– Disk First Aid and Disk Utility
• Sherlock
– search disks for filenames and text within files
Guide to Operating Systems, Third Edition
54
Summary
• Files are the “bread and butter” of an operating
system
• Files hold documents and programs on which
users rely
• File allocation table (FAT) file system creates a
file allocation table to store information about
files
Guide to Operating Systems, Third Edition
55
Summary (continued)
• The fdisk and format utilities are used with all
versions of FAT file systems to partition and
format disks
• FAT32 file system was introduced in the
second release of Windows 95
Guide to Operating Systems, Third Edition
56
Summary (continued)
• The native file system for Windows NT, 2000,
XP, and Server 2003 is called NTFS
• NTFS is a more stable and secure file system
than FAT
• UNIX file systems use information nodes
(inodes) to organize information about files
Guide to Operating Systems, Third Edition
57
Summary (continued)
• A UNIX system can have many file systems
mounted as subdirectories of the root
• The Macintosh OS uses the Hierarchical Filing
System (HFS)
Guide to Operating Systems, Third Edition
58