Re: Drive identifiers

2018-01-24 Thread Ludovic Courtès
Ricardo Wurmus skribis: > ;; Get the UUID of the encrypted disk > (define %uuid > (let* ((port (open-input-pipe "blkid -s UUID -o value /dev/sda1")) > (str (read-line port))) > (close-pipe port) > str)) > … > (operating-system … > (mapped-devices (list (mapped-device >

Re: Drive identifiers

2018-01-19 Thread Ricardo Wurmus
myg...@gmail.com writes: > On 01/18/2018 at 10:29 Danny Milosavljevic writes: > > [...] > >> Maybe we could make the user specify the serial number in the >> operating-system >> bootloader-configuration. Installing the bootloader to the wrong >> drive would be very bad otherwise. Also, it's no

Re: Drive identifiers

2018-01-19 Thread Danny Milosavljevic
Even better: Using /dev/disk/by-id , I think this already works now with no user-space changes! (bootloader (grub-configuration (device "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_1TB_S21DNXAGB15171J"))) Reconfiguring as we speak... Yep. Works.

Re: Drive identifiers

2018-01-19 Thread Danny Milosavljevic
> bug#23072. The bug is sill open. From the bug report: >>> "clocksource: Switched to clocksource tsc" That's a Linux kernel message - so grub is innocent. It loaded the Linux kernel. I recommend mounting the root by UUID, then it will be found. > I would not recommend doing this because f

Re: Drive identifiers

2018-01-18 Thread Danny Milosavljevic
Hi, On Thu, 18 Jan 2018 19:43:54 -0500 myg...@gmail.com wrote: > Here I comment on consequences of having > the SN of a HD in a file held by that HD. IMO this is like having the > directory name in a file held by the directory. Both raise the same > issue: the file is no longer relocatable. > > I

Re: Drive identifiers

2018-01-18 Thread myglc2
On 01/18/2018 at 10:29 Danny Milosavljevic writes: [...] > Maybe we could make the user specify the serial number in the operating-system > bootloader-configuration. Installing the bootloader to the wrong > drive would be very bad otherwise. Also, it's not exactly declarative if the > labels sd

Re: Drive identifiers

2018-01-18 Thread myglc2
On 01/18/2018 at 10:29 Danny Milosavljevic writes: >> IIRC the details are: when running on a system disk (say: /dev/sda) and >> installing to new disk (say: /dev/sdb) you must set the bootloader >> target to /dev/sdb so the boot loader will be copied to the new system > ^ >

Re: Drive identifiers

2018-01-18 Thread Danny Milosavljevic
Hi Ludo, On Thu, 18 Jan 2018 11:32:11 +0100 l...@gnu.org (Ludovic Courtès) wrote: > Do GRUB, U-Boot, and co. provide a way to refer to drivers by serial > number? Not that I know of. udev (and ID_SERIAL) is a relatively (10 years) recent invention. I don't think there was a generic way to eas

Re: Drive identifiers

2018-01-18 Thread Ludovic Courtès
Danny Milosavljevic skribis: > guix/scripts/system.scm install-bootloader should resolve target, like > > if target doesn't startwith "/dev/" > compare target with ID_SERIAL using udevinfo, return device name > else > as before Do GRUB, U-Boot, and co. provide a way to refer to drive

Re: Drive identifiers

2018-01-18 Thread Danny Milosavljevic
Modification would be: guix/scripts/system.scm install-bootloader should resolve target, like if target doesn't startwith "/dev/" compare target with ID_SERIAL using udevinfo, return device name else as before gnu/system/vm.scm qemu-image should resolve target likewise before callin

Drive identifiers

2018-01-18 Thread Danny Milosavljevic
> IIRC the details are: when running on a system disk (say: /dev/sda) and > installing to new disk (say: /dev/sdb) you must set the bootloader > target to /dev/sdb so the boot loader will be copied to the new system ^ | +--- we could change that to enable specify