blob: 7d7d5785caa32e5edb30a365ba9e27046ca15dc5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
### Upgrading a gocryptfs filesystem
To upgrade your filesystem, you create a new empty one with the newer version of gocryptfs, mount it, and copy all the files over.
Let's assume you have an old gocryptfs filesystem stored in `/old.enc`, mounted to `/old`. You have created a new filesystem in `/new.enc` and mounted it to `/new`. The `df -Th` output would look like this:
```
$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
[...]
/new.enc fuse.gocryptfs 30G 23G 5,7G 80% /new
/old.enc fuse.gocryptfs 30G 23G 5,7G 80% /old
```
Now you can simply use your graphical file manager to copy the files (or see the next sections for using command-line tools).
Once you feel confident that have remembered the new passphrase (if you picked a new one) AND have stored the new masterkey at a safe place (this one is definitely new), delete `old.enc`.
#### Using rsync
I recommend using rsync because it allows to resume interrupted copies and is generally a lot smarter than anything else.
```
$ shopt -s dotglob
$ rsync -av /old/* /new
```
The bash option `dotglob` makes sure that `/old/*` also matches hidden files (dotfiles).
#### Space-efficient move
If you don't have the space to store a copy of your data, you can use the `--remove-source-files` option to rsync. This will delete each file after it has been transferred. Note that `mv` is pretty dumb: it copies everything and only then deletes the source files, so you will still need twice the space.
```
$ shopt -s dotglob
$ rsync -av --remove-source-files /old/* /new
```
As above, `dotglob` makes sure that dotfiles in `/old/` are copied as well.
|