From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Drive identifiers Date: Thu, 18 Jan 2018 10:29:14 +0100 Message-ID: <20180118102914.6cb68394@scratchpost.org> References: <87mv1c4kp7.fsf@gnu.org> <86y3kvzypj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec6Vj-0005On-7N for guix-devel@gnu.org; Thu, 18 Jan 2018 04:29:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec6Vf-0003Mm-Tc for guix-devel@gnu.org; Thu, 18 Jan 2018 04:29:27 -0500 In-Reply-To: <86y3kvzypj.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: George myglc2 Clemmer Cc: Guix-devel > 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?