Fuse mount with read/write permission

1,085 views
Skip to first unread message

Priyanga .V

unread,
Aug 24, 2018, 2:17:03 AM8/24/18
to OSXFUSE
Hey guys, 

I've taken the basic FUSE mount example which is written in C. https://github.com/osxfuse/filesystems/tree/master/filesystems-c/hello. If I mount like as they said in the example(./hello -f mnt/), I'm able to see the mounted volume with `Custom Access(see attached screenshot)` but couldn't see the New Folder option. When I mount using  ./hello -f mnt/ -o defer_permissions command, I've got the `New Folder` option in the context menu. I get the permission error popup when I tried hitting the new folder button. Seems like I don't have a read & write permission on the mounted volume. Could anyone help me how to get rid of this permission issue? 
Screen Shot 2018-08-24 at 11.36.29 AM.png

Sam Moffatt

unread,
Aug 24, 2018, 2:47:59 AM8/24/18
to osxfus...@googlegroups.com
The Hello World filesystem only implemented the read calls and didn’t implement any of the write call backs. You’re going to need to implement a lot more callbacks. I’d suggest looking at the loopback file system which is a complete file system implementation that uses your current filesystem as a backing store. Whilst obviously it backs onto the real filesystem, you can update that to match your own backing store or API.

https://github.com/osxfuse/filesystems/tree/master/filesystems-c/loopback

You’re likely going to want to implement a good chunk of these callbacks:

When I was getting started I heavily relied upon the man pages for each of these calls. Most of them map directly to the system calls man pages (e.g. man 2 open). It’s useful to read and understand what these system calls are supposed to do and what the expectation for your filesystem is going to conform to. The other pitfall is making sure you complete your stat responses in a way that makes sense (man 2 stat). If you hand back weird looking or missing values there then you’ll run into weird responses from tools like Finder.

Cheers,

On Thu, Aug 23, 2018 at 11:17 PM Priyanga .V <gayathri...@gmail.com> wrote:
Hey guys, 

I've taken the basic FUSE mount example which is written in C. https://github.com/osxfuse/filesystems/tree/master/filesystems-c/hello. If I mount like as they said in the example(./hello -f mnt/), I'm able to see the mounted volume with `Custom Access(see attached screenshot)` but couldn't see the New Folder option. When I mount using  ./hello -f mnt/ -o defer_permissions command, I've got the `New Folder` option in the context menu. I get the permission error popup when I tried hitting the new folder button. Seems like I don't have a read & write permission on the mounted volume. Could anyone help me how to get rid of this permission issue? 

--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-grou...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Priyanga .V

unread,
Aug 24, 2018, 7:12:53 AM8/24/18
to OSXFUSE
Hi, 

I have gone through the loopback examples, still I couldn't find the exact solution to my issue, If I mount using `loopback` still my mounted volume has the `Custom Access` permission and not able to create a folder. Have attached the screenshot for ref. Can't I get the read & write access to my mounted volume? Any leads would be grateful. Thanks. 
Screen Shot 2018-08-24 at 4.40.34 PM.png

Sam Moffatt

unread,
Aug 24, 2018, 11:31:24 AM8/24/18
to osxfus...@googlegroups.com
It works for me:

pancake:Programming pasamio$ git clone g...@github.com:osxfuse/filesystems.git

Cloning into 'filesystems'...

Warning: No xauth data; using fake authentication data for X11 forwarding.

X11 forwarding request failed on channel 0

remote: Counting objects: 3319, done.

remote: Total 3319 (delta 0), reused 0 (delta 0), pack-reused 3319

Receiving objects: 100% (3319/3319), 11.13 MiB | 2.92 MiB/s, done.

Resolving deltas: 100% (2021/2021), done.

pancake:Programming pasamio$ cd filesystems/

pancake:filesystems pasamio$ ls

filesystems-c filesystems-objc filesystems-swift support

pancake:filesystems pasamio$ cd filesystems-c

pancake:filesystems-c pasamio$ ls

clock grabfs hello loopback procfs unixfs verybigfs

pancake:filesystems-c pasamio$ cd loopback/

pancake:loopback pasamio$ ls

Makefile loopback.c

pancake:loopback pasamio$ make

cc -I/usr/local/include/osxfuse/fuse -L/usr/local/lib -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -Wall -g  -o loopback loopback.c -losxfuse


Compiled. The following is a typical way to run the loopback file system. In

this example, /tmp/dir is an existing directory whose contents will become

available in the existing mount point /Volumes/loop:


sudo ./loopback /Volumes/loop -omodules=threadid:subdir,subdir=/tmp/dir -oallow_other,native_xattr,volname=LoopbackFS


pancake:loopback pasamio$ mkdir /tmp/dir

pancake:loopback pasamio$ ./loopback /Volumes/loop -omodules=threadid:subdir,subdir=/tmp/dir -oallow_other,native_xattr,volname=LoopbackFS






--
Screen Shot 2018-08-24 at 8.28.22 am.png

Priyanga .V

unread,
Aug 24, 2018, 1:47:50 PM8/24/18
to OSXFUSE
That works for me too. But why the used space value shouldn't be `Zero bytes on disk`? 


On Friday, August 24, 2018 at 11:47:03 AM UTC+5:30, Priyanga .V wrote:
Screen Shot 2018-08-24 at 11.14.28 PM.png

Priyanga .V

unread,
Aug 24, 2018, 1:52:31 PM8/24/18
to OSXFUSE
And also, I'd like to send these fuse options callback to `.js` file where I can get the access to my rest apis. In this mounted volume, I'd like to list my api response data. Can I use `uv_async_send(RPC)` or is there any other way to achieve this?


On Friday, August 24, 2018 at 11:47:03 AM UTC+5:30, Priyanga .V wrote:
Reply all
Reply to author
Forward
0 new messages