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?

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
       --- Someone's been throwing dead sheep down my Fun Well ---       

Attachment: signature.asc
Description: Digital signature

Reply via email to