A terminal-based drive management tool for Linux (Debian-based), written primarily in C++.
This application provides a straightforward interface for managing storage devices β HDDs, SSDs, and more β directly from the command line.
Performing Disk operations on Linux often requires chaining multiple commands together, like lsblk, dd and more.
A small mistake can lead to:
- Data loss
- System instability
- Irreversible changes
This tool exists to make those operations safer and reproducible.
It provides:
- Dry-run mode before execution
- Explicit command preview in the source code
- Input validation
- Safety confirmations
- Structured logging
- TUI for controlled interaction
The goal is not to replace underlying tools, but to add a safety and orchestration layer on top of them.
- Experimental:
v0.9.28.64
(idk waht even is new)
- Rust GUI:
v0.1.5-alpha(Lists drives; not feature complete) - C++ GUI:
v0.1.1-alpha
(GUI versions lag behind CLI/TUI)
This tool is for advanced users only! Formatting, encrypting, or modifying drives is inherently risky.
- Always back up your data.
- Do not type arbitrary or dangerous input at prompts (such as
/dev/sda rm -rf). - Double-check all device paths before confirming any destructive operation.
/Sectrctl_CLI - CLI source code (C++)
/include - Headers (.h)
/src - Core sources
/Sectrctl_GUI - GUI version (Rust/C++)
/Launcher
launcher.cpp - Launcher source code (C++)
launcher - Launcher binary
/Lume
Lume (elf) - Text editor for Configuration editing in ldisk
main_lume.cpp - Lume source code (C++)
/Log and Key file
log.dat - Example log file
setuo.py - Build/install script
config.conf - Example config
- nothing i have no idea waht to do next
| Feature | Status | Description |
|---|---|---|
| List Drives and Partitions | Working | Shows all connected storage devices |
| SMART disk health check | Working | Reads health data from drives |
| Format Disk (lable, fstype) | Wokring | Helps Formatting drives |
| Partition Management | Wokring | Helps Manaing Partitions |
| USB Drive En- an Decryption | Working | Encrypts USB Drives |
| Drive Overwriting | Working | Wipes drive to 0 |
| Logging and config system | Working | Change history / For start preferences and colors |
| viewing Metadata | Working | View Metadata of Drives; Works with raw and SMART |
| Forensic/Recovery Tools | Experimental | For file recovery and stuff |
| Low viewer | Working | View last Loggs and wipe Log file clean if you want |
| Clone Drives | Wokring | Clone content of a Drive from one to another |
| Config viewer and editor with Lume | Working | View Config setting and change them i prefered |
| Fingerprinting | Working | Create a sha256 hash Fingerprint of you drive |
| Color themes | Wokring | Choose color of Menu boxes and selection color |
| Intigrated Tests | Working | Test side and helper functions right in the program |
Every command has a normal name and a shortend abstract version
| Command | Description |
|---|---|
| --version, -v | Prints the current version of the Dmgr |
| --help, -h | Prints the printusage for all CLI commands |
| --dry-run, -n | Disables the execution of commads through the exec_cmd.h api in the current session |
| --no-color, -c | Disables the use of colors in the current session |
| --no-log, -nl | Disables loggin in the current session |
| --debug, -d | Enables that debug_msg() functions are printed and enables the usage of the Test option in the current session |
| --info, -i | Show Dmgr info |
| --logs, -l | Show log file content |
| --select [device], -sd [device] | Pre selects the drive you entered, skiping the drive selection in the current session |
| --config-src [path], -cfg-src [path] | With this you can load the program with another config file in the current session |
| --operation-name | With this you can directly jump to functions/operation wihtout using the menu |
If during the installation somthing unexpected happens, you can ask for help by opening an issue or a discussion
- Linux (debian based recommended, but it should also run on other distros)
- C++17 compiler (e.g., g++) or higher
- OpenSSL dev libraries
- build-essential, smartmontools
- Python3 with os libary
The Requirements are only for when you manualy build the Application from scratch. If you use the build script, it will automaticly check and get the Required things
git clone https://github.com/Dogwalker-kryt/Drive-Manager-Linux
cd Drive-Manager-LinuxThere are 2 ways to do that:
If you choose to use the setup script you have to do/check the following:
- Choose a path where the Dmgr should be installed in the
.envfile - You have one of these package managers:
- apt
- zypper
- dnf
- yum
- pacman
- You have
python3installed
If everything is checked, then run this command:
(You may need to run it with sudo if the needed packages aren't installed)
python3 setup.pyIf everything went successfull, then you will be prompted if you want the script to compile the Dmgr.
If you choose y then you finished the installtion and the Dmgr is ready to use
Create in a dir you like the following dirs
- path/bin
- path/bin/bin
- path/bin/other_src
- path/data
- path/other
Create data and move files Move the files in the right dirs:
- config.conf -> data/
- log.dat -> data/
- .env -> data/
- *.md -> other/
- launcher/ -> bin/
- Lume/ -> bin/
- DriveMgr_CLI and GUI -> bin/other_src
cd into the DriveMgr_CLI folder, them run:
makeAfter this move the Binary into the path/bin/bin folder
cd into the DriveMgr_GUI folder, them run or the Rust version (if you have rust compiler):
cargo buildcd into the DriveMgr_GUI/C++-GTK-GUI folder, them run or the Rust version (if you have gtk):
makeIf you alredy installed Sectr-ctl and want to update, move its location, or just reintsall it because something went wrong. Here are the following choices:
In development!!!!
If you dont want to loose your color theme and other config file values, consider backing it up
Delete the Sectr-ctl (DriveMgr old name) in the directory you installed it
Clone the repo. Then use the setup scirpt or manual install the Sectr-ctl. If this is done then swap the config file with you backed up version
The recommended terminal hight and width are:
- hight : 40
- width : 120
when not using the min recommended hight and width, this can lead to corrupted text prints
Start by running the program (root required for some features):
starting raw binary
sudo ./DriveMgr with flags
sudo ./DriveMgr --operation-name through Launcher
sudo dmgr When started, you'll see a menu, for example:
βββββββββββββββββββββββββββββββββββββββ
β DRIVE MANAGEMENT UTILITY β
βββββββββββββββββββββββββββββββββββββββ€
β 1. List Drives β
β 2. Format Drive β
β 3. Encrypt/Decrypt Drive β
β ... β
β 0. Exit β
βββββββββββββββββββββββββββββββββββββββ
Navigate by using the Arrow Key's (in main menu only) to the desired action. The tool will prompt you for additional information (drive number, confirm, etc).
For dangerous actions, an extra key (e.g., generated security key) is required as a safety confirmation.
- This is the documentation of how to use the tests.
- the tests are only realy for developers there, so if you dont change the code, you wont need test
When developing a new function you write the function like this:
TestResult test_YOUR_TEST() {
/* test code depends on the test */
if (/* if test fail */) {
return {"test_YOUR_TEST", false, "Describtion of what failed"}
}
// if it succeeds:
return {"test_YOUR_TEST", true, ""}
}TestResultis the struct used to store the result of how many tests failed/succeded.- To return proplerly do:
return {"test_YOUR_TEST", bool, "if fails, description"}. - when returning
true, the test is marked as succeeded - when returning
false, the test is marked as failed
[CmdExec Tests]
[DRY-RUN] Would execute: touch /tmp/test_drivemgr_dryrun_test_file_12345
[Input Validation Tests]
[ERROR] Invalid input (src/DmgrLib.cpp:186, getInt) - Input not in allowed integer list
[ERROR] Invalid input (src/DmgrLib.cpp:196, getInt) - Conversion from string to int failed
[ERROR] Invalid input (src/DmgrLib.cpp:313, getChar) - Character not allowed
[ERROR] Invalid input (src/DmgrLib.cpp:302, getChar) - Input must be exactly one character
[Utility Tests]
======== Test Summary ========
[PASSED] 21
[FAILED] 1
[Failed Tests Details]
β test_cmdexec_stderr
Message: stderr not captured correctly
===============================
Press '1' for returning to the main menu, '2' to exit:When reading the results, it is important to only read the test summary and not the output. The output before test summary is error messages from succede tests and junk. for example getInt/Char, if the input is off its limits, throws an error to the terminal -> this is expected!
So to cause not any confusion, ignore the output before test summary
Distributed under the GPL-3.0 License.
- Found a bug or have an idea? Open an issue
- Want to contribute? See CONTRIBUTING.md
- Like the tool? Star the repo!
- Info block sometimes not printing right
- Drive Fingerprinting sometimes returning to main menu before it could do anything
You found an issue? If you found an issue that is presistent after restarting the Application, please report it by opening an issue with a detailed report
Disclaimer: This tool is in active development. Features may not always be stable. Use at your own riskβalways test on non-critical systems!
if you like the Drive Manager Utility, please leave a star