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