luksctl
A CLI tool for easily mounting and unmounting LUKS encrypted volumes.
Features
- 🔐 Easy mount/unmount of LUKS encrypted volumes
- 🆔 UUID-based mapper name auto-generation (collision prevention)
- 📁 Auto-create mount point with
--mkdiroption - ⚙️ Various mount options support (
--ro,--fs-type,--options) - 🌐 Multi-language support (English, Korean, Japanese)
Installation
Using Make (Recommended)
# Build and install to /usr/local/bin
# Or install to a custom location
# Uninstall
Manual Installation
Usage
Mount
# Basic usage
# Auto-create mount point if it doesn't exist
# Mount as read-only
# Specify filesystem type
# Specify additional mount options
# Combine all options
Unmount
# Basic unmount (automatically locks LUKS)
# Force unmount (lazy unmount)
Command Options
luks_mount
| Option | Short | Description |
|---|---|---|
--mkdir |
Create mount point directory if it doesn't exist | |
--ro |
-r |
Mount as read-only |
--fs-type |
-t |
Specify filesystem type (e.g., ext4, xfs, btrfs) |
--options |
-o |
Additional mount options (comma-separated) |
luks_umount
| Option | Short | Description |
|---|---|---|
--force |
-f |
Force unmount (lazy unmount) |
Localization
The tool automatically detects your system locale from the LANG environment variable and displays messages in the appropriate language.
Supported languages:
- English (en) - Default
- Korean (ko)
- Japanese (ja)
Example:
# Use Korean
LANG=ko_KR.UTF-8
# Use Japanese
LANG=ja_JP.UTF-8
How It Works
-
On mount (
luks_mount):- Verify the device is a LUKS device
- Generate a unique UUID-based mapper name (e.g.,
luks-a1b2c3d4-...) - Prompt for password and execute
cryptsetup open - Mount
/dev/mapper/{mapper_name}to the specified mount point - Save mount information to
/run/luksctl/
-
On unmount (
luks_umount):- Find mapper name from saved mapping info or
/proc/mounts - Unmount the filesystem
- Lock the LUKS device with
cryptsetup close
- Find mapper name from saved mapping info or
License
AI-Generated Code Notice
Parts of this project were created with assistance from AI tools (e.g. large language models). All AI-assisted contributions were reviewed and adapted by maintainers before inclusion. If you need provenance for specific changes, please refer to the Git history and commit messages.