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 17:01] – 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 87: | Line 100: | ||
| * | * | ||
| + | <file ini / | ||
| + | [rootfs] | ||
| + | path = / | ||
| + | </ | ||
| + | rsync -v --daemon | ||
| - | rsync -avxHAXPW --numeric-ids / | + | on client, list rsync modules: |
| + | rsync 192.168.177.161:: | ||
| + | rootfs | ||
| - | rsync -arAXHvW --exclude=" | ||
| - | $ rsync -vuar host1:/ | ||
| - | Sender: | + | Now rsync but do not limit to one filesystem, to copy all subvolumes into its places (already created on dst): |
| <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 - | ||
| </ | </ | ||