linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cannot mount btrfs as root
@ 2018-09-19 13:19 Zbigniew 'zibi' Jarosik
  2018-09-19 13:54 ` Qu Wenruo
  2018-09-19 23:42 ` anand.jain
  0 siblings, 2 replies; 5+ messages in thread
From: Zbigniew 'zibi' Jarosik @ 2018-09-19 13:19 UTC (permalink / raw)
  To: linux-btrfs

Hi!

I can't mount my RAID1 set as rootfs, but as normal mount to running
system works normally. It was working normal, than some day it died.

When booted to rootfs as
root=UUID=98c94774-d93a-400e-a275-58cc3ac2a58a rootflags=subvol=@root
i got:

BTRFS error (device bcache2): devid 5 uuid
dd09f810-717e-4f2f-97ab-26469d5adca5 is missing
BTRFS error (device bcache2): failed to read the system array: -2
BTRFS error (device bcache2): open_ctree failed
mount: mounting /dev/bcache2 on /root failed: Invalid argument

and (initramfs) prompt.

Bcache devices are registered and populated in /dev.

When I boot exacly the same kernel and initrd, but rootfs is on
pendrive ( root=/dev/sda2 ) than mount dataset to subdir ( mount UUID=
98c94774-d93a-400e-a275-58cc3ac2a58a  /data ) - works flawlessly.

Thanks in advance for any ideas.

Some system info:

/dev/sdb1: UUID="780cc211-2408-4594-83df-379ee23d6ed8" TYPE="bcache"
PARTLABEL="Linux filesystem"
PARTUUID="ef83f1b4-b55c-4deb-8037-69ff16909222"
/dev/sdc1: UUID="80a1b115-8a1f-41f7-b65b-dd4fdaf400f1" TYPE="bcache"
PARTLABEL="Linux filesystem"
PARTUUID="1f920d16-af68-440b-891c-5ff61c3057ca"
/dev/sdd1: UUID="a40e80dc-f7e2-4a9c-9bfe-81489a1261ca" TYPE="bcache"
PARTLABEL="Linux filesystem"
PARTUUID="4b68c314-f029-402a-b332-b0b9109ad51d"
/dev/bcache0: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
UUID_SUB="dd09f810-717e-4f2f-97ab-26469d5adca5" TYPE="btrfs"
/dev/bcache1: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
UUID_SUB="8469962d-f9ee-4b5f-b4d5-4a62190c0d8f" TYPE="btrfs"
/dev/bcache2: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
UUID_SUB="516f2bd1-3fcc-42fd-87ad-5d5fa2f84b5f" TYPE="btrfs"

Linux hp1 4.17.11-ldkb #2 SMP Thu Aug 2 09:24:58 CEST 2018 x86_64 GNU/Linux
btrfs-progs v4.7.3
Label: none  uuid: 98c94774-d93a-400e-a275-58cc3ac2a58a
        Total devices 3 FS bytes used 3.21TiB
        devid    3 size 2.73TiB used 2.07TiB path /dev/bcache2
        devid    4 size 2.73TiB used 2.18TiB path /dev/bcache1
        devid    5 size 2.73TiB used 2.18TiB path /dev/bcache0
Data, RAID1: total=3.20TiB, used=3.20TiB
System, RAID1: total=32.00MiB, used=480.00KiB
Metadata, RAID1: total=12.00GiB, used=10.81GiB
GlobalReserve, single: total=512.00MiB, used=0.00B


-- 
Zbigniew 'zibi' Jarosik
cell: +48 667956686
jid: tapiau@gmail.com
gg: 2830
http://zibi.nora.pl/

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

* Re: cannot mount btrfs as root
  2018-09-19 13:19 cannot mount btrfs as root Zbigniew 'zibi' Jarosik
@ 2018-09-19 13:54 ` Qu Wenruo
  2018-09-20  6:20   ` Zbigniew 'zibi' Jarosik
  2018-09-19 23:42 ` anand.jain
  1 sibling, 1 reply; 5+ messages in thread
From: Qu Wenruo @ 2018-09-19 13:54 UTC (permalink / raw)
  To: Zbigniew 'zibi' Jarosik, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 2900 bytes --]



On 2018/9/19 下午9:19, Zbigniew 'zibi' Jarosik wrote:
> Hi!
> 
> I can't mount my RAID1 set as rootfs, but as normal mount to running
> system works normally. It was working normal, than some day it died.
> 
> When booted to rootfs as
> root=UUID=98c94774-d93a-400e-a275-58cc3ac2a58a rootflags=subvol=@root
> i got:
> 
> BTRFS error (device bcache2): devid 5 uuid
> dd09f810-717e-4f2f-97ab-26469d5adca5 is missing
> BTRFS error (device bcache2): failed to read the system array: -2

One of your device is missing, thus read_one_dev() refuse to continue
and return -ENOENT (-2).

Does the iniramfs do a "btrfs dev scan" to make populate btrfs devices
lists?

> BTRFS error (device bcache2): open_ctree failed
> mount: mounting /dev/bcache2 on /root failed: Invalid argument
> 
> and (initramfs) prompt.
> 
> Bcache devices are registered and populated in /dev.
> 
> When I boot exacly the same kernel and initrd, but rootfs is on
> pendrive ( root=/dev/sda2 ) than mount dataset to subdir ( mount UUID=
> 98c94774-d93a-400e-a275-58cc3ac2a58a  /data ) - works flawlessly.
> 
> Thanks in advance for any ideas.
> 
> Some system info:
> 
> /dev/sdb1: UUID="780cc211-2408-4594-83df-379ee23d6ed8" TYPE="bcache"
> PARTLABEL="Linux filesystem"
> PARTUUID="ef83f1b4-b55c-4deb-8037-69ff16909222"
> /dev/sdc1: UUID="80a1b115-8a1f-41f7-b65b-dd4fdaf400f1" TYPE="bcache"
> PARTLABEL="Linux filesystem"
> PARTUUID="1f920d16-af68-440b-891c-5ff61c3057ca"
> /dev/sdd1: UUID="a40e80dc-f7e2-4a9c-9bfe-81489a1261ca" TYPE="bcache"
> PARTLABEL="Linux filesystem"
> PARTUUID="4b68c314-f029-402a-b332-b0b9109ad51d"
> /dev/bcache0: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
> UUID_SUB="dd09f810-717e-4f2f-97ab-26469d5adca5" TYPE="btrfs"

The devices is indeed here, so it's not a missing device, but looks like
at mount time, btrfs hasn't fully scanned all devices.

You could refer to your distribution manual to figure out how to make
btrfs scan work before mounting the rootfs.

Thanks,
Qu

> /dev/bcache1: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
> UUID_SUB="8469962d-f9ee-4b5f-b4d5-4a62190c0d8f" TYPE="btrfs"
> /dev/bcache2: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
> UUID_SUB="516f2bd1-3fcc-42fd-87ad-5d5fa2f84b5f" TYPE="btrfs"
> 
> Linux hp1 4.17.11-ldkb #2 SMP Thu Aug 2 09:24:58 CEST 2018 x86_64 GNU/Linux
> btrfs-progs v4.7.3
> Label: none  uuid: 98c94774-d93a-400e-a275-58cc3ac2a58a
>         Total devices 3 FS bytes used 3.21TiB
>         devid    3 size 2.73TiB used 2.07TiB path /dev/bcache2
>         devid    4 size 2.73TiB used 2.18TiB path /dev/bcache1
>         devid    5 size 2.73TiB used 2.18TiB path /dev/bcache0
> Data, RAID1: total=3.20TiB, used=3.20TiB
> System, RAID1: total=32.00MiB, used=480.00KiB
> Metadata, RAID1: total=12.00GiB, used=10.81GiB
> GlobalReserve, single: total=512.00MiB, used=0.00B
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: cannot mount btrfs as root
  2018-09-19 13:19 cannot mount btrfs as root Zbigniew 'zibi' Jarosik
  2018-09-19 13:54 ` Qu Wenruo
@ 2018-09-19 23:42 ` anand.jain
  1 sibling, 0 replies; 5+ messages in thread
From: anand.jain @ 2018-09-19 23:42 UTC (permalink / raw)
  To: Zbigniew 'zibi' Jarosik, linux-btrfs



On 09/19/2018 09:19 PM, Zbigniew 'zibi' Jarosik wrote:
> Hi!
> 
> I can't mount my RAID1 set as rootfs, but as normal mount to running
> system works normally. It was working normal, than some day it died.
> 
> When booted to rootfs as
> root=UUID=98c94774-d93a-400e-a275-58cc3ac2a58a rootflags=subvol=@root
> i got:
> 
> BTRFS error (device bcache2): devid 5 uuid
> dd09f810-717e-4f2f-97ab-26469d5adca5 is missing
> BTRFS error (device bcache2): failed to read the system array: -2
> BTRFS error (device bcache2): open_ctree failed
> mount: mounting /dev/bcache2 on /root failed: Invalid argument


Having the '-o degraded' mount option will make this successful but 
looks like the other disk is slow to be identified as you were able to 
mount after boot.

Thanks, Anand

> and (initramfs) prompt.
> 
> Bcache devices are registered and populated in /dev.
> 
> When I boot exacly the same kernel and initrd, but rootfs is on
> pendrive ( root=/dev/sda2 ) than mount dataset to subdir ( mount UUID=
> 98c94774-d93a-400e-a275-58cc3ac2a58a  /data ) - works flawlessly.
> 
> Thanks in advance for any ideas.
> 
> Some system info:
> 
> /dev/sdb1: UUID="780cc211-2408-4594-83df-379ee23d6ed8" TYPE="bcache"
> PARTLABEL="Linux filesystem"
> PARTUUID="ef83f1b4-b55c-4deb-8037-69ff16909222"
> /dev/sdc1: UUID="80a1b115-8a1f-41f7-b65b-dd4fdaf400f1" TYPE="bcache"
> PARTLABEL="Linux filesystem"
> PARTUUID="1f920d16-af68-440b-891c-5ff61c3057ca"
> /dev/sdd1: UUID="a40e80dc-f7e2-4a9c-9bfe-81489a1261ca" TYPE="bcache"
> PARTLABEL="Linux filesystem"
> PARTUUID="4b68c314-f029-402a-b332-b0b9109ad51d"
> /dev/bcache0: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
> UUID_SUB="dd09f810-717e-4f2f-97ab-26469d5adca5" TYPE="btrfs"
> /dev/bcache1: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
> UUID_SUB="8469962d-f9ee-4b5f-b4d5-4a62190c0d8f" TYPE="btrfs"
> /dev/bcache2: UUID="98c94774-d93a-400e-a275-58cc3ac2a58a"
> UUID_SUB="516f2bd1-3fcc-42fd-87ad-5d5fa2f84b5f" TYPE="btrfs"
> 
> Linux hp1 4.17.11-ldkb #2 SMP Thu Aug 2 09:24:58 CEST 2018 x86_64 GNU/Linux
> btrfs-progs v4.7.3
> Label: none  uuid: 98c94774-d93a-400e-a275-58cc3ac2a58a
>          Total devices 3 FS bytes used 3.21TiB
>          devid    3 size 2.73TiB used 2.07TiB path /dev/bcache2
>          devid    4 size 2.73TiB used 2.18TiB path /dev/bcache1
>          devid    5 size 2.73TiB used 2.18TiB path /dev/bcache0
> Data, RAID1: total=3.20TiB, used=3.20TiB
> System, RAID1: total=32.00MiB, used=480.00KiB
> Metadata, RAID1: total=12.00GiB, used=10.81GiB
> GlobalReserve, single: total=512.00MiB, used=0.00B
> 
> 

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

* Re: cannot mount btrfs as root
  2018-09-19 13:54 ` Qu Wenruo
@ 2018-09-20  6:20   ` Zbigniew 'zibi' Jarosik
  2018-09-20 16:11     ` Zbigniew 'zibi' Jarosik
  0 siblings, 1 reply; 5+ messages in thread
From: Zbigniew 'zibi' Jarosik @ 2018-09-20  6:20 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On 19 September 2018 at 15:54, Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>
> Does the iniramfs do a "btrfs dev scan" to make populate btrfs devices
> lists?

This solved problem. Looks like btrfs scans disks to early, before
bcache initializes. I need to debug initrfamfs scripts.

Thanks a lot for hint!


-- 
Zbigniew 'zibi' Jarosik
cell: +48 667956686
jid: tapiau@gmail.com
gg: 2830
http://zibi.nora.pl/

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

* Re: cannot mount btrfs as root
  2018-09-20  6:20   ` Zbigniew 'zibi' Jarosik
@ 2018-09-20 16:11     ` Zbigniew 'zibi' Jarosik
  0 siblings, 0 replies; 5+ messages in thread
From: Zbigniew 'zibi' Jarosik @ 2018-09-20 16:11 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On 20 September 2018 at 08:20, Zbigniew 'zibi' Jarosik <zibi@nora.pl> wrote:
> On 19 September 2018 at 15:54, Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>>
>> Does the iniramfs do a "btrfs dev scan" to make populate btrfs devices
>> lists?
>
> This solved problem. Looks like btrfs scans disks to early, before
> bcache initializes. I need to debug initrfamfs scripts.

There is race condition - bcache initalizes slower than expected, so
btrfs cannot find devices, because they are not ready.

rootdelay=10 in grub solved problem temporary, need to write
boot-script that will handle it and wait until bcache devices will be
ready to use.


-- 
Zbigniew 'zibi' Jarosik
cell: +48 667956686
jid: tapiau@gmail.com
gg: 2830
http://zibi.nora.pl/

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

end of thread, other threads:[~2018-09-20 21:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19 13:19 cannot mount btrfs as root Zbigniew 'zibi' Jarosik
2018-09-19 13:54 ` Qu Wenruo
2018-09-20  6:20   ` Zbigniew 'zibi' Jarosik
2018-09-20 16:11     ` Zbigniew 'zibi' Jarosik
2018-09-19 23:42 ` anand.jain

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