Switch Linux Distros Without Losing Your Data: 3 Methods to Preserve /home, Backups & Symlinks

3 ways to switch Linux distros without losing your data

Switching Linux distros doesn’t have to turn into a data-recovery nightmare. With a little planning around where your files live and a few simple commands, you can try a new distribution, reinstall an OS, or migrate machines while keeping photos, projects, and app settings intact.

TL;DR + Quick checklist

  • /home partition — Keep your home folder separate so reinstalling the OS doesn’t touch your files. (Intermediate, 30–90 minutes)
  • Full backup — Save a verified copy of your /home (including hidden dotfiles) to external storage. (Easy, 15–30 minutes)
  • Secondary drive + symlinks — Store big folders on another disk and link them into your home so apps still find them. (Easy–Intermediate, 20–60 minutes)

Before you start:

  • Make a verified backup and test a restore on a VM or spare machine.
  • Note your user ID: id username.
  • If you use disk encryption, export the LUKS header: cryptsetup luksHeaderBackup --header-backup-file header.bak /dev/sdX.
  • Unmount external drives cleanly before reinstalling.
  • If you use symlinks, add the disk to /etc/fstab by UUID for consistent mounts.

“You don’t have to lose your home directory when changing distributions if you plan the disk layout.”

Why separate your data from the OS?

Linux stores per-user files and settings under /home. Those hidden dotfiles (like .config and .local) keep your applications configured and your session state intact. If you keep /home on the same partition that the installer formats, your files go with it. Separating data from system files makes hops between distributions smooth and reduces downtime.

Method 1 — Put /home on its own partition

Summary: Create a dedicated partition for /home and tell the installer to mount it at /home without formatting. This keeps your personal files when you reinstall the root system.

When to use

Power users and testers who switch distros often, or anyone who wants a clear separation between OS and data.

Steps

  1. Boot the installer and choose manual or custom partitioning.
  2. Create (or select) a partition for root / and another for /home. If reusing an existing /home partition, make sure NOT to check “format” for that partition.
  3. If your /home was encrypted with LUKS, export the header beforehand and plan to re-import after install.
  4. Install the OS to the root partition; the installer will mount /home from the separate partition and leave files intact.

Example fstab entry (mount by UUID)

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /home ext4 defaults,errors=remount-ro 0 2

Find the UUID with blkid or lsblk -f. Mounting by UUID avoids device renaming problems.

Pitfalls & pro tips

  • Don’t format the /home partition during install unless you really want to wipe it.
  • If UIDs differ across systems, create the user with the same UID or fix ownership afterwards with sudo chown -R username:username /home/username.
  • If your home is encrypted (LUKS), plan how the new install will unlock it — keep backups of the LUKS header.

Method 2 — Full backup of /home (recommended for novices)

Summary: Back up the entire user folder (including hidden dotfiles) to an external drive or cloud. Restore after installing the new distro, paying attention to ownership and UIDs.

When to use

Single-machine users, beginners, or anyone who wants an easy, safe fallback without repartitioning.

Recommended tools

  • Déjà Dup — friendly GUI for quick backups.
  • TimeShift — system snapshots (good for restoring system state).
  • LuckyBackup — GUI for rsync-style jobs.

Example rsync backup (preserves permissions, ACLs, xattrs)

rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /home/ /path/to/backup/

Verify the backup by mounting the external drive and checking files open. Try restoring a small test file first.

Restore safely

  1. Create the user on the new install (or match the original UID).
  2. Rsync the backup back to /home/username or restore selected folders.
  3. Fix ownership if needed: sudo chown -R username:username /home/username.

Pitfalls & pro tips

  • Back up hidden dotfiles too — skipping them loses app settings.
  • Don’t blindly copy everything back; incompatible dotfiles can break desktop sessions. Consider restoring configs selectively.
  • Keep versioned backups if possible so you can roll back to known good configs.

“Back up your entire user directory, including hidden dotfiles, because those contain application settings and caches.”

Method 3 — Secondary disk + symlinks

Summary: Keep large folders (Photos, VMs, Media) on a second internal or external SSD and use symbolic links to make them appear under your usual /home paths.

When to use

Users with huge media libraries or VMs that don’t fit on the system disk, or anyone who wants faster reuse of large files across reinstalls.

Steps

  1. Mount the secondary drive and add it to /etc/fstab by UUID.
  2. Remove the empty target directory and create a symlink:
rm -rf ~/Documents
ln -s /media/jack/drive1/Documents /home/jack/Documents

Make sure the external disk is mounted before apps try to access the linked folders.

Pitfalls & pro tips

  • Ensure the disk mounts at boot (use UUID in /etc/fstab).
  • Don’t create symlinks to sensitive config locations unless you know what you’re doing.
  • If you unplug the drive, apps may error or create new, empty directories in its place.

Advanced: encryption, UIDs, dotfile hygiene, and enterprise rollouts

If your home partition is encrypted with LUKS, export the header before any risky operation:

cryptsetup luksHeaderBackup --header-backup-file header.bak /dev/sdX

To restore the header later:

cryptsetup luksHeaderRestore --header-backup-file header.bak /dev/sdX

User IDs (UID) and group IDs (GID) are numeric ownership labels. If the new system assigns a different UID to your username, fix ownership with:

sudo chown -R username:username /home/username

Dotfile best practice: keep personal configs in a version-controlled repo (git bare repo, chezmoi, or homesick). That gives you selective restores and avoids dragging incompatible configs across major desktop or distro upgrades.

For businesses and fleets, configuration management (Ansible, Puppet) or declarative systems like NixOS provide predictable, repeatable environment builds and decouple user data from system state. Use these to automate user creation, UID consistency, and dotfile deployment.

Troubleshooting — quick fixes

  • Files inaccessible after restore: Check owner/UID with id username and fix with sudo chown -R username:username /home/username.
  • Permissions too open/closed: Use cautious chmod commands, e.g. find /home/username -type d -exec chmod 755 {} \; and find /home/username -type f -exec chmod 644 {} \;, but adjust per app needs.
  • Disk not mounting at boot: Use blkid or lsblk -f to find the UUID and update /etc/fstab.
  • LUKS issues: Restore LUKS header only if you have a verified header backup.

Common questions

Can I reuse my dotfiles across distros?

Yes, but carefully. Some desktop or application versions change config formats. Use version-controlled dotfiles so you can test and roll back selectively.

How do I fix file ownership after restoring from backup?

Run: sudo chown -R username:username /home/username. Verify the user’s UID with id username.

Is a separate /home always the safest option?

It’s very convenient, but encrypted homes, LVM setups, or mismatched UIDs add complexity. Always keep a verified backup before making major changes.

Which method should you choose?

  • Novice, single machine: Full backup with Déjà Dup and test a restore.
  • Frequent distro-hopper: /home on a separate partition + dotfile version control.
  • Large media/VM libraries: Secondary disk + symlinks or mount points, with permanant fstab entries.
  • IT teams: Automate with Ansible/Puppet or adopt a declarative distro (NixOS) and keep user data separate.

Final checklist before you switch

  • Make and verify a backup now; test a restore on a VM or spare machine.
  • Record your UID/GID with id username.
  • Export LUKS header if using disk encryption.
  • Decide between separate /home, backup-and-restore, or symlinks for large files.
  • If using an external drive, add it to /etc/fstab by UUID.
  • After restore, verify ownership (chown) and permissions (chmod) as needed.

Switching distributions should feel like an upgrade, not a hostage negotiation with your files. Pick the method that matches your comfort level and risk profile, test the plan, keep a verified backup, and you’ll be experimenting with new distros in confidence.

“Test these methods on a spare machine and always keep a backup.”