linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@inwind.it>
To: Zygo Blaxell <zblaxell@furryterror.org>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: BTRFS messes up snapshot LV with origin
Date: Fri, 28 Nov 2014 18:05:48 +0100	[thread overview]
Message-ID: <5478AB6C.7030809@inwind.it> (raw)
In-Reply-To: <20141127041510.GV17380@hungrycats.org>

On 11/27/2014 05:15 AM, Zygo Blaxell wrote:
> On Wed, Nov 26, 2014 at 06:19:05PM +0100, Goffredo Baroncelli wrote:
>> On 11/25/2014 11:21 PM, Zygo Blaxell wrote:
>>>>> However I still doesn't understood why you want btrfs-w/multiple disk over LVM ?
>>> I want to split a few disks into partitions, but I want to create,
>>> move, and resize the partitions from time to time.  Only LVM can do
>>> that without taking the machine down, reducing RAID integrity levels,
>>> hotplugging drives, or leaving installed drives idle most of the time.
>>>
>>> I want btrfs-raid1 because of its ability to replace corrupted or lost
>>> data from one disk using the other.  If I run a single-volume btrfs
>>> on LVM-RAID1 (or dm-RAID1, or RAID1 at any other layer of the storage
>>> stack), I can detect lost data, but not replace it automatically from
>>> the other mirror.
>> OK, now I have understood.
>>
>> Anyway as workaround, take in account that you can pass explicitly the
>> devices as:
>>
>> mount -o device=/dev/sda,device=/dev/sdb,device=/dev/sdc /dev/sdd /mnt
>>
>> (supposing that the filesystem is on /dev/sda.../dev/sdd)
>>
>> I am working to a mount.btrfs helper. The aim of this helper is to manage
>> the assembling of multiple devices; the main points will be:
>> - wait until all the devices appeared
> 
> ...and make sure there are no duplicate UUIDs.
Yes, at the end I implemented in this way the "snapshot" detection:
if two autodetected devices have the same DISK_UUID (reported as 
SUB_UUID by blkid), th emount process stopped. I checked also the 
num_device field of the superblock.

> 
>> - allow (if required) to mount in degraded mode after a timeout
> 
> This is a terrible idea with current btrfs, at least for read-write
> degraded mounting (fallback to read-only degraded would be OK).
> Mounting a filesystem read-write and degraded is something you only want
> to do immediately before you replace all the missing disks and bring the
> filesystem up to a non-degraded space and after you've ensured that the
> missing disks can never, ever come back; otherwise, btrfs eats your data
> in a slightly different way than we have discussed so far...

I don't care. If the user pass "degraded" in the options of mount, 
he have it. Anyway this (wrong) btrfs behavior I hope that it will be
solved.
> 
>> - at this point it could/should also skip the lvm-snapshotted devices (but before 
>> I have to know how recognize these) 
> 
> You don't have to recognize them as snapshots (and it's probably better
> not to treat snapshots specially anyway--how do you know whether the
> snapshot or the origin LVs are wanted for mounting?).  You just have to
> detect duplicate UUIDs at the btrfs subdevice level, and if any are found,
> stop immediately (or get a hint from the admin).

For the disk autodetection, I still convinced that it is a "sane" default
to skip the lvm-snapshot

> 
> This is a weakness of the current udev and asynchronous device hotplug
> concept:  there is no notion of bus enumeration in progress, so we can be
> trying to assemble multi-device storage before we have all the devices
> visible.  Assembly of aggregate storage (whatever it is--btrfs, md,
> lvm2...) has to wait until all known storage buses are fully enumerated
> in order to detect if there are duplicates.

It is more complex than that. Some devices may appear after the "1st" bus
enumeration.


> 
>> I hope to issue the patches in the next week
>>
>> BR
>> G.Baroncelli
>>
>> -- 
>> gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
>> Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2014-11-28 17:05 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-16 21:35 BTRFS messes up snapshot LV with origin MegaBrutal
2014-11-17  1:42 ` Duncan
2014-11-17  6:59   ` Brendan Hide
2014-11-17  7:35     ` Daniel Dressler
2014-11-17  9:00       ` Brendan Hide
2014-11-17 19:04     ` Goffredo Baroncelli
     [not found]       ` <CAE8gLh=VubBbZdeKTAuWRjOxPF7C+ouUeeVvmGfT2ckYWGhQVA@mail.gmail.com>
2014-11-17 19:45         ` Fwd: " MegaBrutal
2014-11-17 20:32           ` Goffredo Baroncelli
2014-11-18  6:16           ` Chris Murphy
2014-11-18 15:42             ` Phillip Susi
2014-11-18 19:17               ` Chris Murphy
2014-11-18 20:17                 ` Phillip Susi
2014-11-19  2:54                   ` Chris Murphy
2014-11-19 15:20                     ` Phillip Susi
2014-11-19 18:35                       ` Chris Murphy
2014-11-19 19:23                         ` Phillip Susi
2014-11-21  4:28                       ` Zygo Blaxell
2014-11-21  6:22                         ` Duncan
2014-11-21 11:35                           ` Robert White
2014-11-21 11:54                             ` Duncan
2014-11-21 17:56                           ` Zygo Blaxell
2014-11-21 23:09                             ` Duncan
2014-11-21 18:23                           ` Chris Murphy
2014-11-21 22:49                             ` Duncan
2014-11-21 23:41                               ` Duncan
2014-11-21 23:51                                 ` Duncan
2014-11-22 17:34                         ` Goffredo Baroncelli
2014-11-23  0:19                           ` Zygo Blaxell
2014-11-25 16:34                             ` Goffredo Baroncelli
2014-11-25 20:29                               ` Zygo Blaxell
2014-11-25 21:59                                 ` Goffredo Baroncelli
2014-11-25 22:21                                   ` Zygo Blaxell
2014-11-25 22:47                                     ` Chris Murphy
     [not found]                                     ` <CAJCQCtQUM=viSoPtcJMcyKquYb1DLmEsqBi=p++uXPy63+r3Ow@mail.gmail.com>
     [not found]                                       ` <20141126021134.GR17380@hungrycats.org>
2014-11-26  4:48                                         ` Chris Murphy
2014-11-26 17:19                                     ` Goffredo Baroncelli
2014-11-27  4:15                                       ` Zygo Blaxell
2014-11-28 17:05                                         ` Goffredo Baroncelli [this message]
2014-11-29  1:25                                           ` Robert White
2014-11-29  7:35                                             ` Goffredo Baroncelli
2014-11-29  8:02                                               ` Robert White
2014-11-29  7:37                                             ` MegaBrutal
2014-11-29  4:59                                           ` Zygo Blaxell
2014-11-29  7:55                                             ` Robert White
2014-12-01 15:25                                               ` Zygo Blaxell
2014-11-26  3:22                                   ` Duncan
2014-11-26  5:11                                     ` Chris Murphy
2014-11-26 22:08                                     ` Robert White
2014-11-27  9:08                                       ` Duncan
2014-11-28  7:10                                         ` Chris Murphy
2014-11-29  7:29                                           ` Duncan
2014-11-29  8:20                                             ` Robert White
2014-11-29  9:41                                               ` Duncan
2014-11-29 16:33                                                 ` Robert White
2014-11-29 16:50                                               ` Robert White
2014-11-30  6:46                                                 ` Duncan
2014-11-29 21:15                                               ` Chris Murphy
2014-11-18 20:41               ` MegaBrutal
2014-11-19  1:29               ` Robert White
2014-11-19  3:37                 ` Duncan
2014-11-21  4:24       ` Zygo Blaxell
2014-11-18  6:21     ` Chris Murphy
2014-11-18 12:13       ` Duncan
2014-11-18 20:01       ` Goffredo Baroncelli
  -- strict thread matches above, loose matches on Subject: below --
2014-11-17  8:00 MegaBrutal

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=5478AB6C.7030809@inwind.it \
    --to=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zblaxell@furryterror.org \
    /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).