Brtfs home partition data recoverability

I have installed majaro kde with btrfs. Now, if for some reason my system was to go kaboom and I am forced to reinstall the os. Would it be possible to reinstall only the root subvolume without touching the home subvolume and save the data on the home subvolume, like it is on ext4 partitions.

If you have root snapshots, then you can restore it for the root subvolume without touching the home subvolume.

1 Like

The main point of Btrfs is to be able to restore the system from a snapshot, in case it breaks.

Strictly speaking, if you actually reinstall Manjaro, the root partition is to be formatted, so the Btrfs subvolumes won’t save your data. Other partitions, including one for say /home, don’t need to be formatted at reinstallation.

1 Like

I am not talking about restoring from a snapshot here.
I am talking about a scenario where gub doesn’t show up and i cannot choose a snapshot and am forced to boot from an ISO. will I be able to restore only the root partition and the boot in this scenario too?
thank you for your time

Just like one would leave an EXT4/XFS home partition “as is” during installation, so too would you do the same thing with a BTRFS subvolume.

Actually, hold that thought. I’m assuming the Calamares installer would respect an existing BTRFS layout, and has the ability to destroy-recreate a new root subvolume (as well as var and so forth), without resorting to creating a new BTRFS filesystem entirely. :thinking:

EDIT: It’s worth repeating: If the data in your home is important, you should have distinct backups, especially on other devices/media.

The directory /boot and / were installed in the root subvolume by default of Calamares except /home, /var/log and /var/cache they are in other subvolumes.

That means, you can restore Linux Kernel and root system from a snapshot, but not GRUB, because it is in /boot/efi using the default filesystem FAT32.

You need to use chroot to fix GRUB. e.g. sudo update-grub

The default layout in /etc/fstab by Calamares installer

# <file system>                           <mount point>  <type>  <options>  <dump>  <pass>
UUID=8837-6B04                            /boot/efi      vfat    umask=0077 0 2
UUID=87fsdsdf-153e-4e0c-9956-8fdz78gf34hf /              btrfs   subvol=/@,defaults,noatime,compress=zstd:1 0 0
UUID=87fsdsdf-153e-4e0c-9956-8fdz78gf34hf /home          btrfs   subvol=/@home,defaults,noatime,compress=zstd:1 0 0
UUID=87fsdsdf-153e-4e0c-9956-8fdz78gf34hf /var/cache     btrfs   subvol=/@cache,defaults,noatime,compress=zstd:1 0 0
UUID=87fsdsdf-153e-4e0c-9956-8fdz78gf34hf /var/log       btrfs   subvol=/@log,defaults,noatime,compress=zstd:1 0 0
UUID=ada3b794-cdb7-4244-a5d3-bbece9dfad74 swap           swap    defaults,noatime 0 0

So you are saying, In case of a grub failure I should be fixing grub with update-grub instead of reinstalling the os and then restore from a snapshot from grub? That seems do-able to me. Thank you

Yes, right.

There is another way. You do not need to restore the root subvolume if it is fine

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.