Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Memory FUSE filesystem

Write a simple FUSE filesystem that is stored in memory. The filesystem has to support the following commands:

ls, mkdir, cp

This question was recently asked in an interview, I wasn't able answer it. So I have decided to learn it.

Did some searching and found some guides on building my own FUSE filesystem. I am really clueless on how to implement the filesystem in memory.

My questions are

  • Am I heading in the right direction ?
  • What else should I read up on ?
  • What is the solution ?

Links that I am reading:

  • http://fuse.sourceforge.net/
  • http://www.ibm.com/developerworks/linux/library/l-fuse/
  • http://pramode.net/articles/lfy/fuse/pramode.html
  • http://revista.python.org.ar/3/en/html/python_en_tu_fs.html
  • http://pysnippet.blogspot.com/2009/11/fuse-filesystem-in-userspace-part-1.html
  • creating a temporary file in python with FUSE
  • http://www.willmcgugan.com/blog/tech/2011/3/20/creating-a-virtual-filesystem-with-python-and-why-you-need-one/

In the last link the there is a mention on in-memory caching with PyFileSystem. I am not sure on how that might help.

PS : This was a written interview Question, So the answer has to simple enough to write on paper within 10-15 mins.

like image 632
Gautam Avatar asked Jan 25 '12 13:01

Gautam


People also ask

What is filesystem type FUSE?

Filesystem in USErspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code.

How does FUSE work filesystem?

FUSE (file system in user space) fixes #1 by providing a simpler, more uniform API. For example, in FUSE all operations take a full, absolute path (a path is absolute if it starts with "/"). There is no notion of relative paths. FUSE fixes #2 by running your file system code in user space rather than in kernel space.


1 Answers

I had taken a course where we had to build an in-memory distributed file system similar in design to Frangipani. The course was heavily inspired by MIT's Distributed Systems course. Doing their first few lab assignments would be a good exercise.

This tutorial is also quite helpful.

like image 183
Sushant Avatar answered Sep 24 '22 17:09

Sushant