guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drive identifiers


From: Danny Milosavljevic
Subject: Drive identifiers
Date: Thu, 18 Jan 2018 10:29:14 +0100

> 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 specifying a model and
                 serial number

> disk.

> But, at least on my servers, when I remove the original system
> disk, the new disk system becomes /dev/sda, and the bootloader fails.

It does?  What error message does it fail with?  Does the grub shell still 
start?

I thought grub's "search" facility existed to prevent this exact scenario
(since it searches for the actual file / uuid on all drives it should be immune
to drive swapping - within reason).

It would be possible for us to find out the drive's serial number
(which should be somewhat unique and persistent):

$ udevadm info --query=all --name=/dev/sda | grep ID_SERIAL # SSD
E: ID_SERIAL=Samsung_SSD_850_EVO_1TB_S21DNXAGB15171J
E: ID_SERIAL_SHORT=S21DNXAGB15171J

$ udevadm info --query=all --name=/dev/sdb | grep ID_SERIAL # SD card in X200
E: ID_SERIAL=RICOH_R5U880FlashMedia_R5U880-00003-0:0
E: ID_SERIAL_SHORT=R5U880-00003

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 sda, sdb etc can move around - and reconfiguring / booting ends up like
a game of musical chairs.

Although if a drive fails and an administrator replaces it by a new drive,
one would have to change the operating-system configuration and reconfigure
(which could potentially download gigabytes of data and take hours).

Not ideal.

Maybe store the original serial number into a file on disk and make Guix
fall back to checking those in a second pass (with a warning).

(Guix could still call the bootloader's installer with the name of the
device file it found out - so it wouldn't be an involved change)

We would still have to check what happens with the hard drive emulators of
CD-ROMs - do these have a unique persistent serial number?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]