Jump to content

Hello guys

 

I'm trying to create a backup of my Linux system in case it fails. From what I have read online the best / easiest option would be to first install the operating system and then restore a backup on the system. As backup solution, I want to use borgbackup because it is a deduplicating backup program (It will only store the changes so it is more storage-friendly) and it also encrypted the backup. I also want to create the backup over ssh so that I don't have to plug in an external hard drive each time I want to create a backup.

 

The operating system I wish to backup is openmediavault 5.5.6.


How I create the backup:

Borg command to create the backup:

Spoiler

borg create --stats user@192.168.0.156:/home/user/Desktop/backup::backupname / --exclude={"/boot/*","/dev/*","/lost+found/*","/media/*","/mnt/*","/proc/*","/run/*","/sys/*","/tmp/*","/var/*","/etc/fstab"}

 

 

How I restore the backup:

1) First, install the operating system on the system.

2) Plug the hard drive into a different system and cd into the hard drive.

3) Extract the backup onto the hard drive with the command below:

Spoiler

borg extract --stats user@192.168.0.156:/home/user/Desktop/backup::backupname

 

 

The problem:
When I restore the backup the folders and files I create are back but the programs  plugins that I installed are still missing/not installed. How could I also backup all the programs plugins that I had installed on the system?

 

What I want/need:

1) Full backup of Linux system. In case I need to restore I'm oke with first installing the operating system.

2) send the backup to a different device (probably using ssh).

3) Encrypted the backup with a password.

4) Automated the backup so that I never have to think about making a backup.

5) The backup solution should be a deduplicating backup program so that it is storage-friendly.

 

Thanks in advance.

Edited by corruptedButterlfy
Changed programs to plugins
Link to comment
https://linustechtips.com/topic/1231976-how-to-create-a-full-linux-backup/
Share on other sites

Link to post
Share on other sites

Clonezilla

How to Use Clonezilla

 

Quote

I also want to create the backup over ssh so that I don't have to plug in an external hard drive each time I want to create a backup.

Very insecure way to do this;  powers that be give 'convenience' at the cost of Freedom -- your choice, consumer.

Link to post
Share on other sites

Thanks for your reaction. Clonezilla looks awesome but if I'm right I will not be able to automate this and run a daily backup without doing anything(sorry if this was not clear from my original post I will change it). In case there is a way please let me know :).

Link to post
Share on other sites

Hi @corruptedButterlfy,

 

I'm not sure why your solution fails, as I'm not familiar with OpenMediaVault nor borg.

 

However, I can see a few problems and I do have a good guess on what is going wrong. First, a bit of Linux philosophy: 1) every Linux system is different, there is no "Generic GNU+Linux System". 2) What you need is a bit too complicated thing to achieve for every Linux system. You need to know the system and how it works to achieve what you want. With OS X/AppleOS or Windowses, things are a bit simpler as these OSes installations are not as varied, as what can and is done differently in different Linux distributions.

 

The problems I can see: 1) You are not backing up /boot nor /etc/fstab, is this intentional? You do need to be able to recover the contents of these (which are not empty in 98% of "Linux Systems"), unless you know what you are doing and can recover these later. 2) You are not backing up your bootloader. This may be included in /boot or elsewhere, depending on your config. Again, not a problem if you know how things are set up and know how to recover in case of failure...

 

My guess on what is wrong: borg is not making as complete backup as you think it is making. Look at the OpenMediaVault system, and know where it installs and stores it's "Installed Software". One likely place is /mount; while it usually doesn't make sense to backup the contents of this directory, it is possible in your case you need to back up a directory/mountpoint in there. Many "Linux Systems", which have a static, read-only image, mount something here to store some packages (apps) installed via a GUI. This kind of "Linux Systems" include PVR/Streaming -oriented distributions, which have their core image as a Read-Only partition/image and all user-saved settings and applications in an RW partition. I'm not sure if OpenMediaVault falls in this category, but it seems like a strong possibility.

 

Note: I've used quotation marks (in a common incorrect way) for things I consider misnomers in the context in my writing, to simplify the text. In case you want to know why I think of them as such, just ask!

Edited by Wild Penquin
TYPOs
Link to post
Share on other sites

Hi @Wild Penquin

 

Yes not creating a backup from the /boot and /etc/fstab directories is intentional because the system wouldn't boot if I included these. If I'm correct the only downside to not creating a backup from these directories is the fact that I will first have to install an operating system and then restore the backup.

 

In openmediavault you have these things called plugins I thought that these were the same as packages unfortunately they are not. "Normal packages" (packages that you install with apt-get install package-name) are restored whit the backup. I think if I can find where these plugins are stored the backup should work.

 

Thank you very much for your post because of this I took a new look at the operating system to understand it better and I found that plugins and packages are not the same.

Link to post
Share on other sites

57 minutes ago, corruptedButterlfy said:

Hi @Wild Penquin

 

Yes not creating a backup from the /boot and /etc/fstab directories is intentional because the system wouldn't boot if I included these.

This is true, if you restore them to another installation. You didn't state your method of intended restoration; if (in case of failure) you are going to re-install OMV then your approach in correct.

 

To those who may not know: fstab lists the mounted partitions and their mountpoints, with some options. It is a configuration file, which (most? all?) Linux installations will scan early in the bootup process to restore partitions and mount them (note: it might not contain all partitions to be mounted in every case!). It will be re-created at (re-)installation, however, if any changes have been done after installation, those will be lost. In most systems these days the partitions will be listed by UUIDs, which is why restoring this (to a re-partitioned system) will cause a boot failure.

 

/boot is a bit more complicated matter. It may contain the EFI partition or another partition on the HDD, under which the EFI partition is mounted (or, there might be no EFI partition at all if the boot system is Legacy/BIOS).

 

If you do not intend to  re-install at restore, one does need to restore these, in addition to the partition layout, however if that is the plan then one also needs to know what one is doing 😁.

 

Try out these commands in the installed OMV system: lsblk and blkid (both as root). They should show what kind of block devices (HDDs, possibly images of OSes) the system has and where they are mounted.

Edited by Wild Penquin
Pre-maturely hit submit! + minor clarification about fstab
Link to post
Share on other sites

After some Thinking and reconsidering I don't think I'm going to use OMV. I was going to use it because a friend of mine showed it to me and it looked pretty cool but because I'm just starting to use Linux I will use a more know Linux version (Debian). Also, my backup works on Debian and I value a good backup (aka a backup I understand and have tested) over a cool looking interface that I'm probably not going to use as much.

 

Maybe I will try again when I am a little more familiar with Linux in general.


If you want to know this was the output of the 2 commands you suggested. I can't find anything that would interfere with my backup.

Spoiler

lsblkAndBlkidCommand.png.f70db8c0e17c17923b8137d463a0c5b6.png

 

@Wild Penquin Thanks for trying to help and investing your time.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×