This tutorial and script are written by our MOD @gelbuilding. Welcome to test it in the test environment, and give us the feedback.
Zima System Restore to USB (Complete Tutorial + Suggestion for Integration)
I’ve read many posts across the forum where users were asking for a proper system-level restore method or struggling after a bad update, system corruption, or reinstall. Because of that, I put together a complete and safe method for backing up and restoring the ZimaOS system disk to a USB device.
This lets users create a 1:1 clone of the OS disk that can be restored in minutes on ZimaBlade, ZimaCube, Proxmox, or bare metal.
It also avoids touching DATA disks, which ZimaOS will re-mount automatically after restoration.
This tutorial now includes everything needed: correct USB mounting, device verification, ZimaBlade onboard eMMC support, optional checksum validation, and complete backup + restore commands.
1. Why Only the OS Disk Should Be Backed Up
ZimaOS is designed like modern NAS systems:
- The OS and system partitions live on a small partition (32–64 GB)
- All media, AppData, containers, downloads, and user files sit on DATA partition
Backing up just the OS partition:
- Keeps the backup tiny (2–6 GB compressed)
- Finishes in under 2 minutes
- Avoids cloning terabytes of data
- Restores cleanly regardless of hardware
After restoration, ZimaOS automatically re-mounts DATA partitions, other storage space, and all apps reappear instantly.
2. Safety Checks Before You Begin
Identify the OS disk and USB drive
Always confirm the correct disk to avoid overwriting the wrong one:
lsblk
# In most cases:
# ZimaCube / NVMe systems: `/dev/nvme0n1`
# ZimaBlade / onboard eMMC: `/dev/mmcblk0`
# Proxmox / SATA systems: `/dev/sda`
Check USB size
Ensure at least 8–16 GB available:
df -h /media/<USB drive>
USB formatting
ext4 is recommended for large image files.
FAT32 cannot store files above 4 GB.
Format if needed:
mkfs.ext4 /dev/sdX1
3. Creating the System Backup on USB
Step 1. Identify the USB device
lsblk
Find something like /dev/sdb1.
Step 2. Create USB mount point
mkdir -p /media/usb
mkdir -p /media/usb/backup
Step 3. Mount the USB
(This step is required)
mount /dev/sdX1 /media/usb
Verify:
mount | grep /media/usb
Step 4. Back up the OS disk
NVMe systems (ZimaCube / PC / Proxmox)
dd if=/dev/nvme0n1 bs=64M status=progress | gzip > /media/usb/backup/zimaos_system_backup.img.gz
sync
Emmc onboard storage
dd if=/dev/mmcblk0 bs=64M status=progress | gzip > /media/usb/backup/zimaos_system_backup.img.gz
sync
Step 5. Optional: verify the backup
sha256sum /media/usb/backup/zimaos_system_backup.img.gz > /media/usb/backup/backup.sha256
Later check:
sha256sum -c /media/usb/backup/backup.sha256
4. Restoring ZimaOS From USB
Step 1. Confirm USB is mounted
mount | grep /media/usb
If not:
mount /dev/sdX1 /media/usb
Step 2. Restore the system image
NVMe systems
gunzip -c /media/usb/backup/zimaos_system_backup.img.gz | dd of=/dev/nvme0n1 bs=64M status=progress
Emmc onboard storage
gunzip -c /media/usb/backup/zimaos_system_backup.img.gz | dd of=/dev/mmcblk0 bs=64M status=progress
Step 3. Reboot into the restored system
reboot
ZimaOS will return exactly to the state captured in the backup.
All DATA disks will auto-mount and all apps will reappear as before.
5. How the Commands Work
dd if=/dev/nvme0n1
Reads the entire OS disk byte-for-byte.
bs=64M
Improves performance.
status=progress
Shows live status.
gzip
Compresses the output.
sync
Flushes all pending writes to USB.
gunzip -c
Decompresses the backup image for restore.
dd of=/dev/...
Writes it back exactly as it was.
Suggestion for ZimaOS
This would be a great built-in feature for ZimaOS.
A simple UI could:
- Detect the OS disk automatically
- Detect and validate a USB device
- Check available space
- Perform the backup and compression
- Provide a one-click restore option
- Prevent overwriting DATA disks
This would eliminate most user errors and give ZimaOS a fast, reliable, pro-level recovery system.
