Debian Bug report logs - #685311
update udev rule for lvm on mdadm autodetection

version graph

Package: btrfs-tools; Maintainer for btrfs-tools is Dimitri John Ledkov <xnox@debian.org>; Source for btrfs-tools is src:btrfs-progs (PTS, buildd, popcon).

Reported by: Daniel Pocock <daniel@pocock.com.au>

Date: Sun, 19 Aug 2012 15:09:02 UTC

Severity: normal

Found in version btrfs-tools/0.19+20120328-7

Fixed in version btrfs-tools/0.19+20120328-8

Done: Daniel Baumann <daniel.baumann@progress-technologies.net>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Daniel Baumann <daniel.baumann@progress-technologies.net>:
Bug#685311; Package btrfs-tools. (Sun, 19 Aug 2012 15:09:04 GMT) (full text, mbox, link).


Acknowledgement sent to Daniel Pocock <daniel@pocock.com.au>:
New Bug report received and forwarded. Copy sent to Daniel Baumann <daniel.baumann@progress-technologies.net>. (Sun, 19 Aug 2012 15:09:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Daniel Pocock <daniel@pocock.com.au>
To: submit@bugs.debian.org
Subject: btrfs RAID1 filesystems on LVs not scanned/detected at boot
Date: Sun, 19 Aug 2012 15:06:26 +0000
Package: btrfs-tools
Version: 0.19+20120328-7
Severity: critical

I've marked this as critical as more people are likely to use btrfs with
wheezy, and it results in filesystems not coming up at boot,
consequently it is a system-wide issue and not just a package issue.  It
does not involve data loss.

Apparently the

  btrfs dev scan

command must be invoked before a btrfs RAID1 filesystem can be mounted.

btrfs-tools has some support for this in /lib/udev/rules.d/60-btrfs.rules

However, in my case, my RAID1 is made up of two LVM logical volumes,

  mkfs.btrfs -m raid1 -d raid1 /dev/mapper/vg00-btrfsvol0_[01]

and the udev script never seems to be called.

When I try to mount the volume after a reboot:

# mount /dev/mapper/vg00-btrfsvol0_0 /mnt/btrfs0
mount: wrong fs type, bad option, bad superblock on
/dev/mapper/vg00-btrfsvol0_0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

I checked dmesg:

[17216.145092] device fsid c959d4a5-0713-4685-b572-8a679ec37e20 devid 1
transid 34 /dev/mapper/vg00-btrfsvol0_0
[17216.145639] btrfs: disk space caching is enabled
[17216.146987] btrfs: failed to read the system array on dm-100
[17216.147556] btrfs: open_ctree failed

The feedback from the btrfs community is that

a) `btrfs dev scan' should run from an init script

b) may need the "Device mapper uevents" option in the
kernel (CONFIG_DM_UEVENT) to trigger the udev rule when you enable
your VG(s)

http://comments.gmane.org/gmane.comp.file-systems.btrfs/19271




Changed Bug title to 'update udev rule for lvm on mdadm autodetection' from 'btrfs RAID1 filesystems on LVs not scanned/detected at boot' Request was from Daniel Baumann <daniel.baumann@progress-technologies.net> to control@bugs.debian.org. (Sun, 19 Aug 2012 15:15:03 GMT) (full text, mbox, link).


Severity set to 'normal' from 'critical' Request was from Daniel Baumann <daniel.baumann@progress-technologies.net> to control@bugs.debian.org. (Sun, 19 Aug 2012 15:15:04 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Baumann <daniel.baumann@progress-technologies.net>:
Bug#685311; Package btrfs-tools. (Sun, 19 Aug 2012 17:00:09 GMT) (full text, mbox, link).


Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Daniel Baumann <daniel.baumann@progress-technologies.net>. (Sun, 19 Aug 2012 17:00:09 GMT) (full text, mbox, link).


Message #14 received at 685311@bugs.debian.org (full text, mbox, reply):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: 685311-submitter@bugs.debian.org
Cc: 685311@bugs.debian.org
Subject: Re: update udev rule for lvm on mdadm autodetection
Date: Sun, 19 Aug 2012 19:01:42 +0200
i do neither use nor about lvm, however, something like this in e.g. 
/lib/udev/rules.d/99-btrfs.rules should come close to it:

---snip---
SUBSYSTEM!="block", GOTO="btrfs_end"
ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member", GOTO="btrfs_lvm_end"
RUN+="/sbin/modprobe btrfs"
RUN+="/sbin/btrfs device scan $env{DEVNAME}"

LABEL="btfs_lvm_end"
---snap---

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Message sent on to Daniel Pocock <daniel@pocock.com.au>:
Bug#685311. (Sun, 19 Aug 2012 17:00:11 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Baumann <daniel.baumann@progress-technologies.net>:
Bug#685311; Package btrfs-tools. (Sun, 19 Aug 2012 19:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Daniel Pocock <daniel@pocock.com.au>:
Extra info received and forwarded to list. Copy sent to Daniel Baumann <daniel.baumann@progress-technologies.net>. (Sun, 19 Aug 2012 19:15:03 GMT) (full text, mbox, link).


Message #22 received at 685311@bugs.debian.org (full text, mbox, reply):

From: Daniel Pocock <daniel@pocock.com.au>
To: daniel.baumann@progress-technologies.net, 685311-quiet@bugs.debian.org
Cc: 685311-submitter@bugs.debian.org, 685311@bugs.debian.org
Subject: Re: Bug#685311: update udev rule for lvm on mdadm autodetection
Date: Sun, 19 Aug 2012 21:09:55 +0200

On 19/08/12 19:01, Daniel Baumann wrote:
> i do neither use nor about lvm, however, something like this in e.g.
> /lib/udev/rules.d/99-btrfs.rules should come close to it:
> 
> ---snip---
> SUBSYSTEM!="block", GOTO="btrfs_end"
> ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member", GOTO="btrfs_lvm_end"
> RUN+="/sbin/modprobe btrfs"
> RUN+="/sbin/btrfs device scan $env{DEVNAME}"
> 
> LABEL="btfs_lvm_end"
> ---snap---
> 



Should the first line of that read

SUBSYSTEM!="block", GOTO="btrfs_lvm_end"

and the last line should be

LABEL="btrfs_lvm_end"

?

I will test it when I can reboot the machine again, and let you know the
results

There are various reasons for using logical volumes as the raw device
for btrfs RAID1, the most compelling reasons

a) pvmove the LV to another device without downtime if necessary

b) raw partitions can be extended, but they can't be moved to a
different starting cylinder without downtime, LVM doesn't have such problems

c) btrfs doesn't feature encryption yet, it is currently recommended to
encrypt the raw device somehow




Information stored :
Bug#685311; Package btrfs-tools. (Sun, 19 Aug 2012 19:15:05 GMT) (full text, mbox, link).


Acknowledgement sent to Daniel Pocock <daniel@pocock.com.au>:
Extra info received and filed, but not forwarded. (Sun, 19 Aug 2012 19:15:05 GMT) (full text, mbox, link).


Message sent on to Daniel Pocock <daniel@pocock.com.au>:
Bug#685311. (Sun, 19 Aug 2012 19:15:07 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Baumann <daniel.baumann@progress-technologies.net>:
Bug#685311; Package btrfs-tools. (Sun, 19 Aug 2012 19:27:05 GMT) (full text, mbox, link).


Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Daniel Baumann <daniel.baumann@progress-technologies.net>. (Sun, 19 Aug 2012 19:27:05 GMT) (full text, mbox, link).


Message #35 received at 685311@bugs.debian.org (full text, mbox, reply):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: Daniel Pocock <daniel@pocock.com.au>
Cc: 685311@bugs.debian.org
Subject: Re: Bug#685311: update udev rule for lvm on mdadm autodetection
Date: Sun, 19 Aug 2012 21:32:18 +0200
On 08/19/2012 09:09 PM, Daniel Pocock wrote:
> Should the first line of that read
>
> SUBSYSTEM!="block", GOTO="btrfs_lvm_end"
>
> and the last line should be
>
> LABEL="btrfs_lvm_end"

yes,

> I will test it when I can reboot the machine again, and let you know the
> results

thanks.

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Baumann <daniel.baumann@progress-technologies.net>:
Bug#685311; Package btrfs-tools. (Sun, 19 Aug 2012 21:45:02 GMT) (full text, mbox, link).


Acknowledgement sent to Daniel Pocock <daniel@pocock.com.au>:
Extra info received and forwarded to list. Copy sent to Daniel Baumann <daniel.baumann@progress-technologies.net>. (Sun, 19 Aug 2012 21:45:03 GMT) (full text, mbox, link).


Message #40 received at 685311@bugs.debian.org (full text, mbox, reply):

From: Daniel Pocock <daniel@pocock.com.au>
To: daniel.baumann@progress-technologies.net
Cc: 685311@bugs.debian.org
Subject: Re: Bug#685311: update udev rule for lvm on mdadm autodetection
Date: Sun, 19 Aug 2012 23:42:00 +0200

On 19/08/12 21:32, Daniel Baumann wrote:
> On 08/19/2012 09:09 PM, Daniel Pocock wrote:
>> Should the first line of that read
>>
>> SUBSYSTEM!="block", GOTO="btrfs_lvm_end"
>>
>> and the last line should be
>>
>> LABEL="btrfs_lvm_end"
> 
> yes,
> 
>> I will test it when I can reboot the machine again, and let you know the
>> results
> 

I tweaked it some more, the following variation works and I can mount
the raid1 without having to run the scan manually:

cat > /lib/udev/rules.d/99-btrfs.rules << EOF
SUBSYSTEM!="block", GOTO="btrfs_lvm_end"
ENV{DM_UUID}!="LVM-?*", GOTO="btrfs_lvm_end"
RUN+="/sbin/modprobe btrfs"
RUN+="/sbin/btrfs device scan $env{DEVNAME}"

LABEL="btrfs_lvm_end"
EOF


Do you believe this will be sufficient to use such a RAID1 btrfs volume
on top of LVM as a root filesystem too?  I would like to test such a
config later this week.





Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Baumann <daniel.baumann@progress-technologies.net>:
Bug#685311; Package btrfs-tools. (Mon, 20 Aug 2012 05:03:03 GMT) (full text, mbox, link).


Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Daniel Baumann <daniel.baumann@progress-technologies.net>. (Mon, 20 Aug 2012 05:03:03 GMT) (full text, mbox, link).


Message #45 received at 685311@bugs.debian.org (full text, mbox, reply):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: Daniel Pocock <daniel@pocock.com.au>
Cc: 685311@bugs.debian.org
Subject: Re: Bug#685311: update udev rule for lvm on mdadm autodetection
Date: Mon, 20 Aug 2012 07:00:37 +0200
On 08/19/2012 11:42 PM, Daniel Pocock wrote:
> Do you believe this will be sufficient to use such a RAID1 btrfs volume
> on top of LVM as a root filesystem too?

i don't know, just try it?

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Baumann <daniel.baumann@progress-technologies.net>:
Bug#685311; Package btrfs-tools. (Mon, 20 Aug 2012 18:48:03 GMT) (full text, mbox, link).


Acknowledgement sent to Daniel Pocock <daniel@pocock.com.au>:
Extra info received and forwarded to list. Copy sent to Daniel Baumann <daniel.baumann@progress-technologies.net>. (Mon, 20 Aug 2012 18:48:03 GMT) (full text, mbox, link).


Message #50 received at 685311@bugs.debian.org (full text, mbox, reply):

From: Daniel Pocock <daniel@pocock.com.au>
To: daniel.baumann@progress-technologies.net
Cc: 685311@bugs.debian.org
Subject: Re: Bug#685311: update udev rule for lvm on mdadm autodetection
Date: Mon, 20 Aug 2012 20:44:01 +0200

On 20/08/12 07:00, Daniel Baumann wrote:
> On 08/19/2012 11:42 PM, Daniel Pocock wrote:
>> Do you believe this will be sufficient to use such a RAID1 btrfs volume
>> on top of LVM as a root filesystem too?
> 
> i don't know, just try it?
> 


I'll try that test later in the week - I think it is out of the scope of
this bug report though, I believe the udev rule is sufficient for the
case I described and I hope this fix can go into wheezy

I'll try the other cases (e.g. encrypted LV, root FS on combined btrfs
raid1 with LVM) and open separate bugs for them if they don't work



Reply sent to Daniel Baumann <daniel.baumann@progress-technologies.net>:
You have taken responsibility. (Tue, 21 Aug 2012 10:06:30 GMT) (full text, mbox, link).


Notification sent to Daniel Pocock <daniel@pocock.com.au>:
Bug acknowledged by developer. (Tue, 21 Aug 2012 10:06:30 GMT) (full text, mbox, link).


Message #55 received at 685311-close@bugs.debian.org (full text, mbox, reply):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: 685311-close@bugs.debian.org
Subject: Bug#685311: fixed in btrfs-tools 0.19+20120328-8
Date: Tue, 21 Aug 2012 10:03:02 +0000
Source: btrfs-tools
Source-Version: 0.19+20120328-8

We believe that the bug you reported is fixed in the latest version of
btrfs-tools, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 685311@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <daniel.baumann@progress-technologies.net> (supplier of updated btrfs-tools package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 21 Aug 2012 11:49:31 +0200
Source: btrfs-tools
Binary: btrfs-tools btrfs-tools-udeb btrfs-tools-dbg
Architecture: source i386
Version: 0.19+20120328-8
Distribution: unstable
Urgency: low
Maintainer: Daniel Baumann <daniel.baumann@progress-technologies.net>
Changed-By: Daniel Baumann <daniel.baumann@progress-technologies.net>
Description: 
 btrfs-tools - Checksumming Copy on Write Filesystem utilities
 btrfs-tools-dbg - Checksumming Copy on Write Filesystem utilities (debug)
 btrfs-tools-udeb - Checksumming Copy on Write Filesystem utilities (udeb) (udeb)
Closes: 685311
Changes: 
 btrfs-tools (0.19+20120328-8) unstable; urgency=low
 .
   * Adding udev rule for btrfs on lvm, thanks to Daniel Pocock
     <daniel@pocock.com.au> for testing (Closes: #685311).
   * Adding postrm to rebuild initrd without btrfs on remove.
Checksums-Sha1: 
 ceb08174f0f146e41c072baee901592be3de7b30 1339 btrfs-tools_0.19+20120328-8.dsc
 f8f09658b2f91f5e9ca20b0068b65e3f54cd9c6d 9452 btrfs-tools_0.19+20120328-8.debian.tar.xz
 425477b395345d6f1c38d9e4fb2dbb7839c028e5 251456 btrfs-tools_0.19+20120328-8_i386.deb
 3df2ca94bc8c00ba8dad4ef8745f084c58f4d599 108304 btrfs-tools-udeb_0.19+20120328-8_i386.udeb
 f3d6ee1a84ee0dceddee1a4322316a83755f97e3 3714154 btrfs-tools-dbg_0.19+20120328-8_i386.deb
Checksums-Sha256: 
 adf41795926f6c7ef4429830b58181002074c0f5ed0c5186118cfa9b51a40834 1339 btrfs-tools_0.19+20120328-8.dsc
 314044395b765f3c246b65bdd4888b221f2be58607c9d3c0f63acf5fa2089abf 9452 btrfs-tools_0.19+20120328-8.debian.tar.xz
 d9c40f338a99be6739a7fabc96209744308ed66b09b0ec56ec913a5debcb7d12 251456 btrfs-tools_0.19+20120328-8_i386.deb
 57a70a0af0ca9b22783a4a6dc4ab88bd8836cfc23b6dcf33d0fc83b4ecee9338 108304 btrfs-tools-udeb_0.19+20120328-8_i386.udeb
 76cae5a2c1a80331ce3e65099faf879ac784b3061bc655bae97a325da1691bf7 3714154 btrfs-tools-dbg_0.19+20120328-8_i386.deb
Files: 
 e651d421bcfd773aabce147b10e3e923 1339 admin optional btrfs-tools_0.19+20120328-8.dsc
 f8f0f021d4293e5913bf727b37f94ba5 9452 admin optional btrfs-tools_0.19+20120328-8.debian.tar.xz
 34ae8e45a058ed943830b7f7f8692d86 251456 admin optional btrfs-tools_0.19+20120328-8_i386.deb
 b2ee0e4ec9964d53b6e347364cc01e0a 108304 debian-installer optional btrfs-tools-udeb_0.19+20120328-8_i386.udeb
 e1743f7c4858d21f78f9c631d6ab5a8a 3714154 debug extra btrfs-tools-dbg_0.19+20120328-8_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAlAzWzIACgkQ+C5cwEsrK56wOQCg0jtJ42NPNmxIzAGk2gzeRfZt
dbkAn11P40v2PwapPkATo23/suMjruk3
=p3yQ
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 07 Jun 2013 07:27:13 GMT) (full text, mbox, link).


Bug unarchived. Request was from Daniel Pocock <daniel@pocock.pro> to control@bugs.debian.org. (Sat, 14 Jan 2017 14:24:04 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Dimitri John Ledkov <xnox@debian.org>:
Bug#685311; Package btrfs-tools. (Sat, 14 Jan 2017 14:27:06 GMT) (full text, mbox, link).


Acknowledgement sent to Daniel Pocock <daniel@pocock.pro>:
Extra info received and forwarded to list. Copy sent to Dimitri John Ledkov <xnox@debian.org>. (Sat, 14 Jan 2017 14:27:06 GMT) (full text, mbox, link).


Message #64 received at 685311@bugs.debian.org (full text, mbox, reply):

From: Daniel Pocock <daniel@pocock.pro>
To: 685311@bugs.debian.org
Subject: follow-up
Date: Sat, 14 Jan 2017 15:26:07 +0100
[Message part 1 (text/plain, inline)]

Attached is a copy of the 99-btrfs.rules file that I created, as
discussed in this bug

The version of the package released in wheezy was 0.19+20120328-7.1 -
without the bug fix

The bug fix installs the file as /lib/udev/rules.d/80-btrfs-lvm.rules -
not the same filename that was discussed in this bug report

This was included in version 3.17-1.1 in jessie

Anybody who created the file manually may have had two copies of it on
their system after upgrading to jessie

Running jessie, I observed intermittent problems with non-Btrfs
filesystems failing to mount on every boot on the system where this udev
file was created manually[1]

In some later version of the btrfs-tools package (or its successor,
btrfs-progs), the udev files were removed from the package (see
debian/changelog).  After upgrading to one of these newer versions of
the package, either from jessie-backports or stretch, the manually
created 99-btrfs.rules file was left on the system even after the
80-btrfs-lvm.rules was removed by the package upgrade.

The existence of this file as a potential source of the mount problem
only became apparent after upgrading the system to stretch.  Running
stretch, the journalctl logs appear to be more verbose than jessie and
they show the 'btrfs scan' commands between attempted and failing around
the same time that the ext4 mounts are attempted and failing with EBUSY.



1. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829180


[99-btrfs.rules (text/plain, attachment)]

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 12 Feb 2017 07:26:09 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jul 24 07:58:14 2020; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.