linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* raw fs backup/copy
@ 2011-01-06 16:36 Ivan Labáth
       [not found] ` <20110106183507.GA19633@carfax.org.uk>
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Labáth @ 2011-01-06 16:36 UTC (permalink / raw)
  To: linux-btrfs

Is there a reason one can not mount a btrfs and it's byte-for-byte
copy in parallel, or is the driver just acting silly?

Mini example:
# dd if=/dev/zero of=fs1 bs=1 count=1 seek=$((1024*1024*1024-1))
# mkfs.btrfs fs1
# cp --sparse=always fs1 fs2
# mkdir 1 2
# mount fs1 1 -o loop
# mount fs2 2 -o loop
# touch 1/1
# ls 2
1
# cat /proc/mounts
/dev/loop0 /tmp/test/1 btrfs rw,relatime 0 0
/dev/loop1 /tmp/test/2 btrfs rw,relatime 0 0

--
ivan

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: raw fs backup/copy
       [not found] ` <20110106183507.GA19633@carfax.org.uk>
@ 2011-01-06 19:26   ` Ivan Labáth
  0 siblings, 0 replies; 2+ messages in thread
From: Ivan Labáth @ 2011-01-06 19:26 UTC (permalink / raw)
  To: Hugo Mills; +Cc: linux-btrfs

On 01/06/11 19:35, Hugo Mills wrote:
> On Thu, Jan 06, 2011 at 05:36:48PM +0100, Ivan Lab=C3=A1th wrote:
>> Is there a reason one can not mount a btrfs and it's byte-for-byte
>> copy in parallel, or is the driver just acting silly?
>=20
>    Probably because both filesystems have identical UUIDs (and labels=
)
> and so will (I suspect) end up being identified as the same filesyste=
m
> by the btrfs code.
>=20
>    Hugo.
>=20

The reason I ask is, that I had a mirror RAID (btrfs on LVM on LUKS on =
RAID)
across 2 disks. Then I snatched one to take with me when going away for
holidays, copied some files on to it and when I came back, I wanted to =
get
to those files. The problem was, I couldn't mount the fs I took with me=
,
because a similar fs was already mounted. As it wasn't the root fs,
I could unmount it and copy the files on some other fs
(though one could use pivot_root, if it was the root fs).

It seems to me there are cases, where one would want to mount two copie=
s of
originally the same filesystem - think of RAID, VMs, distributing fs im=
ages
on a network, LVM snapshots, backups, etc.

--
ivan
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-06 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06 16:36 raw fs backup/copy Ivan Labáth
     [not found] ` <20110106183507.GA19633@carfax.org.uk>
2011-01-06 19:26   ` Ivan Labáth

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).