initial checkin; mostly complete
[distorted-backup] / snap.ro.8
CommitLineData
99248ed2
MW
1.TH snap.ro 8 "12 November 2011" "distorted.org.uk backup"
2.SH NAME
3snap.ro \- fake snapshot handler which remounts filesystems read-only
4.SH SYNOPSIS
5.B snap.ro
6.I device
7.IB key = value
8\&...
9.SH DESCRIPTION
10This is a fake snapshot handler. Rather than produce a snapshot device
11containing a consistent view of the origin's contents, it simply
12remounts the contained filesystem read-only. Obviously, this isn't
13satisfactory for operations which might alter the block device, but it's
14fine for stuff like backups.
15.PP
16The following options keys are recognized, either with a
17.RB ` .ro '
18suffix or without. Other keys are reported as errors, unless the key
19contains a
20.RB ` . '
21character.
22.TP
23.BI op= op
24The
25.I op
26must be either
27.B snap
28(the default) to create a `snapshot' \(en i.e., remount read-only \(en or
29.B unsnap
30to remove it \(en i.e., remount read/write.
31.TP
32.BI tag= tag
33On snapshot creation, record the
34.I tag
35in the filesystem before remounting readonly; on snapshot removal,
36verify that the tag recorded matches
37.IR tag .
38This prevents a different script from making the filesystem read/write
39prematurely. The default tag is
40.BR snap .
41.BI dir= mount-pt
42The filesystem is mounted on
43.IR mount-pt .
44If you omit this option,
45.B snap.ro
46will search
47.B /etc/mtab
48for a mount point for the given
49.IR device .
50If exactly one such mount point is found then it will be used;
51otherwise, an error is reported.
52.SH BUGS
53This assumes that the filesystem is mounted locally. If the block device
54is exported (e.g., to a virtual guest, or using a network block device)
55then this won't work and you'll need to do something more complicated.
56.PP
57Linux allows the same device to be mounted in several different places
58using bind mounts. Each of these occurrences needs to be made read-only
59if the device contents are to be made consistent;
60.BR snap.ro
61is too stupid to handle this properly: instead, if
62.B dir
63is omitted, it checks that the device is mentioned exactly once in
64.BR /etc/mtab .
65.SH SEE ALSO
66.BR snap (8),
67.BR mount (8).
68.SH AUTHOR
69Mark Wooding, <mdw@distorted.org.uk>