Looking forward to TechnoDadLife video on the subject !
Newbie question on backing up boot device
-
-
I get it. I am looking for what other people are using and open for any successful details to try out and document findings afterwards.
I use dd in the shell. It's a one liner:
dd if=backup-image-file-name of=/dev/sdx bs=1M status=progress
x in /dev/sdx is the letter of the drive you wish to write the image out to and you had better be sure you are targeting the correct drive.
-
Yes, but it gets more complicated if you have a headless system like RPi or HC2. Then you need another computer to restore the backup.
Personally I use fsarchiver on Mint or Kubuntu to create backups.
Did you ever got into troubles backing up a live system?
-
-
usbimager is available for windows and linux.
So, up to you.
-
My system is headless but it's much more capable than RPi or HC2. It has an SOL console, reachable from anywhere.
I also have another bootable media plugged into it (my OMV 4 install on a USB drive that was current the day I moved to OMV 5), along with a spare USB that would become the replacement OMV system disk.
All I have to do is access the console, reboot the machine, and select the old OMV 4 disk. That gets me to a login shell and after verifying the target disk letter, it's that one liner.
-
usbimager is available for windows and linux.
So, up to you.
But it is not enough just put those files to a new SD, is it?
What exactly has to be done, so the final SD is bootable and has all OMV configuration ?
-
usbimager is available for windows and linux.
So, up to you.
Mac OS too.
-
I use dd in the shell. It's a one liner:
dd if=backup-image-file-name of=/dev/sdx bs=1M status=progress
x in /dev/sdx is the letter of the drive you wish to write the image out to and you had better be sure you are targeting the correct drive.
When I ran dd from the back up plugin. It created a number of files. There wasn't a traditional image file but a couple dd files. Do we just pick the largest one? It seems like all the rest would be necessary also.
-
The .ddfull.gz is the compressed dd image file of the entire drive. The other files are not needed for a restore from this image.
-
The OS drive is wiped? Or do you just write over it? What command do you use to list your drives from the live usb?
-
So I took output of dd backup file backup-omv-26-Jun-2020_12-07-45.ddful (~65GB) as was produced by the BackUp plugin (option dd full disk - use dd to clone the entire drive to a compressed image file.)
Used pishrink https://github.com/Drewsif/PiShrink and shrunk it to size 3.5GB and used Etcher to burn on to the SD card.
While in general I was able to boot up and log into OMV, I saw SMB and DLNA services as red.
So assuming it did not quite work as expected.
Question - is the dd full back up suppose to and was tested to restore fully operational backups ?
Or I am missing something here.
-
Question - is the dd full back up suppose to and was tested to restore fully operational backups ?
Or I am missing something here.
I use my own one line dd command that runs on cron nightly and have done so for more than five years. The restored images are fully functional. I have never had the slightest problem with this, never. I routinely test a restore about every six to eight weeks.
-
good to know I will double check again
-
While in general I was able to boot up and log into OMV, I saw SMB and DLNA services as red.
So assuming it did not quite work as expected.
Question - is the dd full back up suppose to and was tested to restore fully operational backups ?
Or I am missing something here.You did things after the plugin backed up your image. I would attribute the service start failures to pishrink or something else you did. Did the services start when disabled and re-enabled? Since you are backing a live OS, it is possible that some things may not be perfect (nothing the plugin can do about that) but I call your restore test a pretty good restore.
-
I actually was able on the second try to successful restore the system
Steps:
- run Backup plugin
- gzip -d backup-omv-30-Jun-2020_14-57-39.ddfull.gz
- sudo pishrink.sh -v backup-omv-30-Jun-2020_14-57-39.ddfull.img backup-omv-30-Jun-2020_14-57-39.ddfull-shrunk.img
- used Etcher to restore shrunk file
But had the same thought you described "Since you are backing a live OS, it is possible that some things may not be perfect"
How do you do manage that with crontab dd ? Do you stop services and then run dd?
Please share script if possible.
-
How do you do manage that with crontab dd ? Do you stop services and then run dd?
Please share script if possible.
Cron runs the script. No services are stopped.
Bash
Alles anzeigen#!/bin/bash # Script to make dd image of system drive now=$(date +"%Y.%m.%d.%H.%M.%S") file="omv-5-$now.img" cd /srv/dev-disk-by-label-d1/omv-backup-imgs dd if=/dev/disk/by-id/usb-SAMSUNG_SSD_UM410_Series_100000000000-0:0 of=$file bs=1M
You must determine what the if device is and you must decided where the images are stored.
-
OK I see
You get `boot` and `rootfs` at the end I assume.
I also wonder do you use regular command line crontab or PMV has some better way to run dd on schedule ?
Thx cool
-
Before burning the backup image using usbimager, should the sd card be formatted first? I haven't seen any reference to this. Is that just a given, or is usbimager just magical?
-
dd copies what you tell it to copy.
If the if= is a device it copies the entire device.
If the if= is a partition on a device it copies only that partition.
You can use OMV's Scheduled Jobs or edit root's crontab. It makes no difference. I edited root's crontab in the shell.
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!