GNU bug report logs - #35995
[wishlist] bootloader-configuration, avoid use of /dev/sd?

Previous Next

Package: guix;

Reported by: Giovanni Biscuolo <g <at> xelera.eu>

Date: Wed, 29 May 2019 19:17:02 UTC

Severity: wishlist

Done: Giovanni Biscuolo <g <at> xelera.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35995 in the body.
You can then email your comments to 35995 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

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


Report forwarded to bug-guix <at> gnu.org:
bug#35995; Package guix. (Wed, 29 May 2019 19:17:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Giovanni Biscuolo <g <at> xelera.eu>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 29 May 2019 19:17:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Giovanni Biscuolo <g <at> xelera.eu>
To: bug-guix <at> gnu.org
Subject: [wishlist] bootloader-configuration, avoid use of /dev/sd?
Date: Wed, 29 May 2019 21:16:11 +0200
[Message part 1 (text/plain, inline)]
Hello,

Following a recent discussion on Guix-devel [1] I'm "forwarding here" a
proposal to switch from /dev/sd? to (target (uuid ...)) in
bootloader-configuration operating-system declaration

This is a recap of current situation: the installer usually uses
/dev/sda as target for grub-install (and bootloader-cofiguration) but it
happened to me that on a machine /dev/sda was the USB media, not the
target HD

The fact is that it's not guaranteed that /dev/sd? always corresponds to
the same device

This is where we are with the discussion:

Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello!
>
> Giovanni Biscuolo <g <at> xelera.eu> skribis:
>
>> But wait! There's the /dev/disk/by-id/ tree, I did not notice it until
>> now! :-)
>>
>> That's the solution:
>>
>>
>>   (bootloader
>>     (bootloader-configuration
>>       (bootloader grub-bootloader)
>>       (target "/dev/disk/by-id/scsi-3600508b1001c75a3bebb04b23d19e249")
>>       (keyboard-layout keyboard-layout)))
>>
>> I did not test this but it smells like running, if Guix devels agree I
>> think Installer should adopt /dev/disk/by-id by default, sorry I'm not
>> able to propose a patch for this
>
> Ideally, we’d use an actual UUID object (or a string?) here rather than
> this Linux/udev-specific idiom.  So it would look like:
>
>   (bootloader-configuration
>     ;; …
>     (target (uuid …)))
>
> Would that work?
>
> I believe using Guile-Parted we could map it back to a /dev name.
>
> WDYT?
>
> Ludo’.



[1] Message-ID: <87o93mwr4b.fsf <at> gnu.org>
    http://lists.gnu.org/archive/html/guix-devel/2019-05/msg00454.html

-- 
Giovanni Biscuolo

Xelera IT Infrastructures
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35995; Package guix. (Wed, 29 May 2019 19:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 35995 <at> debbugs.gnu.org (full text, mbox):

From: Giovanni Biscuolo <g <at> xelera.eu>
To: 35995 <at> debbugs.gnu.org, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Ludovic Courtès <ludo <at> gnu.org>
Cc: guix-devel <at> gnu.org
Subject: Re: Installer: GUIX_IMAGE as /dev/sda on some hardware?
Date: Wed, 29 May 2019 21:49:41 +0200
[Message part 1 (text/plain, inline)]
Hello Tobias and Ludo'

I've opened a bug report for this, WDYT if we go on there?

Tobias Geerinckx-Rice <me <at> tobias.gr> writes:

> Ludovic Courtès wrote:
>> Ideally, we’d use an actual UUID object (or a string?) here 
>> rather than
>> this Linux/udev-specific idiom.  […]
>> I believe using Guile-Parted we could map it back to a /dev 
>> name.
>
> Yah, 's one of the reasons that I haven't sent anything yet (the 
> main one being shame, of course; car/cdr for the win & all that).
>
>> Would that work?
>
> I'd looked in Guile-parted before but came up dry.  To be fair I 
> did little more than grep around for ‘uid’ and friends.  So you 
> tell me ;-)
>
> …
>
> Hum, wait a minute.  Isn't that irrelevant?  Doesn't Guix itself 
> do exactly this when mounting file systems?  Sigh, silly me, I 
> should be able to re-use that…  >_<

Grub supports quite a number of ways to specify devices [1] but I cannot
find something suitable for this purpose: am I missimg something
obvious?

AFAIU on ther distros (e.g. Debian) (the installer?) populates a device
map [2] using the grub-mkdevicemap utility (grub-common package in
Debian) but I cannot find that in our grub package

This is an example on one of my Debian hosts:

--8<---------------cut here---------------start------------->8---

$ cat /boot/grub/device.map
(hd0)	/dev/disk/by-id/ata-WDC_WD10EADS-00L5B1_WD-WCAU4D992691
(hd1)	/dev/disk/by-id/ata-ST3250620NS_9QE2L68Z
(hd2)	/dev/disk/by-id/ata-ST3250620NS_9QE2FSQD
(hd3)	/dev/disk/by-id/ata-ST3250620NS_9QE27YPJ
(hd4)	/dev/disk/by-id/ata-WDC_WD7500BPKT-00PK4T0_WD-WX11A4181554
(hd5)	/dev/disk/by-id/ata-WDC_WD7500BPKT-00PK4T0_WD-WXM1A61D0766

--8<---------------cut here---------------end--------------->8---

(the map is not updated)

We could use (hd?) in grub config - that's grub specific, not Linux/udev
specific - **but** we should find a way to automate the selection of the
device corresponding to our target (the one mounted as /mnt)

Thanks for working on this!!!

Happy hacking. Gio'.



[1] https://www.gnu.org/software/grub/manual/grub/html_node/Device-syntax.html


[2] https://www.gnu.org/software/grub/manual/grub/html_node/Device-map.html

-- 
Giovanni Biscuolo

Xelera IT Infrastructures
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35995; Package guix. (Wed, 29 May 2019 20:20:02 GMT) Full text and rfc822 format available.

Message #11 received at 35995 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Giovanni Biscuolo <g <at> xelera.eu>, 35995 <at> debbugs.gnu.org
Cc: guix-devel <at> gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: Re: Installer: GUIX_IMAGE as /dev/sda on some hardware?
Date: Wed, 29 May 2019 22:19:44 +0200
[Message part 1 (text/plain, inline)]
Grub already can search by uuid or label (via "search --fsuuid" and
"search --label", respectively).  IF you specify an uuid or label
in your operating-system configuration it will use that.

The only part missing is: The Guix installer's config generator should
find out the uuids and print those instead of the /dev nodes.

If nothing else, we can just use blkid to find out which is which.

For example: blkid -d -s UUID -o value /dev/sda1

But T G-R is right, Guix already does what is required at other places.

Care has to be taken that parted also uses GUIDs for GPT partition TYPES
and also for partitions as such (not their contents).  Those are something
else.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35995; Package guix. (Fri, 31 May 2019 21:43:01 GMT) Full text and rfc822 format available.

Message #14 received at 35995 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 35995 <at> debbugs.gnu.org, Giovanni Biscuolo <g <at> xelera.eu>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, guix-devel <at> gnu.org
Subject: Re: Installer: GUIX_IMAGE as /dev/sda on some hardware?
Date: Fri, 31 May 2019 23:42:15 +0200
Hi Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> Grub already can search by uuid or label (via "search --fsuuid" and
> "search --label", respectively).  IF you specify an uuid or label
> in your operating-system configuration it will use that.

These are concerned with file system UUIDs/labels, whereas this issue is
about disk IDs, AIUI.  Or am I missing something?

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#35995; Package guix. (Fri, 31 May 2019 22:18:02 GMT) Full text and rfc822 format available.

Message #17 received at 35995 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 35995 <at> debbugs.gnu.org, Danny Milosavljevic <dannym <at> scratchpost.org>,
 guix-devel <at> gnu.org, Giovanni Biscuolo <g <at> xelera.eu>
Subject: Re: Installer: GUIX_IMAGE as /dev/sda on some hardware?
Date: Sat, 01 Jun 2019 00:16:51 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès wrote:
> Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
>> Grub already can search by uuid or label (via "search --fsuuid" 
>> and
>> "search --label", respectively).  IF you specify an uuid or 
>> label
>> in your operating-system configuration it will use that.
>
> These are concerned with file system UUIDs/labels, whereas this 
> issue is
> about disk IDs, AIUI.  Or am I missing something?

This.  Also, this only affects grub-install—not ‘grub 
run-time’—which runs under the Hurd/Linux/…, unless I, too, am 
missing something, and this entire thread collapses in a cacophony 
of confusion.

G'night,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35995; Package guix. (Fri, 31 May 2019 23:32:03 GMT) Full text and rfc822 format available.

Message #20 received at 35995 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 35995 <at> debbugs.gnu.org, Giovanni Biscuolo <g <at> xelera.eu>,
 Ludovic Courtès <ludo <at> gnu.org>, guix-devel <at> gnu.org
Subject: Re: Installer: GUIX_IMAGE as /dev/sda on some hardware?
Date: Sat, 1 Jun 2019 01:31:27 +0200
[Message part 1 (text/plain, inline)]
Yeah, but disk ids are not uuids.

/dev/disk/by-id seems to be a good way to find those disk ids in order to pass
them to grub-install.  I doubt that this can be made OS-independent--even the
udev rules specify different variables for different devices, sometimes it's
bus id and serial number, sometimes it's name and serial number, sometimes it's
ieee1394_id, sometimes ID_WWN_WITH_EXTENSION.

Alternatively, grub also works from a boot-active partition--it nothing else
works, we can install grub to a partition (for example the root partition).

Then, migration would be difficult, though (if people had grub installed on
the MBR, that destroyed the previous loader that would have loaded from the
boot sector of the partition).
[Message part 2 (application/pgp-signature, inline)]

Reply sent to Giovanni Biscuolo <g <at> xelera.eu>:
You have taken responsibility. (Wed, 28 Feb 2024 09:56:03 GMT) Full text and rfc822 format available.

Notification sent to Giovanni Biscuolo <g <at> xelera.eu>:
bug acknowledged by developer. (Wed, 28 Feb 2024 09:56:03 GMT) Full text and rfc822 format available.

Message #25 received at 35995-done <at> debbugs.gnu.org (full text, mbox):

From: Giovanni Biscuolo <g <at> xelera.eu>
To: 35995-done <at> debbugs.gnu.org
Subject: bug#35995: [wishlist] bootloader-configuration, avoid use of /dev/sd?
Date: Wed, 28 Feb 2024 10:29:04 +0100
[Message part 1 (text/plain, inline)]
Hello,

I think this bug has been fixed in bug #51878:

Pushed as b90504cdb5ce3d1981c8d7bc8a9cc918b0d60af7 (26 Nov 2021).

Closing! :-)

-- 
Giovanni Biscuolo

Xelera IT Infrastructures
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 27 Mar 2024 11:24:23 GMT) Full text and rfc822 format available.

This bug report was last modified 29 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.