From: Ralph Ronnquist Date: Sun, 21 Apr 2024 01:00:07 +0000 (+1000) Subject: Added some project description for my gitweb. X-Git-Tag: 0.2~2 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=01c9eaa041ac5c4f8d7b2705a0a45b79302203b7;p=rrq%2Fnbd-mount-helper.git Added some project description for my gitweb. --- diff --git a/.gitweb b/.gitweb new file mode 100644 index 0000000..e2eed4d --- /dev/null +++ b/.gitweb @@ -0,0 +1,2 @@ +description = mount helper for nbd and nbdfuse fstab entries +category = goodies diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..4ebe624 --- /dev/null +++ b/README.adoc @@ -0,0 +1,49 @@ += nbd-mount-helper +:wiki: https://en.wikipedia.org/wiki/Network_block_device + +This project includes mount helpers for `nbd` and `nbdfuse` entries in +`/etc/fstab`. The helpers are `bash` scripts that should be installed +in `/sbin` to be ued by `mount` to handle the virtual filesystem types +`nbd` or `nbdfuse`. (Or installed in `/usr/sbin` for some versions of +`mount`) + +== Description + +Quoting +Wikipedia about +link:https://en.wikipedia.org/wiki/Network_block_device[Network Block Device] + +[quote] + +On Linux, network block device (NBD) is a network protocol that can be +used to forward a block device (typically a hard disk or partition) +from one machine to a second machine. As an example, a local machine +can access a hard disk drive that is attached to another computer. + +To do so, a remote machine, say `nbdhost.example.com` is set up as +`NBD server` with one or more export names, say including `part000`, +that on the server side maps to a partition image file. + +With a mount helper the client side would include an entry in its +`/etc/fstab` for instance like the following: +---- +nbd://nbdhost.example.com/part000 /nbd/1 nbd noauto,noatime 0 2 +---- +That would declare a mounting of that exported NBD partition onto the +(alread existsing) pathname `/mnt/1` on the local machine. With the +__type__ field of the `fstab` entry being `nbd`, the mount program +will use `/sbin/mount.nbd` as helper for handling that entry. + +The helper script `/sbin/mount.nbd` provided here uses the +`nbd-client` program to handle the service connection as device node +such as `/dev/nbd0` and then mount that onto `/mnt/1`. The script will +further spawn a monitor daemon to terminate the service connection +upon unmounting. This script needs `inotify`, `nbd-client` and the +`nbd` kernel module or built-in to function. + +The helper script `/sbin/mount.nbdfuse` provided here is similar but +will rely on `nbdfuse` for service connection. The `fstab` entry would +then have `nbdfuse` as __type__ indicator. This script needs +`inotify`, `nbdfuse` and the `fuse` and `loop` kernel modules or +built-in to function. +