File System - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

File System

Description:

Delete: it is not necessary to free any data blocks on disks ... Backup your vmware images!! In this project, you are modifying the file system. ... – PowerPoint PPT presentation

Number of Views:108
Avg rating:3.0/5.0
Slides: 23
Provided by: ywp5
Category:
Tags: file | free | system | vmware

less

Transcript and Presenter's Notes

Title: File System


1
File System
  • System Programming Project 3

Sang Hoon Baek Computer Engineering Research
Lab. EECS, KAIST
2
Task Evaluation
  • Task I Analyze Minix file system performance for
    various block size (30)
  • Task II Implement immediate files for Minix
    (40)
  • Report (20)
  • Implementation explanation
  • Test methods result analysis
  • Comment code readability (10)

3
Task I - Analyze Minix file system
4
Analysis of Minix file system
  • Evaluating the file system as changing block size
    of file system
  • File system performance is closely related to the
    block size
  • Testing block size 1KB, 2KB, 4KB
  • Using file system benchmark (Postmark, Bonnie,
    LFS benchmark)
  • Use at least one of FS benchmark
  • http//www.fsl.cs.sunysb.edu/docs/fsbench/fsbench-
    tr.html
  • Discussing the effect of block size in file
    system
  • Read/write performance
  • Maximum file size
  • Disk space usage

5
Implementation Hint
  • The structure of Minix file system
  • Read attached reference An Improvement for
    MINIX File System Design and Implementation
  • How to set up the block size of Minix file system
  • You can setup the block size when you setup
    MINIX3
  • You can also use mkfs command to specify block
    size
  • mkfs command builds a file system
  • You have to partition the disk in order to
    preserve your primary file system

6
Block size setup when installing Minix
  • You can specify the block size in Install step 7
  • You have to reinstall Minix whenever you want to
    change the block size of file system

7
Using mkfs disk partitioning
  • Tutorial on disk partitions
  • Reference http//www.minix3.org/doc/partitions.ht
    ml
  • Expert mode partitioning

8
Using mkfs Disk partitioning example
  • Made 4 partitions on disk c0d0
  • select c0d0p0 as a primary partition for install
    Minix
  • Other partitions(p1, p2, p3) can be used for
    testing Minix file system

Primary partition for installing Minix
Partitions for testing file system as varying
block size
Adjust the CHS size to allocate specified
partition size
Primary partition
9
Using mkfs confirm your disk partition
  • fdisk /dev/c0d0

10
Using mkfs make a file system
  • We can specify the block size using -B option
  • mkfs -Ldot -B blocksize -i inodes -b
    blocks special prototype
  • Ex) Making file system in p1 partition with 2KB
    block size
  • mkfs B 2048 /dev/c0d0p1
  • Caution!!
  • Dont make a new file system in your primary
    partition
  • Your all data can be deleted!!

You can check your file system block size using
fsck command
11
Using mkfs file system mount and test
  • File system mount using mount command
  • Ex) mount partition p1 on /mount/p1 directory
  • mount /dev/c0d0p1 /mount/p1
  • Now you can test the file system under the
    /mount/p1 directory
  • Using dd or cp command for simple read/write
    test
  • Using file system benchmark (http//www.fsl.cs.sun
    ysb.edu/docs/fsbench/fsbench-tr.html)

Use mount or df command to confirm mounted
devices (partitions)
12
Task II - Implement immediate files for Minix
13
Minix Inode
  • Inode
  • Each file has one inode which stores basic file
    information
  • Mode, file size, timestamps for (access,
    modification and status change),
  • Pointers to the disk blocks that store files
    contents

Attributes
Indexingdata blocks
Pointers
File data indexing
Minix inode
14
Implement immediate files for Minix
  • What is immediate file?
  • Using file system metadata region to store small
    file
  • A file whose data is not stored in a data block,
    but directly inside the inode
  • It reduces the amount of disk space for small
    size
  • If the file size is increased, the immediate file
    has to be transformed into a regular file

Regular file Data indexing
When exceeding 32 bytes
Data
File data (32Byte)
When going under 32 bytes
15
Example
16
Immediate file Why?
  • Is it good?
  • Disk space
  • File system performance
  • Is it bad?
  • Overhead to transform file types (immediate ?
    regular)
  • You need to test immediate file and discuss the
    effect of immediate file for Minix file system

17
Implementation Hint
  • Understanding the structure of Minix file system
  • Read attached reference An Improvement for
    MINIX File System Design and Implementation
  • Define an additional flag that tags your file as
    immediate
  • Several file system operations are changed for
    immediate file
  • Create a new file should be marked as immediate
  • Delete it is not necessary to free any data
    blocks on disks
  • Read, Write dont access the block pointers in
    the inode
  • Immediate file transform into regular file
  • Transform when the file size exceeds 32 bytes
  • Allocate a disk block ? copy the data in inode to
    a newly allocated block ? erase the pointers

18
Implementation Hint
  • Offering the skeleton code including
  • Immediate file open
  • Implemented in /usr/src/servers/fs/open.c
  • Using O_IMMED flag to create file as immediate
    file
  • Immediate file read/write
  • /usr/src/servers/fs/read.c
  • We can store 32-byte data in a immediate file
  • Test code
  • /usr/src/servers/fs/test.c
  • Read/write test code
  • Modified parts are commented as - EE512
  • You should implement more
  • Transforming immediate file to regular file and
    vice versa
  • Dealing with immediate file deletion
  • Uncompress my skeleton code in /usr/ directory
  • gzip d EE512Project3.tar.gz
  • tar xvf EE512Project3.tar

19
Caution!!
  • Backup your vmware images!!
  • In this project, you are modifying the file
    system. To preserve your Minix kernel, regularly
    back up your file system
  • Step by step
  • Make sure everything works well before going
    further

20
Submission
  • Due date Nov. 19 (Thur.), 2359
  • Task I
  • Your test results (with the screenshot)
  • Report with analysis about the effect of block
    size
  • You need to submit your own test code
  • Task2
  • Your implementation code (submit your
    /usr/src/servers/fs directory)
  • Test result about immediate file
  • Report with analysis about the effect of
    immediate file
  • Compress all your material to Studentnumber.zip
    (20000000.zip)

21
Submission
  • Penalty
  • If copied, no points
  • Delay 10/day (received time of e-mail)
  • E-mail to baeksangh_at_core.kaist.ac.kr
  • Title EE512-Project3 Studentnumber
  • Ex) EE512-Project3 200731xx
  • TA Info.
  • Sang Hoon Baek
  • Email baeksangh_at_core.kaist.ac.kr
  • T 5425
  • EE Bldg. 3217

22
Reference
  • http//opera.cs.uiuc.edu/chu7/publication/minix-h
    u.pdf
  • http//www.minix3.org/doc/partitions.html
  • http//www.fsl.cs.sunysb.edu/docs/fsbench/fsbench-
    tr.html
Write a Comment
User Comments (0)
About PowerShow.com