Should tar be used for partition backup?
The examples I see are for folder/files or the entire system from /.
I do not see why not, but I cannot determine whether to archive from /dev or the mount point. dd is giving me errors so I am seeking alternatives. |
you must not archive /dev. I mean never ever. You always need to use the mount point. Otherwise would be nice to know what are you trying to achieve again, what errors did you get...
(ok, there can be some exceptions when you want to access /dev/something, but in that case you need to know exactly what are you doing). |
Backing up a running system can be problematic. Best to use a livecd, mount the partition you want to backup, cd to that partition mount point and run:
Code:
$ sudo tar --acls -czvpf /<path to backup location>/backupfile.tar.gz . To restore from such a backup, again, use a livcd, mount the partition you want to restore, delete all the contents of the partition, cd to the partition mount point and run: Code:
$ sudo tar --acls -xzvpf <path to backup file> |
Take a look at rsync - https://linux.die.net/man/1/rsync
|
If you want to back up a root or system partition then don't unless you are using a live state backup. I think fsarchiver does it live state. As above a few issues.
A data only partition is what tar or some gzip sort of deal is for. If you want to make an image of the working partition then boot to some live media maybe. |
Quote:
No matter what backup system you create you don't need to backup /sys or /dev because you will never restore them. |
#1 Rsync is not backup software, it is an application for file and folder syncronization.
#2 Tar makes Tape ARchives, and is not backup software. Tar can be used to archive files and folders. #3 A tool that can sync or archive files and folders can be a useful, even critical, PART of a backup and recovery plan or strategy. ---- If what you want to back up is a partition, then what you need is a tool that creates an archive, copy, or clone of a partition: not just files or folders! I have used mirroring for backups: make and sync a mirror, break the mirror, and archive with compression the idle and going stale copy of the mirror. That was like magic to remove downtime during backups while ensuring they were consistent back in the day: I no longer recommend that. We have smarter tools now. For your purposes a true backup tool would be preferred, and if you want partition backups then a tool specific to partitions might serve best. PArtimage and clonezilla come to mind at once. |
I use lvm snapshots via script. Create snapshot, tar snapshot to external drive. remove snapshot when done. automatic. That + timeshift hourly and I've nary an issue.
|
Quote:
The need for byte-for-byte backup is something that has always perplexed me, as source & destination are rarely equivalent media & motivate circumspection. I notice in Linux problems with symlinks but at least we don't have hidden system files to worry about like Redmond (the difference between copying & a real 'backup'). I confess only tinkering with dd while relying Windows builtin backup & AOMEI Backupper. If I could do the same thing in Linux I would. |
Virtually every Linux distribution that has a repo system has backup and imaging tools in the repo: those are the backup and recovery and imaging tools native to Linux. Perhaps searching your repo will provide you some places to start your research, and all of the tools you need for your purpose.
|
All times are GMT -5. The time now is 04:28 PM. |