Archive for 11.02.2023

Btrfs create snapshot and send | receive to backup

btrfs subvolume snapshot -r @astralinux @astralinux_ro
btrfs send /mnt/btrfs/@astralinux_ro | btrfs receive /mnt/flash
btrfs subvolume snapshot /mnt/flash/@astralinux_ro /mnt/flash/@astralinux
btrfs property set -f -ts /mnt/btrfs/@astralinux_ro ro false
btrfs property set -f -ts /mnt/flash/@astralinux_ro ro false
rm -rf /mnt/btrfs/@astralinux_ro
rm -rf /mnt/flash/@astralinux_ro

RSYNC — клонирование системы

rsync -vaHAXS --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/lost+found"} -e ssh root@192.168.x.x:/ /mnt

rsync -aHAXS SOURCE_DIR DESTINATION_DIR

-H, --hard-links      preserve hard links
-A, --acls            preserve ACLs (implies -p)
-X, --xattrs          preserve extended attributes
-S, --sparse          handle sparse files efficiently