On Sat, August 24, 2013 at 18:20 (+0200), Hugo Mills wrote: > On Sat, Aug 24, 2013 at 06:09:58PM +0200, Thomas Koch wrote: >> Hi, >> >> how can I do the following in a shell script: >> >> - check whether my file system supports cp --reflink? > > touch foo; if cp --reflink=always foo bar; then ...; fi; rm -f foo bar > >> - check whether two files share the same data on disk, i.e. one has been >> created by cp --reflink of the other? > > You can't, using simple userspace tools. I think the only way would > be to use the tree search ioctl to inspect the extents for each file, > and see whether any of them overlap. Why do you need to know this? It should work with fiemap to a file in question and btrfs inspect logical to what ever extents fiemap reported as "physical". -Jan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
