Introduction
COMPSCI 340
Operating Systems
Assignment 2 - User space file system
Worth 10%
Due date: 09:30pm 22nd Sept 2023
Total - 30 marks
In week 6, we introduced the FUSE (file system in user space) library. This assignment requires you to first
work with an existing user space file system, and then subsequently create your own.
Setup
- Environment:
Do the assignment either on Ubuntu in the labs or on your own machine (using virtual machines,
macOS, or Windows Subsystem for Linux version 2) or use FlexIT (flexit.auckland.ac.nz). Search for
the “Ubuntu Linux 20.04” desktop icon after sign-in.
Note: The markers will grade using FlexIT Ubuntu image. - Files:
Download fuse.py, passthrough.py, memory.py, and a2fuse1.py from Canvas -> Assignment 2
page.
These files have originally come from -
• fuse.py It offers Python bindings for the FUSE filesystem, enabling developers to create
custom filesystems in Python without altering kernel code.
• memory.py It is a simple in-memory filesystem that carries out various filesystem
operations without persisting any data to the actual disk.
• passthrough.py A passthrough filesystem would allow you to mount a directory to
another location in your file system and all operations you perform in the mounted
location get transparently passed through to the original directory.
Part 1: Familiarization with Existing User Space File System - Create two directories: source and mount. Place files one, two, three and four (from
Canvas) in the source directory. - You will need two terminal windows open. Terminal One (to run the user space file system)
and Terminal Two (for file operations). - In Terminal One, run: python3 a2fuse1.py source mount
- In Terminal Two, do:
ls -l source
ls -l mount
Question 1: [2 marks]
Explain the Terminal Two output. What did you see and why was it like that?
Question 2: [4 marks]
In Terminal Two (within the ‘mount’ directory - perform “cd mount” first), execute:
cat > compsci340.txt
my compsci340 2023 assignment
^D (this is control-D)
COPY the output generated by the user space file system in Terminal One and EXPLAIN each
method called. You can get some information from the Python documentation and using man