Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Filesystem Backup

Direct answer

Filesystem backup copies files with their metadata (owner, permissions, ACLs, xattrs, SELinux labels, hard links) using tools like rsync, tar, Borg, restic or filesystem snapshots.

When to use this

Use it to back up directories and servers at the file level.

First 30 seconds

1. Tool and options preserve owner, ACLs, xattrs, hard links (rsync -aHAX)?

2. Consistent source (snapshot or quiesced app)?

3. Excludes for virtual and cache directories.

4. Job ran successfully (log, exit code)?

5. Spot-check a restored file's content and metadata.

Operational verification

snapshot/quiesce → copy with metadata → store versioned and off-site → logs record success

Evidence · next step

For Backup & Restore → Filesystem Backup, continue with the first unproven Topic check: Define included/excluded paths, mount boundaries, consistency requirements and metadata that must survive restore. If that boundary is healthy, advance to the adjacent check: Inspect tool exit status plus skipped/error output and independently enumerate/read the destination. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to back up directories and servers at the file level.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

path/filesystem scope → consistency/quiesce decision → traversal/filtering → data + metadata capture → destination write → manifest/integrity read-back → restore sample → workload

Healthy evidence: expected files, links, ownership, modes, ACL/xattrs and required sparse/special handling are represented in a readable destination and a sample restore matches the acceptance criteria

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Define included/excluded paths, mount boundaries, consistency requirements and metadata that must survive restore.

  • Inspect tool exit status plus skipped/error output and independently enumerate/read the destination.
  • Restore representative files including links and permission-sensitive objects into an isolated location.
  • Verify the restored data with the real consumer or an application-specific validation step.

Verification chain. path/filesystem scope → consistency/quiesce decision → traversal/filtering → data + metadata capture → destination write → manifest/integrity read-back → restore sample → workload

Step 3 Commands Verify boundary
tar --xattrs --acls -czpf /backup/home.tgz /home
rsync -aHAX /srv/ /backup/srv/
xfsdump -l 0 -f /backup/root.dump /
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: exclude rules, mount boundaries, live writes, permission errors, dereferenced links, lost xattrs/ACLs or destination-full conditions silently reduce the usable recovery set

Step 5 Common mistakes Narrow the fault
  • Not preserving ACLs, xattrs and hard links.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Preserve metadata: rsync -aHAX, tar --acls --xattrs --selinux. Use snapshots (LVM, Btrfs) for consistency on busy filesystems. Exclude /proc, /sys, /dev, /run and caches. Encrypt off-site copies.

Key checks
  • rsync -aHAX --delete --dry-run <src> <dst> — preview a metadata-preserving sync
  • tar --acls --xattrs -czf <file> <dir> — archive with ACLs and xattrs
  • sha256sum <file> — checksum to verify copies
  • systemctl list-timers — scheduled backup jobs
ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

The limit of what it shows is the required file set plus metadata at a known point in time and a readable destination; a successful tar, rsync or dd process alone does not show completeness or recoverability.

In depth

File system backups with tar and rsync

File-level backups copy files and their metadata. Done right, a restore gives back the same tree, with the same permissions and labels. The tar(1) manual page documents what's needed for that:

  • -c, -x and -t create, extract and list.
  • -z, -j and -J compress with gzip, bzip2 and xz.
  • -p preserves permissions on extraction (the default for root).
  • --acls, --xattrs and --selinux include ACLs, extended attributes and SELinux contexts.
  • --numeric-owner stores IDs instead of names.
  • --one-file-system stays on one file system.
  • --exclude skips patterns.
  • --listed-incremental (-g) makes incremental backups with a snapshot file. The first run is a full (level 0) backup.

The rsync(1) manual page adds the rules for rsync:

  • -a preserves most metadata, but not ACLs, xattrs or hard links unless -A, -X and -H are added.
  • A trailing slash on the source copies its contents, not the directory itself.
  • --delete removes files that are gone from the source, and -n does a dry run first.

Incremental tar backups

RunCommandContent
Sunday (level 0)tar -czg /var/backup/etc.snar -f etc-full.tgz /etcEverything
Mondaytar -czg /var/backup/etc.snar -f etc-mon.tgz /etcChanges since Sunday
RestoreExtract full, then each incremental in order with -g /dev/null—

Snapshots with rsync and hard links

rsync --link-dest=<previous> creates a new dated directory each night. Unchanged files are hard links to the previous backup, so each snapshot looks complete but only changed files use new space.

Consistency

Copying files that are being written gives an inconsistent backup. Pause or flush the application, use a database dump, or snapshot the volume (LVM, Btrfs) and back up the snapshot.

host$ sudo tar --acls --xattrs --selinux --numeric-owner --one-file-system -czpf /srv/backup/srv1-etc-$(date +%F).tgz -C / etc
host$ tar -tzvf /srv/backup/srv1-etc-2026-11-28.tgz | head -3
host$ today=$(date +%F); yesterday=$(date -d yesterday +%F)
host$ sudo rsync -aAXH --numeric-ids --delete --link-dest=/srv/backup/srv1/$yesterday /srv/data/ /srv/backup/srv1/$today/
host$ du -sh /srv/backup/srv1/$yesterday /srv/backup/srv1/$today
38G     /srv/backup/srv1/2026-11-27
412M    /srv/backup/srv1/2026-11-28
host$ sudo rsync -aAXHn --delete /srv/backup/srv1/$today/ /srv/data/ | head

Reading the du output

The new snapshot looks like a complete copy, but used only 412 MB, because unchanged files are hard links into yesterday's directory. du counts each shared file once, in the first directory listed. The last command is a dry-run restore, which shows what a real restore would change, before anything is touched.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Filesystem Backup is part of Backup & Restore → Filesystem Backup. Filesystem Backup covers Linux file-tree copies and archives, including scope, consistency, metadata preservation, exclusions, sparse files, links, ACL/xattrs and destination durability.

Topic-specific state model. Filesystem Backup covers Linux file-tree copies and archives, including scope, consistency, metadata preservation, exclusions, sparse files, links, ACL/xattrs and destination durability.

Interpretation rule. - Archive created ≠ required scope captured.

  • rsync exit without visible error ≠ metadata/consistency requirements met.
  • Block image copied ≠ filesystem/application consistency.
  • Destination mounted ≠ backup bytes durable and readable.

Quick reference

Filesystem backup examples:

# restic: init once, then daily
export RESTIC_REPOSITORY=s3:https://s3.example.com/backups/web01 RESTIC_PASSWORD_FILE=/root/.restic-pw
restic init
restic backup /etc /srv /var/lib/app --exclude-caches --one-file-system
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune
restic check --read-data-subset=5%

# rsync mirror with hard-linked snapshots
rsync -aHAX --delete --link-dest=/backup/web01/latest /srv/ /backup/web01/2026-11-05/

# tar with ACLs/xattrs/SELinux labels
tar --acls --xattrs --selinux -czpf etc-$(date +%F).tgz /etc

For databases, dump or snapshot consistently first; copying live database files gives unusable backups.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. The limit of what it shows is the required file set plus metadata at a known point in time and a readable destination; a successful tar, rsync or dd process alone does not show completeness or recoverability.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Filesystem Backup owns generic Linux file/block copy evidence; database/application consistency belongs to the application and storage snapshots belong to Storage.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Backup & Restore → Filesystem Backup. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://download.samba.org/pub/rsync/rsync.1 · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
filesystem backup linuxtar rsync backuplinux file backup
Embedded reference data

Quick lookup tables

Filesystem Backup operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Filesystem Backup.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateFilesystem Backup covers Linux file-tree copies and archives, including scope, consistency, metadata preservation, exclusions, sparse files, links, ACL/xattrs and destination durability.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact source/revision or recovery point → verify inputs/consistency → observe copy/build/link result → read back destination/artifact and metadata/dependencies → restore/run in intended environment → repeat original workload + regression check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainpath/filesystem scope → consistency/quiesce decision → traversal/filtering → data + metadata capture → destination write → manifest/integrity read-back → restore sample → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryThe proof boundary is the required file set plus metadata at a known point in time and a readable destination; a successful tar, rsync or dd process alone does not prove completeness or recoverability.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux backup/source evidence can establish this proof path: path/filesystem scope → consistency/quiesce decision → traversal/filtering → data + metadata capture → destination write → manifest/integrity read-back → restore sample → workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove unobserved data, metadata, revisions, dependencies, consumers or time periods. The proof boundary is the required file set plus metadata at a known point in time and a readable destination; a successful tar, rsync or dd process alone does not prove completeness or recoverability.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven backup/source/build boundary, capture adjacent identity/read-back/runtime evidence, make only the demonstrated persistent change, then repeat the original workload plus a regression check.Continue to the next unresolved boundary while preserving the original test condition.

Filesystem Backup · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryFilesystem Backup
Topic pathBackup & Restore → Filesystem Backup
Runtime stateFilesystem Backup covers Linux file-tree copies and archives, including scope, consistency, metadata preservation, exclusions, sparse files, links, ACL/xattrs and destination durability.
Fast checks- Define included/excluded paths, mount boundaries, consistency requirements and metadata that must survive restore. - Inspect tool exit status plus skipped/error output and independently enumerate/read the destination. - Restore representative files including links and permission-sensitive objects into an isolated location. - Verify the restored data with the real consumer or an application-specific validation step.
Verification chainpath/filesystem scope → consistency/quiesce decision → traversal/filtering → data + metadata capture → destination write → manifest/integrity read-back → restore sample → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryThe proof boundary is the required file set plus metadata at a known point in time and a readable destination; a successful tar, rsync or dd process alone does not prove completeness or recoverability. Boundary chain: process credentials/namespace → path/mount lookup → DAC/ACL/LSM → filesystem metadata → block/device/backend → completion/read-back.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?