SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
Operating Systems
         CMPSCI 377
         File Systems
            Emery Berger
University of Massachusetts Amherst




  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Files
    Associate


    names with
    data
    Usually


    stored on
    persistent
    media
    (disks)



     UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   2
File Names
    Hierarchical


    directory
    structure
        Absolute,
    

        relative
        to current
    Windows


    names =
    location +
    dir
        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   3
Directories
    Directory – just special file


        Contains metadata, filenames, inodes
    

              inode = unique number for file
          


        May contain other directory, etc.
    

              Beware: fixed max filename length
          


    File systems use directory structure to


    improve locality
        E.g., ext2 – all files in same directory
    

        clustered in same region of disk


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   4
Poor Man’s Database
         Because files & directories are easy to use,
     

         they get used as de facto databases
              e.g., Internet Explorer web cache
          

                    ~ 1000 files in each hash subdirectory
                


C:Documents and SettingsEmeryLocal SettingsTemporary Internet FilesContent.IE5>
ls -ltra
total 1873
-rwx------+ 1 Emery None      67 Jan 10 17:31 desktop.ini
drwx------+ 2 Emery None       0 Jan 17 22:42 0NDWKTYT
drwx------+ 7 Emery None       0 Feb 19 19:53 .
drwx------+ 7 Emery None       0 Apr 20 14:45 ..
drwx------+ 2 Emery None       0 May 1 21:41 8HZD6WS6
drwx------+ 2 Emery None       0 May 1 21:54 I4F15DOK
drwx------+ 2 Emery None       0 May 1 22:03 XM0N4Q4W
-rwx------+ 1 Emery None 1916928 May 3 12:21 index.dat
drwx------+ 2 Emery None       0 May 3 12:21 S0RKZRFZ

C:Documents and SettingsEmeryLocal SettingsTemporary Internet FilesContent.IE5>


              UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science     5
File Systems Abstraction
    File system manages files


        Traditionally: file system maps files to disk
    

    But: files convenient abstraction


    use same, easy interface (read, write)
        Block devices (/dev/scsi0)
    

              Disk drives – transfer in blocks
          


        Character devices (/dev/tty)
    

              Console, printer
          


        Proc filesystem (/proc/mem)
    

        FIFO (named pipes)
    

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   6
Device files
    Unix devices live in /dev,


    act like ordinary files
 elnux14> echo quot;fooquot; > /dev/tty
 foo




      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   7
/proc filesystem
    Normal file access to kernel internals


elnux14> ls     -l /proc/30917/
total 0
dr-xr-xr-x      2   emery   fac   0   May   3   13:18   attr
-r--------      1   emery   fac   0   May   3   13:18   auxv
-r--r--r--      1   emery   fac   0   May   3   13:01   cmdline
lrwxrwxrwx      1   emery   fac   0   May   3   13:18   cwd -> /nfs/elsrv4/users5/fac/em
-r--------      1   emery   fac   0   May   3   13:18   environ
lrwxrwxrwx      1   emery   fac   0   May   3   13:18   exe -> /bin/tcsh
dr-x------      2   emery   fac   0   May   3   12:06   fd
-rw-r--r--      1   emery   fac   0   May   3   13:18   loginuid
-r--------      1   emery   fac   0   May   3   13:18   maps
-rw-------      1   emery   fac   0   May   3   13:18   mem
-r--r--r--      1   emery   fac   0   May   3   13:18   mounts
lrwxrwxrwx      1   emery   fac   0   May   3   13:18   root -> /
-r--r--r--      1   emery   fac   0   May   3   13:01   stat
-r--r--r--      1   emery   fac   0   May   3   13:18   statm
-r--r--r--      1   emery   fac   0   May   3   13:01   status
dr-xr-xr-x      3   emery   fac   0   May   3   13:18   task
-r--r--r--      1   emery   fac   0   May   3   13:10   wchan

      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science           8
Named Pipes (FIFO)
    Special file: acts like unnamed pipe


         E.g., cat file | wc -l
     


    elnux14> mkfifo thePipe
    elnux14> ls -ld thePipe
    prw-r----- 1 emery fac 0 May 3 14:00 thePipe
    elnux14> cat simplesocket.h > thePipe &
    [1] 32242
    elnux14> wc -l < thePipe
    155
    [1]    Done                          cat simplesocket.h
    > thePipe
    elnux14>




         UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   9
Named Pipes (FIFO)
    Special file: acts like unnamed pipe


         E.g., cat file | wc -l
     


    elnux14> mkfifo thePipe
    elnux14> ls -ld thePipe
    prw-r----- 1 emery fac 0 May 3 14:00 thePipe
    elnux14> cat simplesocket.h > thePipe &
    [1] 32242
    elnux14> wc -l < thePipe
    155
    [1]    Done                          cat simplesocket.h
    > thePipe
    elnux14>




         UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   10
Named Pipes (FIFO)
    Special file: acts like unnamed pipe


         E.g., cat file | wc -l
     


    elnux14> mkfifo thePipe
    elnux14> ls -ld thePipe
    prw-r----- 1 emery fac 0 May 3 14:00 thePipe
    elnux14> cat simplesocket.h > thePipe &
    [1] 32242
    elnux14> wc -l < thePipe
    155
    [1]    Done                          cat simplesocket.h
    > thePipe
    elnux14>




         UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   11
Named Pipes (FIFO)
    Special file: acts like unnamed pipe


         E.g., cat file | wc –l
     


    elnux14> mkfifo thePipe
    elnux14> ls -ld thePipe
    prw-r----- 1 emery fac 0 May 3 14:00 thePipe
    elnux14> cat simplesocket.h > thePipe &
    [1] 32242
    elnux14> wc -l < thePipe
    155
    [1]    Done                          cat simplesocket.h
    > thePipe
    elnux14>



    Useful when cannot do redirection


         Especially for compression
     

         UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   12
Named Pipes (FIFO)
    Exercise:


        Program named “joe” outputs file “joe.out”
    

              Huge (~ 3 GB)
          


        Compress it automagically using gzip -c &
    

        named FIFO to “joe.out.gz”




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   13
Named Pipes (FIFO)
    Exercise:


        Program named “joe” outputs file “joe.out”
    

              Huge (~ 3 GB)
          


        Compress it automagically using gzip -c &
    

        named FIFO to “joe.out.gz”

elnux14> mkfifo joe.out
elnux14> gzip –c < joe.out > joe.out.gz &
[1]
elnux14> joe




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   14
File Metadata
    Files have a lot of associated “metadata”;


    ex.: Unix (from stat)
        Date created, last modified, last accessed
    

        Size (bytes)
    

        User & group ID of file’s owner
    

        File type (not content type)
    

              Directory
          

              Regular file
          

              Block / character device (disk drive, screen)
          

              FIFO
          




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   15
Untyped Files
    Unix, Windows – file contents untyped


        Stream of bytes
    

        Type implied by convention (extensions)
    

              .ppt, .pdf, …
          


    Mac: file types stored in metadata





        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   16
File Types
    Unix, Windows – file contents untyped


        Stream of bytes
    

        Type implied by convention (extensions)
    

              .ppt, .pdf, …
          


    Mac: file types stored in metadata





        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   17
Access Control
    Unix: each file has associated bits that


    control access (& other stuff)
        Read
    

        Write
    

        Execute
    

    Can specify for three “users”


        User (file owner)
    

        Group (set of users)
    

        Other (everyone else)
    



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   18
Access Control - chmod
    Can read bits via ls, set bits via chmod



elnux14> ls -l ack.scm
-rw-r----- 1 emery fac 197 Feb 25 15:19 ack.scm
elnux14> chmod -r ack.scm
elnux14> ls -l ack.scm
--w------- 1 emery fac 197 Feb 25 15:19 ack.scm
elnux14> cat ack.scm
cat: ack.scm: Permission denied




      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   19
The End




  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   20

Weitere ähnliche Inhalte

Andere mochten auch (14)

TUTORIAL DE NETVIBES
TUTORIAL DE NETVIBESTUTORIAL DE NETVIBES
TUTORIAL DE NETVIBES
 
Presentacion departamentales
Presentacion departamentalesPresentacion departamentales
Presentacion departamentales
 
Animales en peligro de extincion
Animales en peligro de extincionAnimales en peligro de extincion
Animales en peligro de extincion
 
Emprendimiento
EmprendimientoEmprendimiento
Emprendimiento
 
Congelamiento de Precios - Productos en supermercados libertad
Congelamiento de Precios - Productos en supermercados libertadCongelamiento de Precios - Productos en supermercados libertad
Congelamiento de Precios - Productos en supermercados libertad
 
Ehealthhoy
EhealthhoyEhealthhoy
Ehealthhoy
 
Get started with dropbox
Get started with dropboxGet started with dropbox
Get started with dropbox
 
Oficio previc copy
Oficio previc copyOficio previc copy
Oficio previc copy
 
Paradigmas tecnoeconomicos
Paradigmas tecnoeconomicosParadigmas tecnoeconomicos
Paradigmas tecnoeconomicos
 
Trabajo
TrabajoTrabajo
Trabajo
 
Cascalog at May Bay Area Hadoop User Group
Cascalog at May Bay Area Hadoop User GroupCascalog at May Bay Area Hadoop User Group
Cascalog at May Bay Area Hadoop User Group
 
Green it
Green itGreen it
Green it
 
Cascalog workshop
Cascalog workshopCascalog workshop
Cascalog workshop
 
Africa conf-report en Conference report High-Level Conference EU-Africa Pa...
Africa conf-report en Conference report    High-Level Conference EU-Africa Pa...Africa conf-report en Conference report    High-Level Conference EU-Africa Pa...
Africa conf-report en Conference report High-Level Conference EU-Africa Pa...
 

Ähnlich wie Operating Systems - File Systems

Lamp ppt
Lamp pptLamp ppt
Lamp pptReka
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensicsINSIGHT FORENSIC
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensicsINSIGHT FORENSIC
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboardsDenis Ristic
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentalsDima Gomaa
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copyShay Cohen
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpointbijanshr
 
Tech talk Introduction to containers
Tech talk Introduction to containersTech talk Introduction to containers
Tech talk Introduction to containersViliamPucik
 
FORTRAN Theory and Basic LINUX Fundamentals
FORTRAN Theory and Basic LINUX FundamentalsFORTRAN Theory and Basic LINUX Fundamentals
FORTRAN Theory and Basic LINUX FundamentalsJyotismat Raul
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newanjuchandu755
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newmybrands2
 

Ähnlich wie Operating Systems - File Systems (20)

4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
 
Cli2 Bibalex
Cli2 BibalexCli2 Bibalex
Cli2 Bibalex
 
Cli1 Bibalex
Cli1 BibalexCli1 Bibalex
Cli1 Bibalex
 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensics
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensics
 
UNIX Basics and Cluster Computing
UNIX Basics and Cluster ComputingUNIX Basics and Cluster Computing
UNIX Basics and Cluster Computing
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpoint
 
Tech talk Introduction to containers
Tech talk Introduction to containersTech talk Introduction to containers
Tech talk Introduction to containers
 
FORTRAN Theory and Basic LINUX Fundamentals
FORTRAN Theory and Basic LINUX FundamentalsFORTRAN Theory and Basic LINUX Fundamentals
FORTRAN Theory and Basic LINUX Fundamentals
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet new
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet new
 

Mehr von Emery Berger

Doppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierDoppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierEmery Berger
 
Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingEmery Berger
 
Programming with People
Programming with PeopleProgramming with People
Programming with PeopleEmery Berger
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationEmery Berger
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)Emery Berger
 
Operating Systems - Networks
Operating Systems - NetworksOperating Systems - Networks
Operating Systems - NetworksEmery Berger
 
Operating Systems - Queuing Systems
Operating Systems - Queuing SystemsOperating Systems - Queuing Systems
Operating Systems - Queuing SystemsEmery Berger
 
Operating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel ComputingOperating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel ComputingEmery Berger
 
Operating Systems - Concurrency
Operating Systems - ConcurrencyOperating Systems - Concurrency
Operating Systems - ConcurrencyEmery Berger
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationEmery Berger
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - SynchronizationEmery Berger
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and ThreadsEmery Berger
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and PagingEmery Berger
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual MemoryEmery Berger
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsEmery Berger
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorEmery Berger
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementEmery Berger
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without PagingEmery Berger
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesEmery Berger
 
Exterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityExterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityEmery Berger
 

Mehr von Emery Berger (20)

Doppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierDoppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language Barrier
 
Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic Multithreading
 
Programming with People
Programming with PeopleProgramming with People
Programming with People
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance Evaluation
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)
 
Operating Systems - Networks
Operating Systems - NetworksOperating Systems - Networks
Operating Systems - Networks
 
Operating Systems - Queuing Systems
Operating Systems - Queuing SystemsOperating Systems - Queuing Systems
Operating Systems - Queuing Systems
 
Operating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel ComputingOperating Systems - Distributed Parallel Computing
Operating Systems - Distributed Parallel Computing
 
Operating Systems - Concurrency
Operating Systems - ConcurrencyOperating Systems - Concurrency
Operating Systems - Concurrency
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced Synchronization
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - Synchronization
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory Allocator
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without Paging
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe Languages
 
Exterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityExterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High Probability
 

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Operating Systems - File Systems

  • 1. Operating Systems CMPSCI 377 File Systems Emery Berger University of Massachusetts Amherst UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 2. Files Associate  names with data Usually  stored on persistent media (disks) UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 2
  • 3. File Names Hierarchical  directory structure Absolute,  relative to current Windows  names = location + dir UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 3
  • 4. Directories Directory – just special file  Contains metadata, filenames, inodes  inode = unique number for file  May contain other directory, etc.  Beware: fixed max filename length  File systems use directory structure to  improve locality E.g., ext2 – all files in same directory  clustered in same region of disk UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 4
  • 5. Poor Man’s Database Because files & directories are easy to use,  they get used as de facto databases e.g., Internet Explorer web cache  ~ 1000 files in each hash subdirectory  C:Documents and SettingsEmeryLocal SettingsTemporary Internet FilesContent.IE5> ls -ltra total 1873 -rwx------+ 1 Emery None 67 Jan 10 17:31 desktop.ini drwx------+ 2 Emery None 0 Jan 17 22:42 0NDWKTYT drwx------+ 7 Emery None 0 Feb 19 19:53 . drwx------+ 7 Emery None 0 Apr 20 14:45 .. drwx------+ 2 Emery None 0 May 1 21:41 8HZD6WS6 drwx------+ 2 Emery None 0 May 1 21:54 I4F15DOK drwx------+ 2 Emery None 0 May 1 22:03 XM0N4Q4W -rwx------+ 1 Emery None 1916928 May 3 12:21 index.dat drwx------+ 2 Emery None 0 May 3 12:21 S0RKZRFZ C:Documents and SettingsEmeryLocal SettingsTemporary Internet FilesContent.IE5> UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 5
  • 6. File Systems Abstraction File system manages files  Traditionally: file system maps files to disk  But: files convenient abstraction  use same, easy interface (read, write) Block devices (/dev/scsi0)  Disk drives – transfer in blocks  Character devices (/dev/tty)  Console, printer  Proc filesystem (/proc/mem)  FIFO (named pipes)  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 6
  • 7. Device files Unix devices live in /dev,  act like ordinary files elnux14> echo quot;fooquot; > /dev/tty foo UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 7
  • 8. /proc filesystem Normal file access to kernel internals  elnux14> ls -l /proc/30917/ total 0 dr-xr-xr-x 2 emery fac 0 May 3 13:18 attr -r-------- 1 emery fac 0 May 3 13:18 auxv -r--r--r-- 1 emery fac 0 May 3 13:01 cmdline lrwxrwxrwx 1 emery fac 0 May 3 13:18 cwd -> /nfs/elsrv4/users5/fac/em -r-------- 1 emery fac 0 May 3 13:18 environ lrwxrwxrwx 1 emery fac 0 May 3 13:18 exe -> /bin/tcsh dr-x------ 2 emery fac 0 May 3 12:06 fd -rw-r--r-- 1 emery fac 0 May 3 13:18 loginuid -r-------- 1 emery fac 0 May 3 13:18 maps -rw------- 1 emery fac 0 May 3 13:18 mem -r--r--r-- 1 emery fac 0 May 3 13:18 mounts lrwxrwxrwx 1 emery fac 0 May 3 13:18 root -> / -r--r--r-- 1 emery fac 0 May 3 13:01 stat -r--r--r-- 1 emery fac 0 May 3 13:18 statm -r--r--r-- 1 emery fac 0 May 3 13:01 status dr-xr-xr-x 3 emery fac 0 May 3 13:18 task -r--r--r-- 1 emery fac 0 May 3 13:10 wchan UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 8
  • 9. Named Pipes (FIFO) Special file: acts like unnamed pipe  E.g., cat file | wc -l  elnux14> mkfifo thePipe elnux14> ls -ld thePipe prw-r----- 1 emery fac 0 May 3 14:00 thePipe elnux14> cat simplesocket.h > thePipe & [1] 32242 elnux14> wc -l < thePipe 155 [1] Done cat simplesocket.h > thePipe elnux14> UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 9
  • 10. Named Pipes (FIFO) Special file: acts like unnamed pipe  E.g., cat file | wc -l  elnux14> mkfifo thePipe elnux14> ls -ld thePipe prw-r----- 1 emery fac 0 May 3 14:00 thePipe elnux14> cat simplesocket.h > thePipe & [1] 32242 elnux14> wc -l < thePipe 155 [1] Done cat simplesocket.h > thePipe elnux14> UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 10
  • 11. Named Pipes (FIFO) Special file: acts like unnamed pipe  E.g., cat file | wc -l  elnux14> mkfifo thePipe elnux14> ls -ld thePipe prw-r----- 1 emery fac 0 May 3 14:00 thePipe elnux14> cat simplesocket.h > thePipe & [1] 32242 elnux14> wc -l < thePipe 155 [1] Done cat simplesocket.h > thePipe elnux14> UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 11
  • 12. Named Pipes (FIFO) Special file: acts like unnamed pipe  E.g., cat file | wc –l  elnux14> mkfifo thePipe elnux14> ls -ld thePipe prw-r----- 1 emery fac 0 May 3 14:00 thePipe elnux14> cat simplesocket.h > thePipe & [1] 32242 elnux14> wc -l < thePipe 155 [1] Done cat simplesocket.h > thePipe elnux14> Useful when cannot do redirection  Especially for compression  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 12
  • 13. Named Pipes (FIFO) Exercise:  Program named “joe” outputs file “joe.out”  Huge (~ 3 GB)  Compress it automagically using gzip -c &  named FIFO to “joe.out.gz” UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 13
  • 14. Named Pipes (FIFO) Exercise:  Program named “joe” outputs file “joe.out”  Huge (~ 3 GB)  Compress it automagically using gzip -c &  named FIFO to “joe.out.gz” elnux14> mkfifo joe.out elnux14> gzip –c < joe.out > joe.out.gz & [1] elnux14> joe UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 14
  • 15. File Metadata Files have a lot of associated “metadata”;  ex.: Unix (from stat) Date created, last modified, last accessed  Size (bytes)  User & group ID of file’s owner  File type (not content type)  Directory  Regular file  Block / character device (disk drive, screen)  FIFO  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 15
  • 16. Untyped Files Unix, Windows – file contents untyped  Stream of bytes  Type implied by convention (extensions)  .ppt, .pdf, …  Mac: file types stored in metadata  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 16
  • 17. File Types Unix, Windows – file contents untyped  Stream of bytes  Type implied by convention (extensions)  .ppt, .pdf, …  Mac: file types stored in metadata  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 17
  • 18. Access Control Unix: each file has associated bits that  control access (& other stuff) Read  Write  Execute  Can specify for three “users”  User (file owner)  Group (set of users)  Other (everyone else)  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 18
  • 19. Access Control - chmod Can read bits via ls, set bits via chmod  elnux14> ls -l ack.scm -rw-r----- 1 emery fac 197 Feb 25 15:19 ack.scm elnux14> chmod -r ack.scm elnux14> ls -l ack.scm --w------- 1 emery fac 197 Feb 25 15:19 ack.scm elnux14> cat ack.scm cat: ack.scm: Permission denied UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 19
  • 20. The End UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 20