Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux block device simulation & Fuse

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

like image 939
Boris Avatar asked Oct 27 '09 14:10

Boris


People also ask

What is Linux block device?

Block devices are nonvolatile mass storage devices whose information can be accessed in any order. Hard disks, floppy disks, and CD-ROMs are examples of block devices.

How do I access a blocked device in Linux?

The block devices on a system can be discovered with the lsblk (list block devices) command. Try it in the VM below. Type lsblk at the command prompt and then press Enter.

What does Blkid do in Linux?

The blkid program is the command-line interface to working with the libblkid(3) library. It can determine the type of content (e.g., filesystem or swap) that a block device holds, and also the attributes (tokens, NAME=value pairs) from the content metadata (e.g., LABEL or UUID fields).

What is Lsblk in Linux?

Lsblk is used to display details about block devices and these block devices(Except ram disk) are basically those files that represent devices connected to the pc. It queries /sys virtual file system and udev db to obtain information that it displays. And it basically displays output in a tree-like structure.


1 Answers

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?

like image 96
MarkR Avatar answered Nov 15 '22 07:11

MarkR