cryptpilot-crypt provides a systemd service to automatically decrypt and open encrypted volumes during system startup.
The cryptpilot.service systemd unit runs during the System Manager stage (after initrd has completed and the system has fully booted). It automatically processes all volumes configured with auto_open = true in their configuration files.
- Service Unit:
cryptpilot.service - Location:
/usr/lib/systemd/system/cryptpilot.service - Execution Stage: System Manager stage (after boot)
- Command:
/usr/bin/cryptpilot-crypt boot-service --stage system-volumes-auto-open
During system startup, the service:
- Scans all volume configuration files in
/etc/cryptpilot/volumes/ - Identifies volumes with
auto_open = true - Attempts to open each volume using its configured key provider
- Creates device mapper nodes at
/dev/mapper/<volume-name> - Logs any errors encountered
To enable automatic opening of encrypted volumes at boot:
Ensure your volume configuration includes auto_open = true:
# /etc/cryptpilot/volumes/data0.toml
volume = "data0"
dev = "/dev/nvme1n1p1"
auto_open = true
makefs = "ext4"
[encrypt.kbs]
url = "https://kbs.example.com"
resource_path = "/secrets/data0-key"Enable and start the systemd service:
systemctl enable --now cryptpilot.serviceThis command:
enable: Configures the service to start automatically at boot--now: Immediately starts the service (for the current session)
Check that the service is running:
systemctl status cryptpilot.serviceExpected output:
● cryptpilot.service - Auto-open encrypted volumes
Loaded: loaded (/usr/lib/systemd/system/cryptpilot.service; enabled; vendor preset: disabled)
Active: active (exited) since ...
After enabling auto-open, you can add entries to /etc/fstab for automatic mounting:
# /etc/fstab
/dev/mapper/data0 /mnt/data0 ext4 defaults 0 2This achieves fully automated decryption and mounting:
cryptpilot.serviceopens the encrypted volume →/dev/mapper/data0systemdmounts the device according to/etc/fstab→/mnt/data0
systemctl start cryptpilot.servicesystemctl stop cryptpilot.serviceNote: Stopping the service does NOT close already-opened volumes. Use cryptpilot-crypt close <volume> to close volumes manually.
systemctl restart cryptpilot.serviceTo prevent automatic opening at boot:
systemctl disable cryptpilot.service- Configuration Guide - Volume configuration options
- Main README - Quick start and usage examples
- Development Guide - Build and test instructions