- Rust 94.4%
- Just 2.2%
- Dockerfile 1.7%
- Nix 1.7%
drive.rs: - #28: extract validate_device() → remove 5× repeated is_valid_device guard - #22/#23: merge get_drive_info/get_drive_info_cached/get_drive_info_no_fs → resolve_drive_info() - #22/#23: merge get_partitions/get_partitions_cached → resolve_partitions() - #21: extract is_main_block_device() → simplify get_all_drives and get_all_drives_with_partitions - #29: add impl Display for Drive tui.rs: - #24: extract build_list_item(), mount_status_color(), format_label() → eliminate ~250 lines of duplicated span-building - #25: extract column_padding() → deduplicate tab-alignment arithmetic - #26: extract confirm_or_execute() → unify confirmation across mount/unmount/eject - #27: extract exec_action() → deduplicate 3× copy-pasted success/error status arms models.rs: - #29: impl Display for Drive All 62 tests pass. |
||
|---|---|---|
| docs | ||
| src | ||
| .gitignore | ||
| .jjignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Containerfile | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| Justfile | ||
| LICENSE | ||
| README.md | ||
| TODO.md | ||
rmount
A Rust TUI (Terminal User Interface) drive mounting utility for Linux systems. rmount provides an intuitive interface for managing drive mounting, unmounting, and ejection operations with safety features to prevent accidental system drive modifications.
Features
- Interactive TUI: Navigate drives and partitions with keyboard shortcuts
- Safe Operations: Warnings for system drives to prevent accidental damage
- Multiple Interfaces: Both TUI and command-line interfaces available
- Comprehensive Drive Info: Display filesystem, size, mount status, and labels
- Auto-detection: Automatically detects removable drives and partitions
- Terminal Integration: Navigate to mounted drives using a shell wrapper function
Dependencies
System Requirements
- Linux operating system
- The following system utilities must be installed:
lsblk- List block devicesudisksctl- Disk management utility (usually part of udisks2 package)blkid- Block device identification utility
Installation of System Dependencies
Ubuntu/Debian:
sudo apt update
sudo apt install util-linux udisks2 util-linux-extra
Arch Linux:
sudo pacman -S util-linux udisks2
Fedora/RHEL/CentOS:
sudo dnf install util-linux udisks2
Installation
From Cargo
cargo install --git https://codeberg.org/Pontoporeia/rmount
Nix Flake
nix run git+https://codeberg.org/Pontoporeia/rmount
From Source
Quick build:
git clone https://codeberg.org/Pontoporeia/rmount.git
cd rmount
cargo build --release
sudo cp target/release/rmount /usr/local/bin/
See BUILDING.md for detailed build instructions.
Usage
TUI Mode (Default)
Launch the interactive terminal interface:
rmount
Command Line Options
# Start with auto-refresh disabled
rmount --no-auto-refresh
# Set custom refresh interval (in seconds)
rmount --refresh-interval 5
TUI Controls
Navigation
| Keys | Description |
|---|---|
j, ↓ |
Move down (partitions only) |
k, ↑ |
Move up (partitions only) |
g |
Go to top |
G |
Go to bottom |
Actions
| Keys | Description |
|---|---|
m |
Mount selected partition |
u |
Unmount selected partition |
e |
Eject selected drive |
o |
Print mount point path (quit TUI; use shell wrapper to cd) |
r |
Refresh drive list |
a |
Toggle auto-refresh |
Help & Interface
| Keys | Description |
|---|---|
?, h |
Show/hide help menu |
q |
Quit application |
y, n |
Confirm/cancel operations |
Esc |
Cancel current operation or close help |
Command Line Mode
List all drives
rmount list
Show detailed drive information
rmount info /dev/sdb1
Mount a drive
rmount mount /dev/sdb1
rmount mount /dev/sdb1 /mnt/mydrive # Custom mount point
Unmount a drive
rmount unmount /dev/sdb1
Eject a drive
rmount eject /dev/sdb
Shell Integration
Pressing o in the TUI or running rmount open /dev/sdX prints the mount
point path to stdout. To navigate there in your current shell instance
(no new process), add this one-liner to your shell config:
bash (~/.bashrc):
eval "$(rmount init bash)"
zsh (~/.zshrc):
eval "$(rmount init zsh)"
fish (~/.config/fish/config.fish):
rmount init fish | source
This works whether you use the TUI (rmount → press o on a mounted drive)
or the CLI (rmount open /dev/sdb1), and keeps your shell history,
environment variables, and job control intact.
Why a shell wrapper? On Unix, a child process cannot change its parent's working directory —
cdmust be a shell builtin. Every tool that navigates to a path (zoxide, fasd, direnv, nnn) uses this pattern.rmount initmakes it a one-liner.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines on:
- Setting up your development environment
- Code style and standards
- Testing requirements
- Submitting pull requests
- Reporting issues
For build instructions, see BUILDING.md.
Safety Notes
- System Drive Warning: rmount will warn you before performing operations on system drives
- Root Permissions: Some operations may require sudo privileges
- Data Safety: Always ensure important data is backed up before drive operations
AI Disclosure
This tool was developed with the assistance of large language models (LLMs) throughout its history. The following models were used:
- Claude Sonnet 3.5 through Claude Sonnet 4.6 (Anthropic)
- DeepSeek V4 Pro (DeepSeek)
AI assistance was employed for code generation, refactoring, test authoring, documentation, debugging, and project scaffolding. All AI-generated output was reviewed, tested, and validated by a human before inclusion.
License
This project is licensed under the AGPL 3.0 or Later License - see the LICENSE file for details.
Acknowledgments
- Built with ratatui for the terminal interface
- Uses clap for command line parsing
- Inspired by various Linux drive management utilities