Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 995  / 1 Year ago, wed, february 1, 2023, 7:30:56

I would like to use Ubuntu backup (Déjà Dup) to back up the whole system on an external HDD. Can I use the OS (make changes to files) while the full backup is being made? How is this going to affect the backed up files (for example, if I change a file during backup, would I have the new version of this file in the backup or the old one)?



Thank you


More From » backup

 Answers
3

While this is possible, I would certainly not recommend doing so. The most important reasons is that you're creating an inconsistent backup on two levels:




  • Volume inconsistency

  • File inconsistency



The only viable solutions to this are:




  • Use snapshots. This can be achieved using LVM or a newer generation filesystem such as BtrFS. This will snapshot the whole volume as if you were taking a picture of it. Changes/writes are still possible, but the backup process is being run from the read-only snapshot taken earlier.

  • Mount the filesystem as read-only and backup from there. Important downside: you won't be able to run your system during the time your root filesystem is being mounted read-only.



Volume inconsistency



The volume on itself consists of the thousands of files which are in the process of being copied while you are still writing to it. Some application will get confused if the state of the individual files are inconsistent.



Let's say an application stores the preferences in ~/.config/appname/theprefs.xml and the contents refer to an external file somewhere else on the system, let's say ~/Pictures/myface.png. If the preferences settings file is being backed up after the folder ~/Pictures is, then the backup might not work after you need to restore it some day later.



File inconsistency



Similar to how individual files can be in an inconsistent state, so can files in itself be as well. The contents of the file may change while you are taking the backup. Rsync and most other tools used under water for backup applications such as Deja Dup will not lock the file for reading. See also: How does rsync behave for concurrent file access?.



This may lead to disastrous results as the whole structure of the file could be corrupted. The chance of this actually happening depends mostly on the size of the file and the amount of write operations being performed on it.



Examples on what not to do.



Copy or back up...




  • a virtual machine disk image while the machine is running.

  • database files (e.g. MySQL /var/lib/mysql) while the tables aren't read-locked. (For this example fancy tools like the Percona Toolkit solve this for you.)


[#29872] Wednesday, February 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ickump

Total Points: 234
Total Questions: 124
Total Answers: 111

Location: Jordan
Member since Fri, Apr 8, 2022
2 Years ago
;