Backup entire os partition offline, booting from a ramdisk



Recommended Posts

it's nice and handy to be able to backup our os image and restore it, just in case. The problem is that a full os backup need the root partition to be mounted read only. And some of us are running the device without any monitor attached (headless) or it's not very practical to get acces to the sdcard (for exemple, when the device is installed in the electrical cabinet)


So, I had the idea of creating some kind of ramdisk with some utilities (base tools, ssh, rsync...) to backup the "offline" root partition and send it to another computer. Ultimately, this process could be started also by network boot, by U-Boot script.

When you decide to backup the root partition, just go to /boot and replace the boot.scr adapted for your need and purposes and reboot. For debugging, it's best to have access to the serial console with and uart to usb or be connected locally with a monitor.


as a start, I've tried 2 methods of booting, from sdcard at first, and network (which is a little more tricky but I won't talk much about it for now)


boot.cmd (and boot.scr):


setenv bootargs init=/bin/bash root=/dev/mmcblk1p1 ro rootwait console=ttyAML0,115200 console=tty1
setenv devtype "mmc"
ext4load mmc 0 ${kernel_addr_r} /boot/uImage
ext4load mmc 0 ${fdt_addr_r} /boot/dtb/${fdtfile}
bootm ${kernel_addr_r} - ${fdt_addr_r}


this boot the kernel but I got stuck at some point while booting, I believe that's because of the root partition. I don't want to use the root partition on the sdcard, instead I need some kind of independent ramdisk root partition (with the tools for backup)


Do you have an idea of how to achieve this, how to create and boot from a "squashfs" recovery like partition ?

Link to post
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.