From: Hugo Mills <hugo@carfax.org.uk>
To: Clemens Eisserer <linuxhippy@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Two identical copies of an image mounted result in changes to both images if only one is modified
Date: Thu, 20 Jun 2013 10:16:22 +0100 [thread overview]
Message-ID: <20130620091622.GL11290@carfax.org.uk> (raw)
In-Reply-To: <CAFvQSYRgvsqMxk_yZf6cPyoECJsUzn2g+cW-j7ktrWnhRL+0jA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]
On Thu, Jun 20, 2013 at 10:47:53AM +0200, Clemens Eisserer wrote:
> Hi,
>
> I've observed a rather strange behaviour while trying to mount two
> identical copies of the same image to different mount points.
> Each modification to one image is also performed in the second one.
>
> Example:
> dd if=/dev/sda? of=image1 bs=1M
> cp image1 image2
> mount -o loop image1 m1
> mount -o loop image2 m2
>
> touch m2/hello
> ls -la m1 //will now also include a file calles "hello"
>
> Is this behaviour intentional and known or should I create a bug-report?
It's known, and not desired behaviour. The problem is that you've
ended up with two filesystems with the same UUID, and the FS code gets
rather confused about that. The same problem exists with LVM snapshots
(or other block-device-layer copies).
The solution is a combination of a tool to scan an image and change
the UUID (offline), and of some code in the kernel that detects when
it's being told about a duplicate image (rather than an additional
device in the same FS). Neither of these has been written yet, I'm
afraid.
> I've deleted quite a bunch of files on my production system because of this...
Oops. I'm sorry to hear that. :(
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
--- Welcome to Rivendell, Mr Anderson... ---
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2013-06-20 9:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 8:47 Two identical copies of an image mounted result in changes to both images if only one is modified Clemens Eisserer
2013-06-20 9:11 ` Fajar A. Nugraha
2013-06-20 9:16 ` Hugo Mills [this message]
2013-06-20 10:22 ` Gabriel de Perthuis
2013-06-20 10:34 ` Hugo Mills
2013-06-20 10:41 ` Gabriel de Perthuis
2013-06-20 10:56 ` Hugo Mills
2013-06-20 13:22 ` Kevin O'Kelley
2013-06-20 13:28 ` Hugo Mills
2013-06-20 13:29 ` Gabriel
2013-06-20 13:32 ` Hugo Mills
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=20130620091622.GL11290@carfax.org.uk \
--to=hugo@carfax.org.uk \
--cc=linux-btrfs@vger.kernel.org \
--cc=linuxhippy@gmail.com \
/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).