Debian Bug report logs - #772752
btrfs-tools: [Wishlist item] Replace "btrfs device scan" in initramfs with a udev rule and "udevadm trigger -s block"

version graph

Package: btrfs-progs; Maintainer for btrfs-progs is Adam Borowski <kilobyte@angband.pl>; Source for btrfs-progs is src:btrfs-progs (PTS, buildd, popcon).

Reported by: Goffredo Baroncelli <kreijack@gmail.com>

Date: Wed, 10 Dec 2014 19:39:02 UTC

Severity: wishlist

Found in version 3.17-1.1

Reply or subscribe to this bug.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, kreijack@gmail.com, kreijack@inwind.it, Dimitri John Ledkov <xnox@debian.org>:
Bug#772752; Package btrfs-tools. (Wed, 10 Dec 2014 19:39:06 GMT) (full text, mbox, link).


Acknowledgement sent to Goffredo Baroncelli <kreijack@gmail.com>:
New Bug report received and forwarded. Copy sent to kreijack@gmail.com, kreijack@inwind.it, Dimitri John Ledkov <xnox@debian.org>. (Wed, 10 Dec 2014 19:39:06 GMT) (full text, mbox, link).


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

From: Goffredo Baroncelli <kreijack@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: btrfs-tools: [Wishlist item] Replace "btrfs device scan" in initramfs with a udev rule and "udevadm trigger -s block"
Date: Wed, 10 Dec 2014 20:35:59 +0100
Package: btrfs-tools
Version: 3.17-1.1
Severity: wishlist


btrfs-tools has a script for initramfs which load the btrfs module
and does a "btrfs device scan".

I suggest to replace the "btrfs device scan" with a udev rule (the
one provided by the package udev, see Bug#772744) which uses
the udev builtin method.
Because the module may be inserted after that some devices appeared,
after the module insert,we have to be do a "udevadm trigger -s block"
to redoing a device rescan for btrfs.

The goal of this change is to armonize how the btrfs device scan is
done in intramfs to after the initramfs

Below two patch to highlight this change.

BR
G.Baroncelli

--- /usr/share/initramfs-tools/scripts/local-premount/btrfs	2014-11-22 15:01:04.000000000 +0100
+++ usr/share/initramfs-tools/scripts/local-premount/btrfs	2014-12-10 20:31:31.289746904 +0100
@@ -19,5 +19,5 @@
 if [ -x /sbin/btrfs ]
 then
 	modprobe btrfs
-	/sbin/btrfs device scan 2> /dev/null
+	udevadm trigger -s block
 fi


--- /usr/share/initramfs-tools/hooks/btrfs	2014-11-22 15:01:04.000000000 +0100
+++ usr/share/initramfs-tools/hooks/btrfs	2014-12-10 20:34:07.181751787 +0100
@@ -26,4 +26,13 @@
 	then
 	    copy_exec /sbin/fsck.btrfs /sbin
 	fi
+
+	mkdir -p $DESTDIR/lib/udev/rules.d/
+	for rules in 64-btrfs.rules; do
+	  if   [ -e /etc/udev/rules.d/$rules ]; then
+	    cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
+	  elif [ -e /lib/udev/rules.d/$rules ]; then
+	    cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
+	  fi
+	done
 fi



-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages btrfs-tools depends on:
ii  e2fslibs    1.42.12-1
ii  libblkid1   2.25.2-3
ii  libc6       2.19-13
ii  libcomerr2  1.42.12-1
ii  liblzo2-2   2.08-1
ii  libuuid1    2.25.2-3
ii  zlib1g      1:1.2.8.dfsg-2+b1

btrfs-tools recommends no packages.

btrfs-tools suggests no packages.

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#772752; Package btrfs-tools. (Thu, 11 Dec 2014 20:33:10 GMT) (full text, mbox, link).


Acknowledgement sent to Dimitri John Ledkov <xnox@debian.org>:
Extra info received and forwarded to list. (Thu, 11 Dec 2014 20:33:10 GMT) (full text, mbox, link).


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

From: Dimitri John Ledkov <xnox@debian.org>
To: Goffredo Baroncelli <kreijack@gmail.com>, 772752@bugs.debian.org
Subject: Re: Bug#772752: btrfs-tools: [Wishlist item] Replace "btrfs device scan" in initramfs with a udev rule and "udevadm trigger -s block"
Date: Thu, 11 Dec 2014 20:31:44 +0000
On 10 December 2014 at 19:35, Goffredo Baroncelli <kreijack@gmail.com> wrote:
> Package: btrfs-tools
> Version: 3.17-1.1
> Severity: wishlist
>
>
> btrfs-tools has a script for initramfs which load the btrfs module
> and does a "btrfs device scan".
>
> I suggest to replace the "btrfs device scan" with a udev rule (the
> one provided by the package udev, see Bug#772744) which uses
> the udev builtin method.
> Because the module may be inserted after that some devices appeared,
> after the module insert,we have to be do a "udevadm trigger -s block"
> to redoing a device rescan for btrfs.
>

I disagree, udev in initramfs is optional and the premount script is
there precisely because at the moment udev based discovery is not
sufficient. Also it's not btrfs package/hook responsibility to call
udevadm trigger. On a running system this is only done after all local
filesystems have been mounted.

I have a separate bug report requesting to add an extra systemd unit
to call device scan before local filesystems have been mounted.

Also 64-btrfs.rules should not be installed by btrfs package, if udev
package ships it. Looking at the systemd source package, the
64-btrfs.rules udev rule does something different to the btrfs-tools:
btrfs device scan calls BTRFS_IOC_SCAN_DEV whilst systemd's rule calls
BTRFS_IOC_DEVICES_READY. I'm not too sure, but if ramdisk is not using
systemd and not using udev it really needs device scan.

> The goal of this change is to armonize how the btrfs device scan is
> done in intramfs to after the initramfs
>

Do you have a bug report against current integration? If not, I will
close this bug report as won't fix.

Regards,

Dimitri.


> Below two patch to highlight this change.
>
> BR
> G.Baroncelli
>
> --- /usr/share/initramfs-tools/scripts/local-premount/btrfs     2014-11-22 15:01:04.000000000 +0100
> +++ usr/share/initramfs-tools/scripts/local-premount/btrfs      2014-12-10 20:31:31.289746904 +0100
> @@ -19,5 +19,5 @@
>  if [ -x /sbin/btrfs ]
>  then
>         modprobe btrfs
> -       /sbin/btrfs device scan 2> /dev/null
> +       udevadm trigger -s block
>  fi
>
>
> --- /usr/share/initramfs-tools/hooks/btrfs      2014-11-22 15:01:04.000000000 +0100
> +++ usr/share/initramfs-tools/hooks/btrfs       2014-12-10 20:34:07.181751787 +0100
> @@ -26,4 +26,13 @@
>         then
>             copy_exec /sbin/fsck.btrfs /sbin
>         fi
> +
> +       mkdir -p $DESTDIR/lib/udev/rules.d/
> +       for rules in 64-btrfs.rules; do
> +         if   [ -e /etc/udev/rules.d/$rules ]; then
> +           cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
> +         elif [ -e /lib/udev/rules.d/$rules ]; then
> +           cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
> +         fi
> +       done
>  fi
>
>
>
> -- System Information:
> Debian Release: 8.0
>   APT prefers unstable
>   APT policy: (500, 'unstable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
> Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
>
> Versions of packages btrfs-tools depends on:
> ii  e2fslibs    1.42.12-1
> ii  libblkid1   2.25.2-3
> ii  libc6       2.19-13
> ii  libcomerr2  1.42.12-1
> ii  liblzo2-2   2.08-1
> ii  libuuid1    2.25.2-3
> ii  zlib1g      1:1.2.8.dfsg-2+b1
>
> btrfs-tools recommends no packages.
>
> btrfs-tools suggests no packages.
>
> -- no debconf information

-- 
Regards,

Dimitri.



Information forwarded to debian-bugs-dist@lists.debian.org, Dimitri John Ledkov <xnox@debian.org>:
Bug#772752; Package btrfs-tools. (Thu, 11 Dec 2014 21:21:14 GMT) (full text, mbox, link).


Acknowledgement sent to kreijack@inwind.it:
Extra info received and forwarded to list. Copy sent to Dimitri John Ledkov <xnox@debian.org>. (Thu, 11 Dec 2014 21:21:14 GMT) (full text, mbox, link).


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

From: Goffredo Baroncelli <kreijack@gmail.com>
To: Dimitri John Ledkov <xnox@debian.org>, 772752@bugs.debian.org
Subject: Re: Bug#772752: btrfs-tools: [Wishlist item] Replace "btrfs device scan" in initramfs with a udev rule and "udevadm trigger -s block"
Date: Thu, 11 Dec 2014 22:17:37 +0100
On 12/11/2014 09:31 PM, Dimitri John Ledkov wrote:
> On 10 December 2014 at 19:35, Goffredo Baroncelli <kreijack@gmail.com> wrote:
>> Package: btrfs-tools
>> Version: 3.17-1.1
>> Severity: wishlist
>>
>>
>> btrfs-tools has a script for initramfs which load the btrfs module
>> and does a "btrfs device scan".
>>
>> I suggest to replace the "btrfs device scan" with a udev rule (the
>> one provided by the package udev, see Bug#772744) which uses
>> the udev builtin method.
>> Because the module may be inserted after that some devices appeared,
>> after the module insert,we have to be do a "udevadm trigger -s block"
>> to redoing a device rescan for btrfs.
>>
> 
> I disagree, udev in initramfs is optional 

If udev is optional in initramfs, my request has to be rejected.

> and the premount script is
> there precisely because at the moment udev based discovery is not
> sufficient. 

I would like to know more about that: in which case udev based
discovery is not sufficient ? Or are you referring about the
fact that udev is not mandatory in initramfs.

[...]

BR
G.Baroncelli

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



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#772752; Package btrfs-tools. (Thu, 11 Dec 2014 21:45:12 GMT) (full text, mbox, link).


Acknowledgement sent to Dimitri John Ledkov <xnox@debian.org>:
Extra info received and forwarded to list. (Thu, 11 Dec 2014 21:45:12 GMT) (full text, mbox, link).


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

From: Dimitri John Ledkov <xnox@debian.org>
To: "kreijack@inwind.it" <kreijack@inwind.it>
Cc: 772752@bugs.debian.org
Subject: Re: Bug#772752: btrfs-tools: [Wishlist item] Replace "btrfs device scan" in initramfs with a udev rule and "udevadm trigger -s block"
Date: Thu, 11 Dec 2014 21:40:13 +0000
On 11 December 2014 at 21:17, Goffredo Baroncelli <kreijack@gmail.com> wrote:
> On 12/11/2014 09:31 PM, Dimitri John Ledkov wrote:
>> On 10 December 2014 at 19:35, Goffredo Baroncelli <kreijack@gmail.com> wrote:
>>> Package: btrfs-tools
>>> Version: 3.17-1.1
>>> Severity: wishlist
>>>
>>>
>>> btrfs-tools has a script for initramfs which load the btrfs module
>>> and does a "btrfs device scan".
>>>
>>> I suggest to replace the "btrfs device scan" with a udev rule (the
>>> one provided by the package udev, see Bug#772744) which uses
>>> the udev builtin method.
>>> Because the module may be inserted after that some devices appeared,
>>> after the module insert,we have to be do a "udevadm trigger -s block"
>>> to redoing a device rescan for btrfs.
>>>
>>
>> I disagree, udev in initramfs is optional
>
> If udev is optional in initramfs, my request has to be rejected.
>

udev in initramfs is optional, moreover initramfs is optional on
debian and plenty of people run things without it.


>> and the premount script is
>> there precisely because at the moment udev based discovery is not
>> sufficient.
>
> I would like to know more about that: in which case udev based
> discovery is not sufficient ? Or are you referring about the
> fact that udev is not mandatory in initramfs.
>

mosty yes, refereing to the fact that udev is not mandatory in the
Debian's initramfs. There is also ongoing bug stating that udev based
discovery is not sufficient in the initramfsless system, i have not
investigated it completely.

-- 
Regards,

Dimitri.



Information forwarded to debian-bugs-dist@lists.debian.org, Dimitri John Ledkov <xnox@debian.org>:
Bug#772752; Package btrfs-tools. (Thu, 11 Dec 2014 22:24:14 GMT) (full text, mbox, link).


Acknowledgement sent to kreijack@inwind.it:
Extra info received and forwarded to list. Copy sent to Dimitri John Ledkov <xnox@debian.org>. (Thu, 11 Dec 2014 22:24:14 GMT) (full text, mbox, link).


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

From: Goffredo Baroncelli <kreijack@inwind.it>
To: Dimitri John Ledkov <xnox@debian.org>
Cc: 772752@bugs.debian.org
Subject: Re: Bug#772752: btrfs-tools: [Wishlist item] Replace "btrfs device scan" in initramfs with a udev rule and "udevadm trigger -s block"
Date: Thu, 11 Dec 2014 23:16:07 +0100
On 12/11/2014 10:40 PM, Dimitri John Ledkov wrote:
> On 11 December 2014 at 21:17, Goffredo Baroncelli <kreijack@gmail.com> wrote:

>>> and the premount script is
>>> there precisely because at the moment udev based discovery is not
>>> sufficient.
>>
>> I would like to know more about that: in which case udev based
>> discovery is not sufficient ? Or are you referring about the
>> fact that udev is not mandatory in initramfs.
>>
> 
> mosty yes, refereing to the fact that udev is not mandatory in the
> Debian's initramfs. There is also ongoing bug stating that udev based
> discovery is not sufficient in the initramfsless system, i have not
> investigated it completely.

I read something about that. The report stated that btrfs didn't honor the
device=/dev/<disk> mount options; In this case would be impossible to
mount a multi-device filesystem.
But I didn't understand the reason....
 
Goffredo

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



Bug reassigned from package 'btrfs-tools' to 'btrfs-progs'. Request was from Andreas Beckmann <anbe@debian.org> to control@bugs.debian.org. (Sat, 17 Jun 2023 22:15:05 GMT) (full text, mbox, link).


No longer marked as found in versions btrfs-tools/3.17-1.1. Request was from Andreas Beckmann <anbe@debian.org> to control@bugs.debian.org. (Sat, 17 Jun 2023 22:15:05 GMT) (full text, mbox, link).


Marked as found in versions 3.17-1.1. Request was from Andreas Beckmann <anbe@debian.org> to control@bugs.debian.org. (Sat, 17 Jun 2023 22:15:05 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: Wed Apr 24 06:08:37 2024; Machine Name: buxtehude

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.