xmnt/README.md

41 lines
1.1 KiB
Markdown
Raw Normal View History

2022-10-07 02:39:35 +09:00
# xMnt
2022-10-07 02:41:53 +09:00
A tool for mounting encrypted partitions.
2022-10-07 02:39:35 +09:00
## Use case
2022-10-07 03:25:07 +09:00
I have encrypted partitions that I need to mount and unmount from time to time.
2022-10-07 02:39:35 +09:00
2022-10-07 03:25:07 +09:00
I use GPG to encrypt the keys for each partition, save them as `${uuid}.key`
2022-10-07 02:39:35 +09:00
2022-10-07 04:55:07 +09:00
With `xmnt`, I can mount and unmount these partitions with one command.
2022-10-07 02:39:35 +09:00
## Usage
2022-10-07 02:41:53 +09:00
Presets are stored in `$XDG_CONFIG_HOME/xmnt/presets`.
2022-10-07 02:39:35 +09:00
For example, save the following content as `boot.yml` in the presets directory:
```yaml
type: blk
path: /dev/nvme0n1p2
mountpoint: /boot
```
2022-10-07 03:25:07 +09:00
Then when you run `xmnt boot`, the tool will look for encryption key according
to the UUID of `/dev/nvme0n1p2`, read the key, call `gpg --decrypt` to decrypt
the key when necessary, then use the key to open `/dev/nvme0n1p2`, and mount it
on `/boot`.
Directories for storing encryption keys are defined in
2022-10-07 04:55:07 +09:00
`$XDG_CONFIG_HOME/xmnt/xmnt.yml`. `xmnt` will recursively search these
2022-10-07 03:25:07 +09:00
directories for keys.
2022-10-07 02:39:35 +09:00
You can also use it without defining presets. See `--help` for detailed usage.
## Supported partition types
2022-10-07 04:55:07 +09:00
- luks encrypted partitions (e.g. ext4). luks "plain" format is not supported.
2022-10-07 02:39:35 +09:00
- regular unencrypted partitions
2022-10-07 04:55:07 +09:00
- zfs datasets (`keylocation=prompt`)