meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:fs:btrfs:send [2024/11/20 16:50] – niziak | linux:fs:btrfs:send [2024/11/21 17:32] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== send / receive ====== | ====== send / receive ====== | ||
| + | |||
| + | grub-install --target=x86_64-efi --efi-directory=/ | ||
| + | update-grub | ||
| + | |||
| + | mount --rbind /dev / | ||
| + | mount --rbind /proc / | ||
| + | mount --rbind /sys / | ||
| + | chroot / | ||
| + | |||
| + | grub-install --target=x86_64-efi --efi-directory=/ | ||
| + | Installing for x86_64-efi platform. | ||
| + | grub-install: | ||
| + | |||
| ===== migrate to new storage ===== | ===== migrate to new storage ===== | ||
| Line 65: | Line 78: | ||
| Rsync option explanation: | Rsync option explanation: | ||
| - | * Unordered List Item | + | * '' |
| - | rsync -avxHAXP | + | |
| - | rsync -aqxP | + | * |
| + | | ||
| + | tination. | ||
| + | * | ||
| + | * --times, -t preserve modification times | ||
| + | * --group, -g preserve group | ||
| + | * --owner, -o preserve owner (super-user only) | ||
| + | * -D same as --devices --specials | ||
| + | * --devices | ||
| + | * --specials | ||
| + | * '' | ||
| + | * '' | ||
| - | rsync -arAXHvW | + | * '' |
| - | rsync -arAXHvW | + | * '' |
| - | $ rsync -vuar host1:/var/www host2:/var/www | + | * '' |
| + | * '' | ||
| + | * --numeric-ids | ||
| + | * | ||
| + | |||
| + | <file ini /etc/ | ||
| + | [rootfs] | ||
| + | path = / | ||
| + | </ | ||
| + | rsync -v --daemon | ||
| + | |||
| + | on client, list rsync modules: | ||
| + | |||
| + | rsync 192.168.177.161:: | ||
| + | rootfs | ||
| + | |||
| + | |||
| + | Now rsync but do not limit to one filesystem, to copy all subvolumes into its places (already created on dst): | ||
| - | Sender: | ||
| <code bash> | <code bash> | ||
| + | rsync -avHAXPW --exclude=" | ||
| + | </ | ||
| - | btrfs send / | + | Try ssh to correct permission errors |
| + | <code bash> | ||
| + | rsync -avHAXPW --exclude=" | ||
| + | </ | ||
| + | |||
| + | No need to add on not live FS: | ||
| + | < | ||
| + | --exclude='/ | ||
| + | </ | ||
| + | |||
| + | Even if rsync daemon is started from root account (on src host) it cannot read some files according to normal permissions: | ||
| + | < | ||
| + | rsync: [sender] send_files failed to open "/ | ||
| + | rsync: [sender] send_files failed to open "/ | ||
| + | rsync: [sender] send_files failed to open "/ | ||
| + | </ | ||
| + | |||
| + | workaround is to start rsync daemon on dst host with the same rsyncd.conf config and start rsync from src host: | ||
| + | |||
| + | <code bash> | ||
| + | rsync -avxHAXPW --exclude=" | ||
| + | </ | ||
| + | |||
| + | |||
| + | tar: | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | |||
| + | Sender: | ||
| + | <code bash> | ||
| + | #tar -czpsf - / | ||
| + | cd / | ||
| + | tar --acls --xattrs -cpsf - . | zstd --fast -T0 | pv | nc -w 2 -N 192.168.177.171 44444 | ||
| </ | </ | ||
| Receiver: | Receiver: | ||
| <code bash> | <code bash> | ||
| - | nc -vl 44444 | zstd -d | pv | btrfs receive /target | + | #nc 192.168.1.4 3333 | pv -b | tar --acls --xattrs -xzpsf - |
| + | |||
| + | cd / | ||
| + | nc -vl 44444 | zstd -d | pv | tar -xpsf - | ||
| </ | </ | ||