Linux block device simulation & Fuse
Asked Answered
O

3

6

My project involves simulating a block device by remote host.

For testing I am using FUSE, my file system is a simple change of the "hello" example app, where instead of returning a constant string I just read data directly from a file.

When I try to mount the file normally (mount -o loop=/dev/loop1 ) it works well. When I load fuse and expose this file via it, all the normal file operations work. But mounting fails with "Permission denied".

Anyone has an idea where the "permission denied" is coming from ?

Any other methods to that will allow me to create a virtual device (only support block access) in users space, that will be mountable ?

Thanks in advance

Overfill answered 27/10, 2009 at 14:41 Comment(2)
What distro are you using to develop with? It could be as simple as needing to add your user to the 'fuse' group.Selina
Ubuntu 9. Mounting with root.Overfill
B
4

Presumably the problem is that the FUSE filesystem doesn't support the features required to have loop-mounts on it.

Have you considered using a network block device instead, such as NBD or iSCSI target?

Bouldon answered 27/10, 2009 at 15:14 Comment(3)
Unfortunately that doesn't appear to fit as NBD-server will satisfy the block requests itself. While I need my application to provide the blocks.Overfill
Your application can provide the blocks by implementing a NBD server or iscsi target; you can then use the kernel's existing NBD or iscsi drivers to make it available over the network and then mount it.Bouldon
I mistakenly assumed that writing my own NBD-server will be too much of a pain. Just found a draft nbd-server in python: "lists.canonical.org/pipermail/kragen-hacks/2004-May/000397.html" Suits perfect with my "Prototype in python" experiment Thank you !Overfill
C
2

Are you executing with Root permission. You can trace the program with "strace" and then check where exactly this fails.

Crackling answered 27/10, 2009 at 15:19 Comment(0)
T
1

The mount command is a real hell to use when it starts to print errors. Try "-v" but more often than not, the additional output won't help :(

Transcript answered 27/10, 2009 at 14:46 Comment(1)
Sadly -v show absolutely no problems until the dreaded "Permission denied"Overfill

© 2022 - 2024 — McMap. All rights reserved.