Short answer is: there's no advantage to having snapshot inside snaphots - literally nested subvolumes, which is what you describe by send backups (which are subvolumes) into a subvolume. It's "cleaner" IMO to send backups to the root file system and use folders if you want organization.
You can nest subvolumes if it makes sense to you or has some purpose. There is one disadvantage to doing that - you have to delete nested subvolumes before you can delete the top level subvolume.
How you set it up depends on what you're trying to accomplish. Are you making backups or are you storing snapshots? Are you working with a single drive or multiple? As always with Linux you have choices.
Here's an example of a basic BTRFS installation;
Going back to your initial post, I'll assume this:
/etc/fstab looks like:
Note the first three use the same UUID because they are all on the same file system. I know it seems odd to have what appears to be the same file system mounted three times, but that's how subvolumes work.
If you enter "ls /mnt/rootfs" in a terminal your output would be:
showing you the two subvolumes there.
Now create a folder under /mnt/media named backups to store your backups in.
BTRFS snapshots and backups are really the same thing. Basically a backup is a snapshot moved to a different file system.
With the above setup as I have described, you could take snapshots of @ and @home in /mnt/rootfs. When you wanted to make a backup, you would "send|receive" the snapshot it to /mnt/media/backups.
These two commands take a read-only snapshot of @ and make a backup:
Note the "-r" (read-only) switch in the snapshot command. Snapshots must be read-only to "send" them. Also note the absence of a target file name for the backup. The received snapshot will always have the same name as the sent snapshot.
A larger question is how are you going to use your media file system? Again, choices can be made here. You can use it like any regular file system and just make folders like Music, Pictures, etc. which might make sense for a network share if that's how you're using it. My media server is more complex and has several other purposes so I have my media divided into subvolumes which I backup individually AND have them mounted so I can share them via several protocols.
You can nest subvolumes if it makes sense to you or has some purpose. There is one disadvantage to doing that - you have to delete nested subvolumes before you can delete the top level subvolume.
How you set it up depends on what you're trying to accomplish. Are you making backups or are you storing snapshots? Are you working with a single drive or multiple? As always with Linux you have choices.
Here's an example of a basic BTRFS installation;
Going back to your initial post, I'll assume this:
- /dev/nvme0n1 is your boot drive with a couple partitions (EFI and SWAP) and your BTRFS root filesystem on partition 3 so /dev/nvme0n1p3 will be mounted under rootfs.
- /dev/sda and /dev/sdb (no partitions) are joined as a BTRFS RAID1 file system which we will mount under media.
/etc/fstab looks like:
Code:
<UUID1> / btrfs <options>,subvol=@ <UUID1> /home btrfs <options>,subvol=@home <UUID1> /mnt/rootfs btrfs <options> <UUID2> /mnt/media btrfs <options>
If you enter "ls /mnt/rootfs" in a terminal your output would be:
Code:
@ @home
Now create a folder under /mnt/media named backups to store your backups in.
Code:
sudo mkdir /mnt/media/backups
With the above setup as I have described, you could take snapshots of @ and @home in /mnt/rootfs. When you wanted to make a backup, you would "send|receive" the snapshot it to /mnt/media/backups.
These two commands take a read-only snapshot of @ and make a backup:
Code:
sudo btrfs subvolume snapshot -r /mnt/rootfs/@ /mnt/rootfs/@_snap1 sudo btrfs send /mnt/rootfs/@_snap1 | sudo btrfs receive /mnt/media/backups
A larger question is how are you going to use your media file system? Again, choices can be made here. You can use it like any regular file system and just make folders like Music, Pictures, etc. which might make sense for a network share if that's how you're using it. My media server is more complex and has several other purposes so I have my media divided into subvolumes which I backup individually AND have them mounted so I can share them via several protocols.
Comment