From: Ralph Ronnquist Date: Wed, 24 May 2023 09:38:27 +0000 (+1000) Subject: minor editing and document fusedisk X-Git-Tag: 1.0~1^2~19 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=fd4646a864893c598888ff36dbb8c13a4e424808;p=rrq%2Ffusefile.git minor editing and document fusedisk --- diff --git a/fusefile.8 b/fusefile.8 index f9ca25d..148609b 100644 --- a/fusefile.8 +++ b/fusefile.8 @@ -1,10 +1,11 @@ .mso www.tmac .TH fusefile 8 .SH NAME -fusefile \- FUSE file mount for combining file fragments +fusefile, fusedisk \- FUSE file mount for combining file fragments .SH SYNOPSIS .B fusefile \fR[\fIfuse-opts\fR] \fBmountpoint\fR \fR[\fIoverlay\fR] \fIfilename/from-to\fR ... +.B fusedisk \fR[\fIfuse-opts\fR] \fBmountpoint\fR \fR[\fIoverlay\fR] \fIfilename/from-to\fR ... .SH DESCRIPTION @@ -46,18 +47,22 @@ relative to the end of the file. If "length" is negative or omitted it means that position relative to the end. .TP -\fIfilename/start\fR -include bytes from the given start. This is the same as "/start+" +\fIfilename/start\fR include bytes from the given start. This is the +same as "/start+" .P Note that a negative start position is clipped to 0 and a too large -end position is clipped to the end of the file. +end position is clipped to the end of the file. .P Charater devices are treated as being of any given finite size, but have size 0 by default. For example, "/dev/zero/:100" means a fragment of 100 NUL bytes. +\fBfusedisk\fR is a helper script to set up a fused file as a block +device. This uses the device mapper (\fBdmsetup\fR) to manage empty +block device mappings where content is handled via \fBfusefile\fR. + .SH EXAMPLES Insert file "y" into file "x" at position 1200: @@ -101,6 +106,15 @@ By that set up, the overlay file, "today", will protect the disk image file, "disk.raw" from changes, and also override the pathname "disk.raw" to be the fused file. +As final example, make a fused block device y as a swap of the +beginning and end of file "x", at position 2442: +.RS +\fB$ sudo fusedisk -ouid=1000 y x/2442: x/:2442\fR +.RE +Note the use of \fBsudo\fR for becoming \fIroot\fR, which is required +for block device handling, and also the \fB-ouid=1000\fR option so as +to make the block device \fIy\fR be owned by the user with id 1000. + .SH NOTES Note that \fBfusefile\fR opens the nominated source file or files @@ -112,13 +126,33 @@ If a source is reduced in size, access will be inconsistent. If the mountpoint file doesn't exist, then \fBfusefile\fR creates it. -Unmounting is done with "\fBfusermount -u\fR \fImountpoint\fR" as -usual. +The fuse option \fI-oallow_other\fR is needed for sharing the fused +file with other users (including "root"). Note however that this +option must first be enabled in \fI/etc/fuse.conf\fR. -Using an overlay file makes the fused file writable regardless of the -fused fragments with the overlay file containing any changes to the -original. The overlay file is reusable for subsequent fusing of the -same fragments for reconstructing a prior session with changes. +Unmount is done with "\fBfusermount -u\fR \fImountpoint\fR" as usual. + +.P +\fBUsing overlay file\fR + +.P +A fusefile mount with an \fIoverlay file\fR is writable regardless of +the fused fragments, but all updates are written to the overlay file +instead of to the fragments. + + $ fusefile -oallow_other -ononempty disk.raw \fB-overlay:today\fR disk.raw + +The overlay file ("today" in the example) contains all changes to the +original file ("disk.raw" in the exmaple). It also contains a marker +table at the end, as if appended to the fused file. This part of the +overlay file is outside of the fused file; it consists of an element +count followed by pairs of byte addresses to mark out which regions +have been written into the overlay file, and the marker table is +maintained so that adjoining regions are collapsed. + +That means that an overlay file may be reused to later re-establish +the same fused file with overlay as previously, to continue capturing +more changes. .SH AUTHOR