On Mon, Nov 17, 2014 at 08:04:05PM +0100, Goffredo Baroncelli wrote: > On 2014-11-17 07:59, Brendan Hide wrote: > > > > That leaves two aspects of this issue which I view as two separate bugs: > > a) Btrfs cannot gracefully handle separate filesystems that have the same > > UUID. At all. > > b) Grub appears to pick the wrong filesystem when presented with two > > filesystems with the same UUID. > > > > I feel a) is a btrfs bug. > > I feel b) is a bug that is more about "ecosystem design" than grub being > > silly. > > Regarding a) > IIRC, btrfs collects the filesystem information by UUID; if two > filesystems have the same UUID (like the LVM-snapshot case), the > last filesystem discovered overwrite the first one. > > The filesystem discovering is done in user-space; so it should be simple > to skip a filesystem on a LVM-snapshot. > > Regarding b) > I am bit confused: if I understood correctly, the root filesystem was > picked from a LVM-snapshot, so grub-probe *correctly* reported that > the root device is the snapshot. > The problem was that during the boot filesystem discovering: first > scanned the *real* device, then the LVM-snapshot; the latter > overwrote the former so the system booted from the LVM-snapshot.
IMHO if the device UUID search finds multiple devices with the same device
UUID, it should ignore _all_ of them as the identification problem
is unsolvable without further user input. This is what the 'device='
mount option is for.
> My conclusion is that we should improve the btrfs scan so:
> - in udev rules, a partition that is a LVM snapshot by default
> should be not scanned by "btrfs dev scan"
> - "btrfs dev scan", during the partition discovery should skip the
> lvm-snapshot.
That would mean I can't do this:
1. lvm snapshot of ext4 filesystem
2. btrfs-convert the snapshot
3. mount the snapshot, make sure it's OK
4. merge LVM snapshot to overwrite original ext4 filesystem
which would be a shame since that's the only way I ever convert ext3/4
filesystems to btrfs (btrfs-convert is a little buggy still).
> BR
> G.Baroncelli
>
>
>
> --
> gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
> Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
signature.asc
Description: Digital signature
