Backup a live system

  • I wanted to backup my omv-extras repo machine while it was running. I was able to back it up and restore to a VM with no problems. So, I tried this with an OMV VM and it works as well. I thought I would post this here first before moving it to the forum. I don't think it needs to be a plugin but I thought it might be handy :)


    Backup - (don't mount the backup drive using web interface unless it will be there when you restore)

    Code
    apt-get clean
    mkdir /media/backup
    mount /dev/sdX1 /media/backup
    rsync -aAXv /* /media/backup/ --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/export,/home/ftp}
    dd if=/dev/sda of=/media/backup/grub.dd bs=446 count=1
    dd if=/dev/sda of=/media/backup/grub_parts.dd bs=512 count=1
    blkid > /media/backup/uuids
    umount /media/backup


    Restore (please ask for help in a new thread for restoring - not easy!)

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Nice!
    You can combine this with rsnapshot to have more restore points without much more space on the backup-medium wasted. With a cron job we have a automatic backup :)
    at least for the folders like /var, /usr, /etc ...

  • I finally managed to backup my system-drive to one of my Data-Drives with rsnapshot. It runs daily, weekly and monthly, so if a file is changed and I want to restore it, I can ;)
    RSnapshot is using hardlinks. The backup from the last 2 days is using ~3,55 GB with 3,5GB used on my system-drive.


    Heres the config (if anyone needs it)


    /etc/rsnapshot.d/systembackup.conf


    and in my /etc/anacrontab

    Code
    # system Backup
    @daily 10 rsnapshot.daily rsnapshot -c /etc/rsnapshot.d/systembackup.conf daily
    @weekly 10 rsnapshot.weekly rsnapshot -c /etc/rsnapshot.d/systembackup.conf weekly
    @ monthly 10 rsnapshot.monthly rsnapshot -c /etc/rsnapshot.d/systembackup.conf monthly
  • I left it in the testing repo because it doesn't have a restore (yet). The commands it uses are very stable (rsync, dd) and shouldn't never hurt a system because they are just copying the files (no writing).

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • I wish it helped with restore. Restore difficulty is still the problem with my method/plugin. I would add to your script backing up the mbr and partition table if you want to be able to restore from that backup.

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Hi,


    I m looking for this try of backup solution, and i am very new with debian and openmediavault, can someone pls help
    with step by step how to do this backup solution.


    many many thank you for help


    rdg.

  • Just boot clonezilla on your system using a cd or usb stick. It has a step by step menu that is easy to create a backup. It doesn't install anything to your system. Restore is done the same way.

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Would this kind of (manual) restore work?:


    1. Install same version of OMV with same kernel (original or from backports)
    2. Change uuid, copy files, modify /etc/udev/rules.d/70-persistent-net.rules, reboot

  • The newest version of the backup plugin (for kralizec) lets you install clonezilla and boot to it headlessly. I recommend this method over any other.

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!