From: Hugo Mills <hugo@carfax.org.uk>
To: Thomas Koch <thomas@koch.ro>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: check for reflink capability and for shared data
Date: Sat, 24 Aug 2013 17:20:13 +0100 [thread overview]
Message-ID: <20130824162013.GL3115@carfax.org.uk> (raw)
In-Reply-To: <201308241809.58701.thomas@koch.ro>
[-- Attachment #1: Type: text/plain, Size: 810 bytes --]
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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2013-08-24 16:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-24 16:09 check for reflink capability and for shared data Thomas Koch
2013-08-24 16:20 ` Hugo Mills [this message]
2013-08-26 6:42 ` Jan Schmidt
2013-08-26 9:30 ` Liu Bo
2013-08-27 1:37 ` Marios Titas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130824162013.GL3115@carfax.org.uk \
--to=hugo@carfax.org.uk \
--cc=linux-btrfs@vger.kernel.org \
--cc=thomas@koch.ro \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).