~FILE SYSTEM~
SUNU WIBIRAMA
~FILE SYSTEM~ SUNU WIBIRAMA OUTLINE FILE SYSTEM ACCESS METHODS - - PowerPoint PPT Presentation
~FILE SYSTEM~ SUNU WIBIRAMA OUTLINE FILE SYSTEM ACCESS METHODS DIRECTORY STRUCTURE FILE SYSTEM MOUNTING PROTECTION EXTERNAL VIEW OF THE FILE MANAGER FILE MANAGEMENT FILE, IS A NAMED AND ORDERED COLLECTION OF INFORMATION COMPUTER SHOULD
SUNU WIBIRAMA
FILE SYSTEM ACCESS METHODS DIRECTORY STRUCTURE FILE SYSTEM MOUNTING PROTECTION
FILE, IS A NAMED AND ORDERED COLLECTION OF INFORMATION COMPUTER SHOULD BE CONVENIENT TO BE USED OPERATING SYSTEM HANDLES IT WITH ITS FILE MANAGEMENT FUNCTION FILE MANAGER’S JOB:
File represents program (source and object forms) and data General file structure: sequence of bits, bytes, lines, or records Simple record structure:
Lines Fixed length Variable length
Complex Structures:
Formatted document Relocatable load file
Who decides:
Operating system Program
NAME – ONLY INFORMATION KEPT IN HUMAN- READABLE FORM IDENTIFIER – UNIQUE TAG (NUMBER) IDENTIFIES FILE WITHIN FILE SYSTEM TYPE – NEEDED FOR SYSTEMS THAT SUPPORT DIFFERENT TYPES LOCATION – POINTER TO FILE LOCATION ON DEVICE SIZE – CURRENT FILE SIZE PROTECTION – CONTROLS WHO CAN DO READING, WRITING, EXECUTING TIME, DATE, AND USER IDENTIFICATION – DATA FOR PROTECTION, SECURITY, AND USAGE MONITORING INFORMATION ABOUT FILES ARE KEPT IN THE DIRECTORY STRUCTURE, WHICH IS MAINTAINED ON THE DISK
Open(Fi) – search the directory structure on disk for entry Fi,
and move the content of entry to memory. OS provides open-file table to containing information about all open files (no need to search directory structures when a file operation is requested)
Close (Fi) – move the content of entry Fi in memory to directory
structure on disk. Erase the entry in open-file table related to the closed file.
Operating System must
recognize the file type in
in reasonable ways.
File types are recognized
as an extension : *.exe, *.doc, *.psd, etc.
n = relative block number
HOW TO TRANSLATE SEQUENTIAL-ACCESS ON A DIRECT-ACCESS FILE
DISK CAN BE SUBDIVIDED INTO PARTITIONS ENTITY CONTAINING FILE SYSTEM ALSO KNOWN AS VOLUME DIRECTORY IS LIKE A TABLE OF CONTENTS - RECORDS INFORMATION, SUCH AS NAME, LOCATION, SIZE, TYPE OF ALL FILES IN A VOLUME
SET OF FILES USED TO ORGANIZE FILES TREATED AS A FILE, BUT WITH SPECIAL OPERATIONS ON IT:
SINGLE DIRECTORY FOR ALL USERS IF THE NUMBER OF FILES INCREASES OR MORE THAN ONE USERS --> PROBLEM OCCURES LENGTH OF FILE NAME LIMITATION: MS-DOS (11) DIFFERS WITH UNIX (255)
SEPARATE DIRECTORY FOR EACH USER CAN HAVE THE SAME FILE NAME FOR DIFFERENT USER ISOLATES ONE USER TO THE OTHERS
CURRENT DIRECTORY ABSOLUTE PATH RELATIVE PATH
Creating a new file is done in current directory Delete a file
Creating a new subdirectory is done in current directory
mkdir <dir-name>
mail copy prt exp count
Creating a new file is done in current directory Delete a file
Creating a new subdirectory is done in current directory
mkdir <dir-name>
mail copy prt exp count
what’s happened, if i execute rm -rf /home?
HAVE SHARED SUBDIRECTORIES AND FILES
SHARED FILE
SHARED SUBDIRECTORY
ALIASING: DIFFERENT FILE NAMES FOR SAME FILE A POINTER TO SHARED FILE IS NAMED LINK DELETION PROBLEM, IF THE SHARED SUBDIRECTORY “LIST” IS DELETED, WE HAVE DANGLING POINTER SYMBOLIC LINKS:
USING LINKS IS TREATED AS ILLEGAL ACCESS. NON-SYMBOLIC LINKS (HARD LINKS):
THE COUNT = 0, FILE CAN BE DELETED BECAUSE NO REFERENCE TO IT.
How do we guarantee no cycles?
Allow only links to file not subdirectories Garbage collection: detect when the last reference has been deleted Every time a new link is added use a cycle detection algorithm to
determine whether it is OK, but it’s computationally expensive
LINK IN UBUNTU LINUX 10.10
(A) MOUNTED (B) UNMOUNTED MOUNTED
SOMETIME YOU SHOULD DEFINE THE TYPE OF YOUR MOUNTED FILE SYSTEM
BEFORE MOUNTING
AFTER MOUNTING
Automatic mounting on booting: /etc/fstab
mounted file mount point file system type
Multiple users: problem arises on file sharing, file naming, and file protection Add more attributes to file and directory Most systems use concept of OWNER and GROUP User IDs identify users, allowing permissions and protections to be per-user Group IDs allow users to be in groups, permitting group access rights We will elaborate on the last section : PROTECTION
Uses networking to allow file system access between systems
Manually via programs like FTP Automatically, seamlessly using distributed file systems Semi automatically via the world wide web
Client-server model allows clients to mount remote file systems from servers
Server can serve multiple clients Client and user-on-client identification is insecure or complicated NFS is standard UNIX client-server file sharing protocol CIFS is standard Windows protocol Standard operating system file calls are translated into remote calls
Distributed Information Systems (distributed naming services) such as
LDAP, DNS, NIS, Active Directory implement unified access to information needed for remote computing
Keep the file safe from physical damage (reliability) and improper access
(protection)
File owner/creator should be able to control:
what can be done by whom
Types of access
Read Write Execute Append Delete List
Field Meaning
rw-r--r-- Permission 1 Hard link number to file sunu
sunu group of file 323 file size in byte 2010-11-18 13:55 modification date execute.txt file name
Owner (o) Group (g) Public/Universe (p)
file [o] [g] [p]
Mode of access and octal: read (r = 4), write (w = 2), execute (x = 1) Three classes of users
7 ⇒ 1 1 1
6 ⇒ 1 1 0
1 ⇒ 0 0 1
Ask manager to create a group (unique name), say G, and add some users
to the group.
For a particular file (say game) or subdirectory, define an appropriate
access.
group public chmod 761 game
Attach a group to a file:
chgrp G game
ACCESS CONTROL LIST IN WINDOWS XP