The question
How do I create and mount a fake block device (using a large file/disk image) that passes as a legitimate unformatted disk?
Backstory
I am trying to set up rook with ceph (a distributed storage system) in my hobby kubernetes cluster. Ceph requires an unformatted blockdevice that it will partition and use for storage as it sees fit.
I don't have any spare disks I can use, so I thought: Why don't I just create a loopback device and use that?
Since my host OS disk has plenty of free space I should be able to create a large file on there and mount that as a loopback device.
There are two problems with this (as I understand it):
- Loopback devices have to be formatted with some sort of filesystem in order to be mounted, which will not work with Ceph since Ceph requires an unformatted blockdevice
- Loopback devices do not seem to count as block devices. Ceph docs use
lsblk -fto test if a device is eligible for Ceph. The device has to show up in the output AND not have any filesystem formatted on them.