9781111543709 _PPT_ch05

Download Report

Transcript 9781111543709 _PPT_ch05

Guide to Parallel Operating
Systems with
Windows 7 and Linux
Chapter 5
File Systems
Objectives
• Describe the characteristics of three Windows 7 file
systems
• Describe the characteristics of four Fedora 13 file
systems
• Create a file system in Windows 7 and Fedora 13
• Mount a file system in Windows 7 and Fedora 13
• Manage file systems in Windows 7 and Fedora 13
Guide to Parallel Operating Systems with Windows 7 and Linux
2
Windows 7 File System
Characteristics
• To implement a file system, you need to know the
following:
– Allocation of the storage areas on the hard drive
– Assignment of drive letters:
• Used to access storage areas
– Characteristics of available file systems
Guide to Parallel Operating Systems with Windows 7 and Linux
3
Disk Partitions
• Figure 5-1:
– Shows BIOS settings for three SATA-controlled
drives
– Each SATA drive has its own disk controller
– CD-ROM drive has its own controller
• Figure 5-2:
– Each controller supports one device that could be a
hard drive or CD-ROM drive
• Figure 5-3: shows drives separated into partitions
• Types of storage in Windows 7:
– Basic and dynamic
Guide to Parallel Operating Systems with Windows 7 and Linux
4
Figure 5-1 BIOS settings for SATA-controlled drives in Virtual PC 2007
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
5
Figure 5-2 Sample devices for SATA-controlled drives
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
6
Figure 5-3 Partitions on three hard drives and a CD-ROM drive
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
7
Disk Partitions (continued)
• Primary partition features:
– Normally contains an OS, such as Windows 7
– Physical hard drive can have four primary partitions
• Limit drops to three if extended partitions are used
• Only one extended partition can be allocated per
physical hard drive
– However, multiple logical drives can be allocated
within an extended partition
• Volume:
– A fixed amount of storage on a hard drive
• Hard drive can be initialized as a dynamic disk
Guide to Parallel Operating Systems with Windows 7 and Linux
8
Drive-Lettering Conventions
• Windows 7:
– Follows drive-lettering conventions
– Assigns a letter to each hard drive and optical drive
• Creating partitions and logical drives for Figure 5-4:
–
–
–
–
–
System Reserved partition: no drive letter
First primary partition on disk 0 assigned drive letter C
CD-ROM drive received drive letter D
Disk 1 received drive letter E
Disk 2 received drive letter F
• View assignments with Disk Management console
Guide to Parallel Operating Systems with Windows 7 and Linux
9
Figure 5-4 Disk Manager showing drive letters after additions
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
10
FAT16 File System
• FAT (File Allocation Table): file system for early PCs
– Supported by Windows 7 and Linux
• FAT16 disk hierarchy:
– Sector: smallest unit of space, usually 512 bytes
– Cluster: group of sectors
• Size is related to the size of the disk partition
• Size range: 4 sectors to 64 sectors
• FAT12:
– Predecessor to FAT16
– Counter for the cluster address was limited to 12 bits
– Used on first 10-MB hard drives in the IBM PC XT
Guide to Parallel Operating Systems with Windows 7 and Linux
11
FAT16 File System (continued)
• Subdirectories: logical grouping of related files
• FAT 16 permits partitions of up to 2 GB
• Partition size:
– Limited by the 8-bit count of sectors per cluster
• In Windows 7:
– The length of a filename may be 256 characters
– Filenames are case insensitive
Guide to Parallel Operating Systems with Windows 7 and Linux
12
FAT16 File System (continued)
Table 5-1 Cluster sizes
Guide to Parallel Operating Systems with Windows 7 and Linux
13
FAT32 File System
• Uses 32-bit cluster numbers (28 bits currently used)
• Continues use of subdirectories and long filenames
• Theoretical size limits:
– 268,435,438 cluster based on 28-bit cluster address
– Drive sizes of approximately 2 terabytes (trillion bytes)
• For Windows 7:
– Partition limit is 32 GB for the primary partition
Guide to Parallel Operating Systems with Windows 7 and Linux
14
NT File System
• Default file system for new installations of Windows 7
• NTFS (New Technology File System) features:
– Supports volumes as large as 2 terabytes
– Cluster sizes: 512 bytes to 64 KB (4 KB default)
– Master file table (MFT): used to manage NTFS volume
• Allocates space for each file record
• File attributes written to allocated space in MFT
• Binary search algorithm used to locate items
• Options unique to NTFS: journalizing, compression,
encryption, security, auditing, and quotas
Guide to Parallel Operating Systems with Windows 7 and Linux
15
Journalizing ̶ Ensuring that Data is
Written
• Maintains data integrity for the hard drive
• How NTFS provides a fail-safe file system:
– Corrects itself against a hard drive sector corruption
– Protects against power loss during hard drive writes
• NTFS uses transactions:
– Write action is either accomplished or canceled
• Scenario 1: sector damaged during write operation
– Response: sector marked; data written to good sector
• Scenario 2: power is lost during write operation
– Response: transaction processed after OS restarts
Guide to Parallel Operating Systems with Windows 7 and Linux
16
Compression ̶ Saving Space
• Compression technology reduces file sizes:
– Example: word-processing documents compress well
• Access compressed files with decompression:
– Recompress files before rewriting to hard drive
• Performance considerations:
– Decompression/recompression requires CPU cycles
• System performance may be adversely affected
– Reserve compression for little used files and folders
Guide to Parallel Operating Systems with Windows 7 and Linux
17
Encryption ̶ Protecting Data
• Effects of applying NTFS encryption to a file:
– Only the file creator can view file contents
– Non-authorized user will not see meaningful data
– File decrypted when accessed by an application
• Administrator can decrypt file in emergency
• A file can be encrypted or compressed, but not
both
Guide to Parallel Operating Systems with Windows 7 and Linux
18
Security ̶ Restricting Access
• Windows 7:
– Controls access to files and folders
– Designed to provide security for files and folders
accessed on an NTFS
• Three elements required for file access:
– User account
– User password
– Permissions
Guide to Parallel Operating Systems with Windows 7 and Linux
19
Auditing ̶ Tracking Access
• Auditing not “turned on” by default:
– Significant processing resources required
• With auditing enabled:
– Windows 7 can be configured to keep track of
events
– Event occurrence causes entry in security log
• Information about access events include:
– Type of event, date and time the event occurred
– Which user triggered the event
• Security log may only be viewed by authorized user
Guide to Parallel Operating Systems with Windows 7 and Linux
20
Quotas ̶ Limiting Storage
• Storage quotas set for individuals and storage areas:
– Implemented in Windows 7 when a PC is shared
– Administrator cannot limit space for a group
• Consequence of storing data beyond quota:
– User receives message indicating hard drive is full
• Log file stores information regarding quotas:
– Used to determine which users are at or near quota
Guide to Parallel Operating Systems with Windows 7 and Linux
21
Optical Media File Systems
• Optical disc: storage medium manipulated with lights
• Windows 7 supports two file systems for optical
media:
– UDF (Universal Disk Format):
• Read-write interoperable among major OSs
• Compatible between rewritable and write-once media
• Implementations: DVDs, CD-Rs, and CD-RWs
– Compact Disc File System (CDFS):
• Alias for ISO 9660 (CD-ROM file system standard)
• Makes CD-ROMs readable by many different platforms
Guide to Parallel Operating Systems with Windows 7 and Linux
22
Fedora 13 File System Characteristics
• File system knowledge areas to master:
– Allocation of the partitions on the hard drive
• Each partition on a physical drive is named
– Creation of file systems on the partitions
• Partition is formatted for the type of file system
• File systems are mounted on mount points
– Creation and management of directories and files
– Characteristics of available file systems
Guide to Parallel Operating Systems with Windows 7 and Linux
23
Disk Partitions
• Disks on the Fedora 13 virtual machine:
– Allocated to mimic drives on the Windows 7 virtual
machine
• Windows 7 disks (Disk 0, Disk 1, and Disk 2):
– Match up with Fedora 13 disks (sda, sdb, and sdc)
– Operating systems:
• Installed on the first virtual disk (Disk 0 or sda)
– Partitions:
• The same on the remaining two virtual disks
• Fedora 13: assigns partitions on a hard drive
Guide to Parallel Operating Systems with Windows 7 and Linux
24
Figure 5-5 Fedora 13 partitions on three disks and a CD-ROM drive
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
25
Disk Partitions (continued)
Table 5-2 Mimicked drives
Guide to Parallel Operating Systems with Windows 7 and Linux
26
Drive Partition Naming Conventions
• Partition name: device name and partition number
• Physical drives allocated one or more partitions:
– First SATA drive is called sda, the second sdb, etc.
– Example:
• Fedora 13 is usually installed on first physical hard
drive (sda1)
Guide to Parallel Operating Systems with Windows 7 and Linux
27
File Systems in Fedora 13
• Extended 2 file system (ext2fs):
– Most widely used file system in Fedora 13
• Ext2fs provides the same functionality as NTFS:
–
–
–
–
–
Compression: reduces file storage space
Encryption: protects files from intruders
Security: restricts access to authorized users
Auditing: tracks file access (actual or attempted)
Quotas: limits total size of files per user
• Some other file systems used in Fedora 13:
– ext3fs: implements journalizing
– NTFS: read-only access is provided
Guide to Parallel Operating Systems with Windows 7 and Linux
28
File System Creation
• Formatting:
– Prepares a storage area for use
– Creates root of directory structure and file system
• Tools for creating a storage area and a file system:
– Windows 7: uses the Disk Management console
– Linux: uses the fdisk and mkfs programs
Guide to Parallel Operating Systems with Windows 7 and Linux
29
Windows 7 File System Creation
• Chief tool: Disk Management console
• When creating storage area:
– Start with an unallocated area on a physical disk
– New Simple Volume wizard: used to start process
• Options in the Assign Drive Letter/Path dialog box:
– Assign the following drive letter
– Mount in the following empty NTFS folder
– Do not assign a drive letter or drive path
Guide to Parallel Operating Systems with Windows 7 and Linux
30
Figure 5-7 Specifying a partition size
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
31
Figure 5-8 Assigning a drive letter
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
32
Windows 7 File System Creation
(continued)
• You must format the partition before you can use it
• Format Partition dialog box
• You can configure a number of options:
–
–
–
–
–
–
–
Do not format this volume
Format this volume with the following settings
File system
Allocation unit size
Volume label
Perform a quick format
Enable file and folder compression
Guide to Parallel Operating Systems with Windows 7 and Linux
33
Figure 5-9 Format Partition options
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
34
Fedora 13 File System Creation
• Used for storing system configurations and data
• Initial structure created: “/” directory and swap file
• Uses for the hidden swap file:
– Holding parts of programs and data files
– OS moves data between swap file and memory
• Define file systems after “/” and swap file:
– Create a new partition using the fdisk command
– Create the file system using the mkfs command
• Example: mkfs -t ext2 /dev/fd0
– If mount point needed, use mkdir to create a directory
• Example: mkdir /home/User01/mydirectory
Guide to Parallel Operating Systems with Windows 7 and Linux
35
Table 5-3 Fedora 13 default directories
Guide to Parallel Operating Systems with Windows 7 and Linux
36
Mounting a File System
• Windows 7’s approach to mounting a file system:
– Letters given to partitions, volumes, CD-ROM drives
– “Premounted” storage items available at any time
– Performance is traded for user convenience
• Fedora 13’s approach to mounting a file system:
– Mount file systems as they are needed
– User convenience is traded for performance
Guide to Parallel Operating Systems with Windows 7 and Linux
37
Mounting a Windows 7 File System
• Removable drives:
– Mounted upon insertion into USB port
– Prior to removal, you must notify Windows 7
– Data transfer: may be interrupted if USB drive
removed too soon
• Mounted drive:
–
–
–
–
–
Supported by Windows 7 and Fedora 13
Mapped to empty folder on a volume that uses NTFS
Assigned drive path instead of drive letter
Adds flexibility to storage management
To access: click drive icon
Guide to Parallel Operating Systems with Windows 7 and Linux
38
Mounting a Fedora 13 File System
• Mounting: makes a file system available for use
– After mounting, files are accessible at mount point
– Superuser access required to mount a file system
• Some partitions are mounted automatically:
– Script in /etc/rc.d executes mount -a command
– File systems in /etc/fstab (except noauto) mounted
• mount attaches file system to partition via mount
point:
– /mnt directory is a generic mount point
– Command syntax:
mount -t type device mount-point
Guide to Parallel Operating Systems with Windows 7 and Linux
39
Figure 5-12 Displaying mounted file systems in Fedora 13
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
40
Figure 5-13 Mounting a file system in Fedora 13
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
41
Managing File Systems
• Windows 7:
– Local Disk Properties dialog box assists in file
management
• Fedora 13:
– Use fsck command to manage the swap space
Guide to Parallel Operating Systems with Windows 7 and Linux
42
Managing Windows 7 File Systems
• General tab manages disk space:
–
–
–
–
–
–
–
–
Type: a local disk is a hard drive on the PC
File system: indicates the file system type on the drive
Used space: displays amount of used space on drive
Free space: displays amount of unused space on
drive
Capacity: displays the total capacity of the disk drive
Disk Cleanup: removes temporary and Internet files
Compress drive to save disk space
Allow files on this drive to have contents indexed in
addition to file properties
Guide to Parallel Operating Systems with Windows 7 and Linux
43
Tools Tab
• Provides three disk-tuning tools
• Error-checking:
– Scans the volume for damage
– Volume is not available during the scan
• Defragmentation:
– Analyzes drives for fragmentation (scattered files)
– Tool: analyzes and reorganizes drives
• Backup:
– Copies contents of files and folders
– Option not available on Windows 7 Home edition
Guide to Parallel Operating Systems with Windows 7 and Linux
44
Hardware Tab
• Provides access to drive information and settings
• Options to view information:
– Name and Type: display drive’s model names and
types
– Properties button: provides access to the Properties
dialog box for a selected device
Guide to Parallel Operating Systems with Windows 7 and Linux
45
Sharing Tab
• Shares the entire contents of a drive
• Hidden share C$ is displayed in dialog box
(default)
• Creating additional shares (for administrators):
–
–
–
–
–
Click the New Share button
Type the share name in the Share name text box
Click the Permissions button
Check the appropriate Allow check boxes
Click OK twice
Guide to Parallel Operating Systems with Windows 7 and Linux
46
Security Tab
• Used to set the NTFS permissions:
– NTFS permissions control access to data on drive
• Modifying NTFS group permissions (administrator):
– Set the Allow check boxes for each user group
– Click OK
– You will be prompted for an administrative account
password
Guide to Parallel Operating Systems with Windows 7 and Linux
47
Quota Tab
• Tracks/controls disk space usage for NTFS volumes
• Used by administrators to optimize use of disk space
• Options:
–
–
–
–
–
–
–
Enable quota management
Deny disk space to users exceeding quota limit
Do not limit disk usage
Limit disk space to
Set warning level to
Log event when a user exceeds their quota limit
Log event when a user exceeds their warning level
Guide to Parallel Operating Systems with Windows 7 and Linux
48
Managing Fedora 13 File Systems
• File system checking and repair:
– File corruption and OS errors:
• Caused by power losses or non-graceful shutdowns
• File system buffer cache out of sync with disk
– Buffer cache: memory used for quick data access
– fsck command:
• Checks for and repairs errors
• Syntactically similar to the mkfs command
• Example: fsck -t ext3 /dev/sda2
• Exit code returned provides description of error
Guide to Parallel Operating Systems with Windows 7 and Linux
49
Managing Fedora 13 File Systems
(continued)
Table 5-4 Exit codes for the fsck command
Guide to Parallel Operating Systems with Windows 7 and Linux
50
Managing Fedora 13 File Systems
(continued)
• Disk usage management
– df command:
• Used to report disk space usage of a file system
• Syntax: df [OPTION]... [FILE]...
– du command:
• Used to specify disk usage of each file
• Syntax: du [OPTION]... [FILE]...
Guide to Parallel Operating Systems with Windows 7 and Linux
51
Managing Fedora 13 File Systems
(continued)
Figure 5-21 Output of df command
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
52
Swap Space Management
• free command used to:
– Display amount of free and used memory
– Manage swap space
• Swap space is used to implement paging
• Paging:
– Pages written to disk when physical memory is low
– Pages read back into physical memory when needed
– Helps PC performance
• Swap partition can yield better performance
Guide to Parallel Operating Systems with Windows 7 and Linux
53
Swap Space Management (continued)
Figure 5-23 Displaying free space for memory and swap file systems
Courtesy Course Technology/Cengage Learning
Guide to Parallel Operating Systems with Windows 7 and Linux
54
Managing Fedora 13 File Systems
(continued)
• Disk quota
– Alerts system administrator before a user consumes
too much disk space or a partition becomes full
– Fedora 13 can restrict disk space by implementing
disk quotas
• Security
– Configure by adding permissions to directories and
the objects they contain
Guide to Parallel Operating Systems with Windows 7 and Linux
55
Summary
• Storage areas on hard drives are used to store
programs and data
• NTFS provides options for:
– Journalizing, compression, encryption, security,
auditing, and quotas
• Windows 7 uses:
– Disk Management console to manage storage areas
• Fedora 13:
– Uses partitions on a hard drive to store information
Guide to Parallel Operating Systems with Windows 7 and Linux
56
Summary (continued)
• Windows 7:
– Handles the mounting of drives (except USB drives)
• Fedora 13:
– You can mount devices when they are needed
• Windows 7 and Fedora 13:
– Tools are available to manage file systems:
– Management tasks include:
• Reporting information about disk space availability
• Cleaning up temporary files
• Managing disk space quota
Guide to Parallel Operating Systems with Windows 7 and Linux
57