Note to self about btrfs and home as a subvolume

If moving your /home from the btrfs partition to a subvolume, do not forget to also change the mount in fstab before removing the old home files. xD

I love btrfs, it has saved me multiple times, and today was one more time.
Something completely screwed up my system yesterday so when trying to boot today, I got “broken inode” and could not figure out what went wrong at boot.
Reverted to a snapshot from yesterday and everything worked perfect.

I then decided to remove the old files from my home partition since you know, I mount the snapshot as a subvolume now.
Everything in dolphin turned white and my home disappeared, that’s not good…

Took a while before I realized reverting to the snapshot also reverted the changed fstab.
Phew.

The reason I wanted my home to be a snapshot rather than the whole partition is because if everything is snapshots, you can resize the filesystem in f.ex Gparted while having it mounted. :smiley:

The reason I wanted my home to be a snapshot rather than the whole partition is because if everything is snapshots, you can resize the filesystem in f.ex Gparted while having it mounted.

Partitions? What are they? :wink:

Typically, there may be an ESP, and possibly a swap partition, but the rest is one btrfs. I make this point because for some folks having a separate home partition is an ingrained practice, and it’s easier with btrfs to not do it. As well, one doesn’t need separate partitions for multiple installs, they can all live in the same btrfs, sharing the free space, and shuffling space around is a thing of the past (unless, of course, one has to have a non-btrfs OS :frowning: ).

I disagree to a few points here.

I will give you examples.

  • Your hard-drive, the entire device breaks, what will happen to your home?

  • You want to utilize, lets say clonezilla to back up specific parts of the computer to protect yourself against ransomware, and all you really care about is your home, how do you do that if it is all one big device? (yes, btrfs send|recive exists, but the strengths with clonezilla is you can keep backups completely separated NEVER mounting them on your live system)

  • You want to reinstall, you use lets say Calamares and want to keep your home.
    How do you keep the old home as a subvolume and at the same time recreate the rest, without a ton of manual intervention?

There is absolutely 100% cases where having it on separate partition or even separate device is valid.

Another not well known fact about btrfs is that you do not need partitions AT ALL, you can just create the filesystem directly on the dev, f.ex /dev/sdc
I actually tried this on a raspberry pi running urbackup. For the backup storage I just created the filesystem directly on a 6TB drive without partitioning it.
Looks strange in lsblk but it works. :slight_smile:

I mostly agree with your points, especially about a drive becoming a single point of failure, but

  • The clonezilla approach has weaknesses with respect to ransomware if it is undetected for a while, as backups are full and thus slow. Using incremental send/receive. and large enough backup volumes, one can do them often and look at the state of the system as at, say, Tuesday morning a week ago, and quickly inspect files as they’ve changed recently. If one is concerned that the ransomers will encrypt the backups somehow, they can be done while booted from a removable volume, but as they use read-only snapshots that must have the matching generation numbers in the parents it would be difficult.
  • It’s not necessarily a “ton of manual intervention”, unless space is very constrained. It’s just a few careful renames and snapshots, and all the subvolumes involved can remain in place. One can use symlinks in grub and /etc/fstab, and in that case it’s just a few relinks.

Eeeeh, duuuh. Are you serious?!?
You are joking right?

If you make a backup on already encrypted files, the backed up files will ofc also be encrypted, or what are you trying to say?
The OLD BACKUPS on that storage device will NOT BE ENCRYPTED with clonezilla while if you mount it on a system where you have an encryption script running ALL BACKUPS have a very high risk of also becoming encrypted.

Again, you are joking right?
Or do you not know how ransomware works?

Really?
Then please teach me so I can teach others.
How do I configure an installer to not create a new home but use the subvolume called @ilovethishomesubsnapshot I have as my home?
Press install and boom reinstalled with my home intact.
How is that done?

Arguably, the mere fact a subvolume is in use for home makes this “complicated”, if it is also on a different device does not really change much in the workload needed to fix it.