Part 1: Conversation Summary & Build Blueprint
We configured a custom, headless Linux data recovery environment built inside Cubic (Custom Ubuntu ISO Creator) using Ubuntu Server LTS as the base image. The environment is optimized to handle frequent reboots gracefully by utilizing stateless automation with network persistence.
📦 Installed Software Stack
• Core Utilities: gddrescue (data recovery), openssh-server/openssh-client (headless control), samba/smbclient/cifs-utils (NAS connectivity).
• Forensics & Carving: testdisk (partition repair), photorec (bundled with testdisk for file carving), foremost (lightweight signature carving).
• Hardware Analysis: smartmontools (smartctl drive health), hdparm (drive power/spin states), nvme-cli (NVMe diagnostic logs).
• Remote GUI Components: ddrescueview (visual mapfile viewer), gparted (partition manager), and xauth (enables X11 graphics forwarding over SSH).
⚙️ Automation & Configuration Changes
1. Console Boot Priority: Set default boot targets to multi-user.target to force a lightweight, text-only console on the physical monitor, maximizing RAM and stability.
2. SSH Tweaks: Enabled sshd, modified /etc/ssh/sshd_config to ensure X11Forwarding yes and PermitRootLogin yes are active, and configured a persistent root password.
3. Automated Storage Mounts: Created three custom systemd mount units (/etc/systemd/system/) to automatically map network arrays when online:
• mnt-unraid01.mount (Primary Target NAS Array)
• mnt-unraidbak.mount (Backup Target NAS Array)
• mnt-szrescue.mount (Dedicated script, note, and log orchestration directory)
4. Bootstrap Trigger Service: Created a systemd service (recovery-automation.service) that waits for all three mounts to be online, then executes an on-the-fly customization script (/mnt/szrescue/bootstrap.sh) hosted on your NAS.
5. Interactive Login Splash Screen (MOTD): Designed a custom, color-coded script (/etc/update-motd.d/99-szrescue-welcome) that outputs the system's purpose, live network mount connectivity states, active block devices tree (lsblk), and quick-command shortcuts automatically upon SSH login.
Part 2: Master Prompt to Recreate This Project
If you ever need to feed this context back into an AI assistant to spin up this exact project, continue troubleshooting, or write scripts for it, use the prompt below:
Act as a Linux systems engineering and data recovery expert. We are building/maintaining a custom headless data recovery ISO named "SZRescue" using Cubic (Custom Ubuntu ISO Creator) with an Ubuntu Server LTS base.
The environment is designed to handle frequent, automated reboots seamlessly while performing data recovery on failing disks. The environment boots into a text-only console (multi-user.target), automatically enables SSH with X11 Forwarding (`xauth` and `X11Forwarding yes` configured), and sets up a permanent root password.
The architecture relies on three systemd network mount units:
1. /mnt/unraid01 (Primary NAS data target) -> mnt-unraid01.mount
2. /mnt/unraidbak (Backup NAS data target) -> mnt-unraidbak.mount
3. /mnt/szrescue (Orchestration share for scripts, logs, notes) -> mnt-szrescue.mount
A systemd service named `recovery-automation.service` is configured to run a central script located at `/mnt/szrescue/bootstrap.sh` only after all three network shares are successfully mounted.
For the login interface, a custom MOTD script (`/etc/update-motd.d/99-szrescue-welcome`) is enabled. It uses ANSI colors to display the distribution name, purpose, dynamic mount connection status (ONLINE/FAILED), a clean block device tree (`lsblk` filtering out loop devices), and quick-command shortcuts.
Installed packages inside this chroot environment include: gddrescue, openssh-server, openssh-client, samba, smbclient, cifs-utils, testdisk, gparted, gdisk, foremost, smartmontools, hdparm, nvme-cli, ddrescueview, and xauth.
Keep all future suggestions, shell commands, script writing, and architectural advice aligned with this specific Cubic-based Ubuntu Server setup.