Deterministic OS Reinstallation Engine for VPS and bare-metal servers.
OsNova is an automated Linux deployment and reinstallation tool for VPS and bare-metal systems.
It provides a deterministic way to reinstall Debian or Ubuntu directly from the running system using official upstream resources, without requiring a rescue ISO or external recovery environment.
OsNova prioritizes deterministic behavior, transparency, and minimal assumptions about the host environment.
This project is intended for operators who need a fast, reproducible, infrastructure-oriented reinstall workflow.
Use only on systems you own or are explicitly authorized to manage.
Requires Bash, root privileges, and an x86_64 system.
Review before execution:
curl -fsSL -o reinstall.sh https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh
less reinstall.shDefault installation (Debian 12):
bash <(curl -fsSL https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh)Debian 13 with custom password and SSH port:
bash <(curl -fsSL https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh) -d 13 -p "YourPassword" --port 2222Ubuntu 24.04:
bash <(curl -fsSL https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh) -u 24Ubuntu 22.04:
bash <(curl -fsSL https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh) -u 22Custom DNS example:
bash <(curl -fsSL https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh) -u 24 --dns "1.1.1.1 9.9.9.9"Skip confirmation prompt (for automation):
bash <(curl -fsSL https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh) -u 24 -p "SecurePassword" --port 2222 --forceFull example:
bash <(curl -fsSL https://raw.githubusercontent.com/harryheros/osnova/main/os/reinstall.sh) -u 24 -p "SecurePassword" --port 2222 --dns "8.8.8.8 8.8.4.4" --force
⚠️ This tool will completely erase the primary disk and reinstall the operating system.All existing data on the target disk will be permanently destroyed.
Do not run it unless you fully understand the consequences.
Starting from v2.0.0, OsNova requires explicit confirmation before proceeding. Use
--forceto skip this prompt in automated workflows.
- Unified Debian and Ubuntu reinstall workflow
- Works on both BIOS and UEFI systems
- Cross-distribution execution support
- Uses official upstream installer or image resources
- Debian installation via official netboot installer and preseed automation
- Ubuntu deployment via official cloud image and direct disk write
- Automatic disk and network detection
- Static IPv4 migration from the current system
- Optional IPv6 carry-over when detected
- IPv4 /32 and IPv6 /128 on-link route handling
- Debian networking configured with systemd-networkd
- Ubuntu networking configured with netplan rendered by systemd-networkd
- Custom DNS server support via --dns
- Automatic SSH root login configuration
- Custom SSH port support with reliable fallback injection
- Automatic random root password generation when -p is not provided
- Password validation to prevent shell-unsafe characters
- Built-in FQ and BBR network optimization
- Ubuntu cloud image integrity verification
- Ubuntu EFI fallback boot path repair
- CentOS 7 Vault fallback for legacy dependency installation
- Interactive confirmation prompt before disk erasure
- Root privilege and architecture pre-checks
- Idempotent GRUB configuration
Debian:
- Debian 13 (Trixie)
- Debian 12 (Bookworm) — default
- Debian 11 (Bullseye)
Ubuntu:
- Ubuntu 24.04 LTS (Noble) — default
- Ubuntu 22.04 LTS (Jammy)
Debian path:
- Pre-check root privilege and x86_64 architecture
- Detect current disk and network configuration
- Confirm with operator before proceeding
- Download official Debian netboot installer
- Inject preseed configuration and post-install script into initrd
- Create a temporary GRUB boot entry
- Reboot into the automated Debian installer
Ubuntu path:
- Pre-check root privilege and x86_64 architecture
- Detect current disk and network configuration
- Confirm with operator before proceeding
- Download official Ubuntu cloud image and verify integrity
- Mount the image through qemu-nbd
- Configure root password, SSH, sysctl, netplan, cloud-init seed, and DNS
- Repair EFI fallback boot path if needed
- Write the image directly to the target disk
- Reboot into the new system
| Parameter | Description |
|---|---|
-d [11|12|13] |
Install Debian (default: 12) |
-u [22|24] |
Install Ubuntu (default: 24) |
-p PASSWORD |
Set root password |
-port PORT, --port PORT |
Set SSH port (default: 22) |
--dns "IP1 IP2" |
Set DNS servers (default: 8.8.8.8 8.8.4.4) |
-f, --force |
Skip confirmation prompt |
-v, --version |
Show version info |
-h, --help |
Show help |
If -p is not provided, a 20-character random password is generated automatically.
Allowed characters: A-Z a-z 0-9 ! @ # % ^ * _ + = . -
Characters that could interfere with shell expansion or preseed parsing are rejected:
$ ` " ' \ spaces ( ) { } | & ; < > ~
- A confirmation prompt is displayed before any destructive action (skip with
--force) - If -p is not provided, a random root password is generated automatically
- The generated password is displayed before reboot and must be saved by the operator
- SSH is configured to allow root login and password authentication
- The detected primary disk is used as the installation target
- Current network settings are reused for static configuration
- Default DNS servers are 8.8.8.8 and 8.8.4.4 unless overridden
- If --dns is provided, those DNS servers are written into the installed system
Debian:
OsNova installs a static systemd-networkd configuration using the detected IPv4 settings, optional IPv6 settings, and the selected DNS servers. IPv4 /32 and IPv6 /128 prefixes are handled with GatewayOnLink routing.
Ubuntu:
OsNova installs a static netplan configuration rendered by systemd-networkd, disables cloud-init network generation, and writes the selected DNS servers into the installed system. IPv4 /32 and IPv6 /128 prefixes are handled with on-link routing.
- KVM virtual machines
- Common cloud VPS providers
- BIOS systems
- UEFI systems
OsNova is intended for:
- VPS reprovisioning
- Bare-metal operating system replacement
- Clean system redeployment
- Infrastructure rebuild workflows
- Deterministic Debian and Ubuntu reinstall operations
It is not designed as a rescue panel replacement or a consumer desktop installer.
- Fixed Debian installer hang at "Loading additional components / Retrieving *.udeb" on hosts with broken IPv6: the script now probes actual IPv6 reachability and, if an address is present but unroutable (common on budget VPS), disables IPv6 for both the installer (
ipv6.disable=1on the kernel cmdline) and the installed system — degrading cleanly to IPv4-only. Hosts with working IPv6 keep full dual-stack; IPv4-only hosts are unaffected - Fixed Debian installer hang by adding an explicit mirror block (
mirror/http/hostname,directory,suite) to both the preseed and the kernel command line — previously no mirror was specified, so the installer had no host to fetch udebs from - Fixed
netcfg/get_nameserverspassing a space-separated DNS list (d-i treats it as a single token, breaking udeb-stage DNS); the installer now uses the first DNS, while the full list is still written into the installed system - Added
netcfg/get_hostnameandnetcfg/get_domainto prevent hidden prompts when DNS is unstable - Made
preseed/late_commandrobust: searches multiple known locations forpost-install.sh, uses&&chaining so failures surface, and logs to/var/log/osnova-postinstall.login the target system - post-install.sh is now staged in multiple initrd locations so it survives regardless of d-i build layout
- Added
partman/early_commandto wipe pre-existing LVM/MD/partition signatures (vgchange,pvremove,mdadm --stop,wipefs) pluspartman-lvm/device_remove_lvmandpartman-md/device_remove_md, preventing silent partitioner hangs on previously-provisioned disks - Switched GRUB default selection to the canonical
GRUB_DEFAULT=saved+grub-set-default/grub-rebootmethod and forcedGRUB_DISABLE_SUBMENU=y, so the installer entry boots reliably even when GRUB builds a submenu - No user-facing CLI changes — fully compatible with v2.1.0 invocation
- Fixed network detection on hosts with multi-IP interfaces (cloud VPS with main IP + alias addresses)
- Fixed mixed IPv4/IPv6 default routes pointing at different interfaces (
ip -4/ip -6now used explicitly) - Fixed disk detection to use awk exact-equality on the TYPE column instead of substring match
- Added wget
--tries=3 --timeout=30/60to both Debian netboot and Ubuntu cloud image downloads - Added qcow2 format pre-check via
qemu-img info(catches HTML error pages saved as.img) - Ubuntu image download no longer uses
--continue— stale images from a different release URL are removed first - Added IPv4 default-route guard: script now aborts cleanly if no default route is detected
- Added qemu-nbd settle delay between disconnect and connect
- Refactored systemd-networkd IPv6 block to use a single pre-built string instead of nested heredoc-in-command-substitution
- No user-facing CLI changes — fully compatible with v2.0.0 invocation
- Added root privilege and x86_64 architecture pre-checks
- Added interactive confirmation prompt before disk erasure (
--forceto skip) - Added
--version/-vparameter - Added password validation to reject shell-unsafe characters
- Upgraded random password generation to 20 characters with symbols
- Fixed preseed password injection to prevent shell expansion issues
- Fixed SSH port configuration to reliably write Port even when missing from sshd_config
- Fixed GRUB_DISABLE_OS_PROBER repeated append (now idempotent)
- Fixed disk detection fallback to exclude loop, nbd, ram, and zram devices
- Added Ubuntu cloud image integrity verification via qemu-img check
- Added IPv6 /128 on-link route support for both Debian and Ubuntu paths
- Improved cleanup trap to cover HUP/PIPE signals and temporary work directory
- Debian BBR configuration moved to dedicated sysctl.d file
- Debian SSH configuration now uses sshd_config.d override for reliability
- Initial release
GPL-3.0
OsNova is distributed under GPL-3.0.
All components comply with upstream licensing requirements of the Linux ecosystem.
Part of the Nova infrastructure toolkit.