People,
For decades I have been using rsync for all my backup needs - but with F40 I finally made the break from extx to btrfs for my workstation which introduced me to the concept of btrfs subvolumes and the possibility of snapshots.
Since subvolumes don't provide security if the whole partition crashes, I have been experimenting with using btrfs "send" the created snapshots to another partition - and from there to separate backup drives and other computers. Here I made three snapshots of / on my workstation, making trivial changes to /etc/hosts between each snapshot and then finally sending all three snapshots to the /home dir ie:
# for subvol in /z_btrfs_ss/*; do time btrfs send $subvol | btrfs receive /home/z_btrfs_ss/ ; done At subvol /z_btrfs_ss/root_20240609_022356 At subvol root_20240609_022356 real 14m2.764s user 0m1.405s sys 0m51.704s
At subvol /z_btrfs_ss/root_20240609_022807 At subvol root_20240609_022807 real 8m58.384s user 0m1.499s sys 0m59.899s
At subvol /z_btrfs_ss/root_20240609_035045 At subvol root_20240609_035045 real 5m53.532s user 0m1.472s sys 1m0.015s
What I don't understand is that when creating the snapshots originally, the time to create them is almost zero but when using btrfs send to the other partition the times are _much_ longer. I guess it makes sense that the first send of the first snapshot is slow, but why are the second and third sends not much better?
My previous script using rsync for incremental backups of a file system / dir is faster - I can check the times if anyone is interested . .
Thanks,
Phil.
On Sat, Jun 8, 2024 at 4:35 PM Philip Rhoades via users < users@lists.fedoraproject.org> wrote:
[...] What I don't understand is that when creating the snapshots originally, the time to create them is almost zero but when using btrfs send to the other partition the times are _much_ longer. I guess it makes sense that the first send of the first snapshot is slow, but why are the second and third sends not much better?
Creating a snapshot only maniplates meta-data to mark blocks that should be preserved (so they can be used if you need to roll back to a snapshot).
My previous script using rsync for incremental backups of a file system / dir is faster - I can check the times if anyone is interested . .
rsync should be faster: send has to use the metadata to resconstruct the
files while rsync uses the current filesystem which is highly optimimized to take advantage of caches and parallel operations.
George,
On 2024-06-09 20:36, George N. White III wrote:
On Sat, Jun 8, 2024 at 4:35 PM Philip Rhoades via users users@lists.fedoraproject.org wrote:
[...] What I don't understand is that when creating the snapshots originally, the time to create them is almost zero but when using btrfs send to the other partition the times are _much_ longer. I guess it makes sense
that the first send of the first snapshot is slow, but why are the second and third sends not much better?
Creating a snapshot only maniplates meta-data to mark blocks that should be preserved (so they can be used if you need to roll back to a snapshot).
Ah - right.
My previous script using rsync for incremental backups of a file system / dir is faster - I can check the times if anyone is interested . .
rsync should be faster: send has to use the metadata to resconstruct the files while rsync uses the current filesystem which is highly optimimized to take advantage of caches and parallel operations.
Right - that all makes sense - thanks!
P.