Cross subvolume "cp --reflink"?
I get "Failed to clone: Invalid cross-device link". Is it expected? Basically this is (on openSUSE TW which has root on subvolume)
mount -o subvol=/ /dev/vda1 /mnt
btrfs sub create /mnt/var/cache
cp -a --reflink=always /var/cache/* /mnt/var/cache
Kernel 4.7.5-1-default.
Quoted 8 lines · Andrei Borzenkov
I get "Failed to clone: Invalid cross-device link". Is it expected? Basically this is (on openSUSE TW which has root on subvolume)
mount -o subvol=/
/dev/vda1/mnt
btrfs sub create/mnt/var/cache
cp -a --reflink=always/var/cache/*/mnt/var/cacheKernel 4.7.5-1-default.
Yes, you're trying to copy across a mountpoint boundary. This isn't
going to work. You'll need to mount subvolid=0 on /mnt, and then use the source and target of the cp *both* from within the /mnt subtree.
Reflink operations (including cp --reflink=always, and the
reflink-aware mv) work across subvol boundaries, but not mount boundaries.
Hugo.
Signature · 4 lines
Hugo Mills | For months now, we have been making triumphant hugo@... carfax.org.uk | retreats before a demoralised enemy who is advancing http://carfax.org.uk/ | in utter disorder. PGP: E2AB1DE4 | Eric Frank Russell, Wasp
19.10.2016 20:04, Hugo Mills пишет:
Quoted 14 lines · Andrei Borzenkov
Quoted 8 lines
I get "Failed to clone: Invalid cross-device link". Is it expected? Basically this is (on openSUSE TW which has root on subvolume)
mount -o subvol=/
/dev/vda1/mnt
btrfs sub create/mnt/var/cache
cp -a --reflink=always/var/cache/*/mnt/var/cacheKernel 4.7.5-1-default.
Yes, you're trying to copy across a mountpoint boundary. This isn't
going to work. You'll need to mount subvolid=0 on /mnt, and then use the source and target of the cp *both* from within the /mnt subtree.
Quoted 6 lines
Reflink operations (including cp --reflink=always, and the
reflink-aware mv) work across subvol boundaries, but not mount boundaries.Hugo.
Yes, figured that much too. Thank you!
Quoted 1 line · Andrei Borzenkov
I get "Failed to clone: Invalid cross-device link". Is it expected?
Yes, you cannot cross a MOUNTPOINT boundary with reflink. Or, for that matter, btrfs subvolume snapshot.
Quoted 6 lines
Basically this is (on openSUSE TW which has root on subvolume)
mount -o subvol=/
/dev/vda1/mnt
btrfs sub create/mnt/var/cache
cp -a --reflink=always/var/cache/*/mnt/var/cache
You *can* however cross subvolume boundaries within the same mountpoint. Try (assuming your root subvolume is @root)
cp -a --reflink /mnt/@root/var/cache/* /mnt/var/cache
~ Noah