/btrfs-clone-fail
Last active Aug 29, 2015
| umount /btrfs-filesystem || true | |
| btrfs subvolume remove /btrfs-filesystem/source || true | |
| btrfs subvolume remove /btrfs-filesystem/target || true | |
| btrfs subvolume remove /btrfs-filesystem/snapshot || true | |
| rm --recursive --force /btrfs-device /btrfs-filesystem | |
| truncate --size 1GiB /btrfs-device | |
| mkfs.btrfs /btrfs-device | |
| mkdir /btrfs-filesystem | |
| mount /btrfs-device /btrfs-filesystem | |
| btrfs subvolume create /btrfs-filesystem/source | |
| btrfs subvolume create /btrfs-filesystem/target | |
| touch /btrfs-filesystem/source/cow | |
| touch /btrfs-filesystem/source/nocow | |
| chattr +C /btrfs-filesystem/source/nocow | |
| btrfs subvolume snapshot -r /btrfs-filesystem/source /btrfs-filesystem/snapshot | |
| cp --reflink=always /btrfs-filesystem/snapshot/cow /btrfs-filesystem/target | |
| cp --reflink=always /btrfs-filesystem/snapshot/nocow /btrfs-filesystem/target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment