Can't boot due to discrepancy between reconfigure and init

  • Open
  • quality assurance status badge
Details
2 participants
  • Josselin Poiret
  • Csepp
Owner
unassigned
Submitted by
Csepp
Severity
normal
C
(address . bug-guix@gnu.org)
87jzvxrk94.fsf@riseup.net
I'm trying to move my installation from /dev/sda to /dev/sdb, I created
the file system and changed the bootloader config in my operating-system
definition to point to /dev/sdb and the file-system to use the correct
UUID (previously it was using a label).
First I tried to simply reconfigure my running system and then taking a
BTRFS snapshot and copying that over the /dev/sdb1, but that failed.
The exact error was GRUB not being able to find a file system with a
given UUID, which matched the UUID of /dev/sda1. This error happened
before GRUB loaded any of its modules, so I was dropped into a rescue
shell.
I thought this might be related to subvolumes, maybe I originally used
the wrong config and the updated config was written to a different
subvolume and GRUB doesn't recognize the default subvolume ID option on
the BTRFS partition.
I think this is a fairly critical error.

The error doesn't manifest when I run guix system init with the same
config, so there is some (possibly un(der)documented) difference between
guix system reconfigure and guix system init that makes the former rely
on the state of the running system in a way that doesn't take into
account the new configuration.

Is this intended behaviour for some reason?
J
J
Josselin Poiret wrote on 21 Jun 2023 09:45
87legd45t1.fsf@jpoiret.xyz
Hi Csepp,

Csepp <raingloom@riseup.net> writes:

Toggle quote (7 lines)
> I'm trying to move my installation from /dev/sda to /dev/sdb, I created
> the file system and changed the bootloader config in my operating-system
> definition to point to /dev/sdb and the file-system to use the correct
> UUID (previously it was using a label).
> First I tried to simply reconfigure my running system and then taking a
> BTRFS snapshot and copying that over the /dev/sdb1, but that failed.

Any reason you didn't try in the reverse order? This seems prone to error.

Toggle quote (10 lines)
> The exact error was GRUB not being able to find a file system with a
> given UUID, which matched the UUID of /dev/sda1. This error happened
> before GRUB loaded any of its modules, so I was dropped into a rescue
> shell.
> I thought this might be related to subvolumes, maybe I originally used
> the wrong config and the updated config was written to a different
> subvolume and GRUB doesn't recognize the default subvolume ID option on
> the BTRFS partition.
> I think this is a fairly critical error.

This is too fuzzy to be actionable, but if you manage to reproduce
reliably then I would gladly take a look at it.

Toggle quote (6 lines)
> The error doesn't manifest when I run guix system init with the same
> config, so there is some (possibly un(der)documented) difference between
> guix system reconfigure and guix system init that makes the former rely
> on the state of the running system in a way that doesn't take into
> account the new configuration.

I don't think there is, the biggest difference is that `guix system
init` will copy stuff into the target store and initialize the basic
directories for Guix, whereas reconfigure will just build everything in
the current store.

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmSSqpoQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5Fhcaiq7RDAC5MHCJVgd3EzvWy4HusWs2ywThOU4trY21
lTmz78YbOhq3JT7GYq1xw/lxIY+UDvQ5e3tGT6v7cDSytR3f8EAYI9sTAcJdVTpN
pKXKLoql80nxxsoZyzwjVyv5xNr4mo3J4wRQaMdy8XxR5oOOZjhLwWPe3RI6qfdY
yDPfRJd1G96ChBth1Z5D5rE6a86lGqW1HaiC1unE2m+XQZfeOZI7FClVSDqN72zT
hQcspVbbdl5mMOlKCH4sDBACsnnU94LiYNWifFV6k9S+zmZ3lG5ewEm9PULxwor0
Jt5WTqvdAR80K9T8kK3g1i0uHUw1dQoljHjLyt7eeUibW5YORTMRx9p5EznTofXe
7QqebhQRIV0lgNNxmcWUz/lh1N7jJvmrHwjvaLN5rRBcyANevkt7EYV7z9sA0GLz
oTNusl4mEPS8VFvZJFr0gyoISzUg8Ut3svaydCi19rCntsuuGAICM13rTNNDaGWh
1wLUqHejcjirzx9k35OvUmkmWpyo0+o=
=fhIA
-----END PGP SIGNATURE-----

C
(name . Josselin Poiret)(address . dev@jpoiret.xyz)
877crwmpl1.fsf@riseup.net
Josselin Poiret <dev@jpoiret.xyz> writes:

Toggle quote (14 lines)
> [[PGP Signed Part:Undecided]]
> Hi Csepp,
>
> Csepp <raingloom@riseup.net> writes:
>
>> I'm trying to move my installation from /dev/sda to /dev/sdb, I created
>> the file system and changed the bootloader config in my operating-system
>> definition to point to /dev/sdb and the file-system to use the correct
>> UUID (previously it was using a label).
>> First I tried to simply reconfigure my running system and then taking a
>> BTRFS snapshot and copying that over the /dev/sdb1, but that failed.
>
> Any reason you didn't try in the reverse order? This seems prone to error.

Since reconfigure overwrites /dev/sdb, I don't see how reversing the
order would fix things??
Maybe copying the file system over and *then* running init would make
sense.

Toggle quote (13 lines)
>> The exact error was GRUB not being able to find a file system with a
>> given UUID, which matched the UUID of /dev/sda1. This error happened
>> before GRUB loaded any of its modules, so I was dropped into a rescue
>> shell.
>> I thought this might be related to subvolumes, maybe I originally used
>> the wrong config and the updated config was written to a different
>> subvolume and GRUB doesn't recognize the default subvolume ID option on
>> the BTRFS partition.
>> I think this is a fairly critical error.
>
> This is too fuzzy to be actionable, but if you manage to reproduce
> reliably then I would gladly take a look at it.

I tried reproducing it, it seems to happen every time, but I can try to
create a more minimal test case.

Toggle quote (13 lines)
>> The error doesn't manifest when I run guix system init with the same
>> config, so there is some (possibly un(der)documented) difference between
>> guix system reconfigure and guix system init that makes the former rely
>> on the state of the running system in a way that doesn't take into
>> account the new configuration.
>
> I don't think there is, the biggest difference is that `guix system
> init` will copy stuff into the target store and initialize the basic
> directories for Guix, whereas reconfigure will just build everything in
> the current store.
>
> Best,

I mean, that's the theory, but either Guix or GRUB seems to get the
incorrect UUID from *somewhere*.
J
J
Josselin Poiret wrote on 22 Jun 2023 09:35
(name . Csepp)(address . raingloom@riseup.net)
87h6r0rlub.fsf@jpoiret.xyz
Hi,

Csepp <raingloom@riseup.net> writes:
Toggle quote (10 lines)
>> I don't think there is, the biggest difference is that `guix system
>> init` will copy stuff into the target store and initialize the basic
>> directories for Guix, whereas reconfigure will just build everything in
>> the current store.
>>
>> Best,
>
> I mean, that's the theory, but either Guix or GRUB seems to get the
> incorrect UUID from *somewhere*.

You can manually check that the generated grub.cfg file contains the
expected UUID after the reconfigure, it should be in
/boot/grub/grub.cfg.

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmST+awQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcailvgC/4iFN3XijbRtC1ED/4S18XvNwJaHUyX8+Dg
sil+wPlwuynkTfJvbQh4l+q0DkOyDXOy0prd1ZIStP6yghVg3Ormq12L2O9Zx/Yv
LlC6/e67VILUINo/ULpogcRFKwWj64OqEsURnhkH3+ohXiWnRK6+pJdOSTZxLf2E
HlZFflftUt6NDm7dwbI0jQ022bMIAQxpncOCgOHyi2ZG94dwznDblr3GlHJxyBy1
sOmn71t8fZNuZnQsfKw6nQqRxxcQHIgLcgtGuo51nSxhpPQ5lSsJhB9iACFg7jn4
DI+dUtIPu/NDJDem44K7MfBzWaburg+b7bQtoqR6W0r0I1mKMKYtKOuKIz+eD9Bt
JtZh18F5/14NTtbI3F2LvDLZWPfwSJBEmNeLqlwtr2XR6NvEvXbTdnaVy0SKLqB4
wj0DpmBGgtn9ek2G5m1sXxUkjcWUmOLyAXUI+1JL3r3yOZvEOPIK//2EjVOwuR0t
fz8USFsLsR2ktLNt0fjt4xGLD8v5vpU=
=45Yn
-----END PGP SIGNATURE-----

C
(name . Josselin Poiret)(address . dev@jpoiret.xyz)
874jmwzqiy.fsf@riseup.net
Josselin Poiret <dev@jpoiret.xyz> writes:

Toggle quote (20 lines)
> [[PGP Signed Part:Undecided]]
> Hi,
>
> Csepp <raingloom@riseup.net> writes:
>>> I don't think there is, the biggest difference is that `guix system
>>> init` will copy stuff into the target store and initialize the basic
>>> directories for Guix, whereas reconfigure will just build everything in
>>> the current store.
>>>
>>> Best,
>>
>> I mean, that's the theory, but either Guix or GRUB seems to get the
>> incorrect UUID from *somewhere*.
>
> You can manually check that the generated grub.cfg file contains the
> expected UUID after the reconfigure, it should be in
> /boot/grub/grub.cfg.
>
> Best,

I did, I think I already wrote that it wasn't coming from there, but
I'll check again when I next try it.
C
(name . Csepp)(address . raingloom@riseup.net)
87o7jy9tra.fsf@riseup.net
Csepp <raingloom@riseup.net> writes:

Toggle quote (25 lines)
> Josselin Poiret <dev@jpoiret.xyz> writes:
>
>> [[PGP Signed Part:Undecided]]
>> Hi,
>>
>> Csepp <raingloom@riseup.net> writes:
>>>> I don't think there is, the biggest difference is that `guix system
>>>> init` will copy stuff into the target store and initialize the basic
>>>> directories for Guix, whereas reconfigure will just build everything in
>>>> the current store.
>>>>
>>>> Best,
>>>
>>> I mean, that's the theory, but either Guix or GRUB seems to get the
>>> incorrect UUID from *somewhere*.
>>
>> You can manually check that the generated grub.cfg file contains the
>> expected UUID after the reconfigure, it should be in
>> /boot/grub/grub.cfg.
>>
>> Best,
>
> I did, I think I already wrote that it wasn't coming from there, but
> I'll check again when I next try it.

This is still happening. Couldn't figure out a decent way to transfer
my system with btrfs send.
I checked the generated bootloader installer script that gets run, it
seems to refer to the correct device, but somehow the UUID of the booted
partition still gets accessed.
I guess I'll have to strace it.
?