Skip to content

Commit 9e8f219

Browse files
author
Christian Kauhaus
committed
Update dependencies
1 parent 1375941 commit 9e8f219

File tree

8 files changed

+201
-234
lines changed

8 files changed

+201
-234
lines changed

Cargo.lock

Lines changed: 137 additions & 211 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "backy-extract"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
authors = ["Christian Kauhaus <kc@flyingcircus.io>"]
55
edition = "2018"
66
description = "Rapid restore tool for backy"
@@ -19,15 +19,14 @@ env_logger = "0.7"
1919
fnv = "1"
2020
fs2 = "0.4"
2121
fuse = { version = "0.3", optional = true }
22-
indicatif = "0.11"
22+
indicatif = "0.13"
2323
lazy_static = "1.2"
2424
libc = "0.2"
2525
log = "0.4"
2626
memmap = "0.7"
2727
minilzo = "0.2"
2828
num_cpus = "1.9"
29-
parking_lot = "0.7"
30-
rand = "0.6"
29+
rand = "0.7"
3130
serde_json = "1"
3231
serde = { version = "1.0", features = ["derive"] }
3332
serde_yaml = "0.8"

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2019-12-09 Christian Kauhaus <kc@flyingcircus.io>
2+
3+
* Release backy-extract 0.3.1
4+
* Improve documentation
5+
* Update dependencies
6+
17
2019-12-07 Christian Kauhaus <kc@flyingcircus.io>
28

39
* Release backy-extract 0.3.0

Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Set if your compiler cannot find liblzo2
2-
# LIBRARY_PATH = /path/to/liblzo2
3-
41
DESTDIR := dist
52

63
all: release
@@ -9,20 +6,18 @@ release: target/release/backy-extract target/release/backy-fuse
96

107
target/release/backy-%: Cargo.toml src/*.rs src/*/*.rs
118
cargo build --release --features fuse_driver
12-
strip $@
139

1410
VERSION := $(shell cargo read-manifest | jq .version -r)
1511
PV = backy-extract-$(VERSION)
1612

1713
dist: release
1814
install -D target/release/backy-extract -t tmp/$(PV)/bin
1915
install -D target/release/backy-fuse -t tmp/$(PV)/bin
20-
install -D -m 0644 README.md -t tmp/$(PV)/share/doc
21-
mkdir -p tmp/$(PV)/share/man/man1
16+
install -D -m 0644 README.md ChangeLog -t tmp/$(PV)/share/doc
17+
install -d tmp/$(PV)/share/man/man1 dist
2218
cd man && for f in *.1.rst; do \
2319
rst2man $$f | sed s"/@version@/$(VERSION)/" > ../tmp/$(PV)/share/man/man1/$${f%%.rst}; \
2420
done
25-
mkdir -p dist
2621
tar czf dist/$(PV).tar.gz -C tmp $(PV)
2722
rm -r tmp
2823

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,54 @@ Compiling
3535
In general, `cargo build --release` should do the right thing. This application
3636
depends on [liblzo2](http://www.oberhumer.com/opensource/lzo/) being availabe.
3737
If you get compiler/linker errors, try compiling again with `export
38-
LIBRABY_PATH=/path/to/liblzo2`.
38+
LIBRARY_PATH=/path/to/liblzo2`.
3939

4040
A Makefile is supplied to create a statically linked release which should run on
4141
virtually every Linux x86_64 system.
4242

4343

44+
FUSE driver (backy-fuse)
45+
========================
46+
47+
`backy-fuse` provides access to individual revisions via FUSE (filesystem in
48+
userspace). This allows to mount backup images and retrieve single files.
49+
50+
Usage
51+
-----
52+
53+
1. Start `backy-fuse` to mount a backup via FUSE:
54+
`backy-fuse -d /srv/backy/vm /mnt/backy-fuse`
55+
2. Pick a revision and create loop device:
56+
`losetup -f -P --show /mnt/backy-fuse/tAGKE5rrxReggVMtoPSr7`
57+
3. Create loop mount:
58+
`mount -oloop /dev/loop0p1 /mnt/restore`
59+
60+
When finished, the above stops must be reversed:
61+
62+
1. Unmount loop device:
63+
`umount /mnt/restore`
64+
2. Unregister loop device:
65+
`losetup -d /dev/loop0`
66+
3. Finish FUSE:
67+
`fusermount -u /mnt/backy-fuse`
68+
69+
Compiling
70+
---------
71+
72+
`backy-fuse` is not compiled by default due to restricted portability. To
73+
compile it, run `cargo build --release --features fuse_driver`. Note that both
74+
liblzo2 and libfuse must be detectable by the linker.
75+
76+
4477
Hacking
45-
-------
78+
=======
4679

4780
Please create issues and submit pull requests at
4881
https://github.com/ckauhaus/backy-extract/.
4982

5083

5184
Author
52-
------
85+
======
5386

5487
Contact [Christian Kauhaus](kc@flyingcircus.io) for questions, suggestions, and
5588
bug fixes.

man/backy-fuse.1.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,34 +104,39 @@ Don't forget to unmount the FUSE filesystem when finished:
104104

105105
Mount backup images::
106106

107-
$ backy-fuse -d /srv/backy/testvm /mnt/backy
107+
$ backy-fuse -d /srv/backy/testvm /mnt/backy-fuse
108108

109109
Select revision to restore from. In this example, we will be restoring from revision
110110
`tAGKE5rrxReggVMtoPSr7`.
111111

112112
Set up loop device to access partitions inside the image::
113113

114-
# losetup -f -P --show /mnt/backy/tAGKE5rrxReggVMtoPSr7
115-
/dev/loop1
114+
# losetup -f -P --show /mnt/backy-fuse/tAGKE5rrxReggVMtoPSr7
115+
/dev/loop0
116+
117+
Loop mount the image::
116118

117-
Loop mount the first partition found in the image::
119+
# mount -oloop /dev/loop0p1 /mnt/restore
118120

119-
# mount -oloop /dev/loop1p1 /mnt/restore
121+
If the image does not contain a partition table, use `/dev/loop0` instead of
122+
`/dev/loop0p1` for example.
120123

121124
After finishing restore operations, unmount the loop mount first::
122125

123126
# umount /mnt/restore
124127

125128
Then unregister the loop device::
126129

127-
# losetup -d /dev/loop1
130+
# losetup -d /dev/loop0
128131

129132
Finally, unmount the FUSE filesystem::
130133

131-
$ fusermount -u /mnt/backy
134+
$ fusermount -u /mnt/backy-fuse
132135

133136

134137
SEE ALSO
135138
========
136139

137140
fuse(8), mount(8), fusermount(1)
141+
142+
https://bitbucket.org/flyingcircus/backy

src/bin/backy-fuse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ fn main() -> Result<()> {
244244
info!("Loading revisions");
245245
let fs = BackyFS::init(&app.basedir)?;
246246
println!(
247-
"Mounting FUSE fileystem...\nUnmount with: fusermount -u '{}'",
247+
"Mounting FUSE fileystem... unmount with: fusermount -u '{}'",
248248
app.mountpoint.display()
249249
);
250250
fuse::mount(

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ type RevID = SmallString<[u8; 24]>;
102102

103103
/// Aqcuire 'purge' lock which prevents backy from deleting chunks
104104
pub fn purgelock(basedir: &Path) -> Result<File, io::Error> {
105-
let f = OpenOptions::new().write(true).create(false).open(basedir.join(".purge"))?;
105+
let f = OpenOptions::new()
106+
.write(true)
107+
.create(false)
108+
.open(basedir.join(".purge"))?;
106109
f.try_lock_exclusive()?;
107110
Ok(f)
108111
}

0 commit comments

Comments
 (0)