Skip to content

Scripts to backup and restore OS via SSH (no need to go to server room).

Notifications You must be signed in to change notification settings

dpnm-ni/os-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Scripts to backup and restore LVM root volume on headless server, using fsarchiver.

Requirement

Scripts only support LVM. We only tested with Ubuntu. Also, the system must have free diskspace to create new LVM volumes: one to store the backup files and another as snapshot. If you use all disk space for LVM, you need to shrink it down. E.g.:

sudo ./lvreduce.sh -l 100G
sudo reboot

Note: lvreduce creates initramfs program to shrink root filesystem at boot. You must update initramfs again after reboot to restore old initramfs.

sudo update-initramfs -u

Usage

  • Create backup file

    sudo ./backup_w_fsarchiver.sh -b -n fresh_u16_04
    
  • When the system is messed up, just restore backup

    sudo ./backup_w_fsarchiver.sh -r -n fresh_u16_04
    sudo reboot
    

For more details on each scripts, run ./<script_name> -h.

About

Scripts to backup and restore OS via SSH (no need to go to server room).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages