Backing Up Haiku -or- The Clone Wars

I have a challanging situation:
As a daily driver of Haiku for many years now I have an install with 1.2TB of data that I routinely backup using ‘rsync’. However, this does not result in a bootable drive. I believe it’s because the system files are in the “live” state while performing the backup as opposed to the packaged state the system normally boots in. (yes I installed boot files etc…)- the system starts to boot but hangs.

So I thought to run ‘Installer’ on the drive from my main install. Normally this would be a great solution because I can really get a bootable clone without having to reinstall everything. However, Installer seems to be having a hard time with 1.2TB of data… After an hour, the “Install Progress” meter shows no progress.

dd is a painfully slow and dangerous solution…

What would be the best way to get a bootable Haiku clone?

If you use rsync correctly (at least make sure you set the flags to not cross filesystem boundaries, preserve permissions and extended attributes. I’m not sure if more is needed.), I think all you need after rsync is done is to run makebootable on the target partition after the synchronization is complete. Installer doesn’t do anything more than that: copy the files and then run makebootable.

What’s the copy command that Installer uses? cp? any special flags? I could make a script from that…

It doesn’t use a command, it implements file copying directly in C++.

It also implements a few additional things, like ignoring some files and creating some empty directories if they are not there.

You can try to extract this info from the sourcecode:

https://cgit.haiku-os.org/haiku/tree/src/apps/installer/WorkerThread.cpp#n89

1 Like

So if I start with a clean install on my backup drive, I should be able to run rsync like this and end up with a bootable backup:

rsync -v -r -u -l --delete --exclude /boot/system/var/swap --exclude /boot/system/var/shared_memory --exclude /boot/system/var/log/syslog --exclude /boot/system/var/log/syslog.old /boot/system/ /$TARGET/system/ ;

rsync -v -r -u -l --delete /boot/home/ /$TARGET/home/ ;

Ad a call to makebootable and I think you have a good chance this will work. If not, a look at the syslog may help find what’s missing

1 Like