Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bobvanderlinden/mbrfs
A FUSE-filesystem that provides the partitions from a disk device or image.
https://github.com/bobvanderlinden/mbrfs
Last synced: 7 days ago
JSON representation
A FUSE-filesystem that provides the partitions from a disk device or image.
- Host: GitHub
- URL: https://github.com/bobvanderlinden/mbrfs
- Owner: bobvanderlinden
- License: gpl-3.0
- Created: 2013-07-04T23:35:07.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-07-23T19:37:10.000Z (over 3 years ago)
- Last Synced: 2024-04-15T00:15:40.274Z (7 months ago)
- Language: CMake
- Homepage:
- Size: 31.3 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mbrfs
A FUSE-filesystem provides the partitions from a disk device or image.
## Motivation
When creating images that hold a filesystem, I always needed to use root to create a loopback device. From the loopback device I could access the different partitions of that image. I did this in an automated build process and didn't like that it needed root. FUSE allows users to mount filesystems and with mbrfs you can get the functionality of dividing devices into partitions, like loopback devices have.
## Compiling
$ make
## Usage
mbrfs DEVICE MOUNTPOINT [FUSE OPTIONS...]
* `DEVICE` is the block device or image that has a MBR partition table with multiple partitions
* `MOUNTPOINT` is a directory where the partitions will be located.To unmount mbrfs use `fusermount -u MOUNTPOINT`.
### Example
Say you want to create an image with two FAT partitions. We can do the following:
First create a file of 100MB:
$ fallocate --length 100M test.img
Now create a partition table on the image using `cfdisk`. This will allow you to interactively create the 2 partitions:
$ cfdisk test.img
Next, we use mbrfs to be able to access those partitions:
$ mkdir test
$ mbrfs test.img test`mbrfs` will have created the following files:
test/1
test/2We can format those partitions using mkfs:
$ mkfs.vfat test/1
$ mkfs.vfat test/2Lastly we unmount mbrfs:
$ fusermount -u test
If you now write `test.img` to an USB drive it'll show up as two FAT partitions.