dracut and UUID's

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

dracut and UUID's

William Kenworthy
Hi all,

    I have cloned a gentoo image for a raspberry pi to another sdcard. 
It fails to boot because the storage uuid's have changed and dracut has
the previous uuid's stored internally.  Is there a way around this
without changing the new storage's uuids back to match the original (its
bad practise to duplicate uuids) or using an original rpi kerneal and
rebuild the custom one?


BillK



Reply | Threaded
Open this post in threaded view
|

Re: dracut and UUID's

Rich Freeman
On Sat, Feb 16, 2019 at 8:48 PM Bill Kenworthy <[hidden email]> wrote:
>
>     I have cloned a gentoo image for a raspberry pi to another sdcard.
> It fails to boot because the storage uuid's have changed and dracut has
> the previous uuid's stored internally.  Is there a way around this
> without changing the new storage's uuids back to match the original (its
> bad practise to duplicate uuids) or using an original rpi kerneal and
> rebuild the custom one?

Are you passing root=UUID=xyz on the command line?  Also, do you have
the correct UUID in /etc/fstab?

Dracut does save a snapshot of fstab internally, but I think it should
work if passed the UUID on the command line.  You do want the real
/etc/fstab to have the correct UUID, because after dracut mounts root
it checks fstab and remounts root with any options in case its
internal copy is stale.  If the fstab on the hard drive is incorrect
that could lead it astray.

If it isn't breaking to a shell you can force it to with a command
line option, and then from there just mount root yourself on /sysroot,
and exit the shell, and then it should boot.  Another option is to
just use it as a rescue image and just mount root on /sysroot and then
just chroot into it, and now you're basically at a semi-working
system.  You could easily rebuild dracut from there.  Or you can just
boot from a rescue disk and regenerate dracut.

But, I suspect just editing your command line in grub will do the
trick if /etc/fstab on the hard drive is good.

--
Rich

Reply | Threaded
Open this post in threaded view
|

Re: dracut and UUID's

William Kenworthy
On 17/2/19 10:08 am, Rich Freeman wrote:

> On Sat, Feb 16, 2019 at 8:48 PM Bill Kenworthy <[hidden email]> wrote:
>>     I have cloned a gentoo image for a raspberry pi to another sdcard.
>> It fails to boot because the storage uuid's have changed and dracut has
>> the previous uuid's stored internally.  Is there a way around this
>> without changing the new storage's uuids back to match the original (its
>> bad practise to duplicate uuids) or using an original rpi kerneal and
>> rebuild the custom one?
> Are you passing root=UUID=xyz on the command line?  Also, do you have
> the correct UUID in /etc/fstab?
>
> Dracut does save a snapshot of fstab internally, but I think it should
> work if passed the UUID on the command line.  You do want the real
> /etc/fstab to have the correct UUID, because after dracut mounts root
> it checks fstab and remounts root with any options in case its
> internal copy is stale.  If the fstab on the hard drive is incorrect
> that could lead it astray.
>
> If it isn't breaking to a shell you can force it to with a command
> line option, and then from there just mount root yourself on /sysroot,
> and exit the shell, and then it should boot.  Another option is to
> just use it as a rescue image and just mount root on /sysroot and then
> just chroot into it, and now you're basically at a semi-working
> system.  You could easily rebuild dracut from there.  Or you can just
> boot from a rescue disk and regenerate dracut.
>
> But, I suspect just editing your command line in grub will do the
> trick if /etc/fstab on the hard drive is good.
>
Hi Rich, no grub! A rpi uses a custom loader (apparently the GPU starts
the boot process).  I'll investigate if it can passthrough a UUID. 
Looks like next stop is the pi forums, but most use their kernel, not a
custom one.


BillK



Reply | Threaded
Open this post in threaded view
|

Re: dracut and UUID's

Rich Freeman
On Sat, Feb 16, 2019 at 9:24 PM Bill Kenworthy <[hidden email]> wrote:
>
> Hi Rich, no grub! A rpi uses a custom loader (apparently the GPU starts
> the boot process).  I'll investigate if it can passthrough a UUID.
> Looks like next stop is the pi forums, but most use their kernel, not a
> custom one.
>

Doh!  Missed that it was a pi.

https://www.raspberrypi.org/documentation/configuration/cmdline-txt.md

I believe that is just a FAT32 partition so you can edit it pretty trivially.

--
Rich

Reply | Threaded
Open this post in threaded view
|

Re: dracut and UUID's

Neil Bothwick
In reply to this post by William Kenworthy
On Sun, 17 Feb 2019 09:48:11 +0800, Bill Kenworthy wrote:

>     I have cloned a gentoo image for a raspberry pi to another sdcard. 
> It fails to boot because the storage uuid's have changed and dracut has
> the previous uuid's stored internally.  Is there a way around this
> without changing the new storage's uuids back to match the original (its
> bad practise to duplicate uuids) or using an original rpi kerneal and
> rebuild the custom one?

The initramfs is just a cpio archive, so you could unpack it, edit the
file(s) containing the UUID and repack it. Although Rich's suggestion of
regenerating it from a rescue disk may be easier.


--
Neil Bothwick

Rainbows are just to look at, not to really understand.

attachment0 (849 bytes) Download Attachment