-1

There is a way to indicate to grub to install on a device MBR by UUID instead of using /dev/sdX ? I'm setting a external eSATA hard disk with NixOS, and obviusly, the hard disk not would be always the same /dev/sdX device ?

I see that I can config it with boot.loader.grub.device = "/dev/sdX", but could set it to something like "/dev/disk/by-uuid/...." ??

Zardoz89
  • 590
  • 5
  • 17

1 Answers1

-1

currently there is no support for what you want in nixos.

see the respective source code here: https://github.com/NixOS/nixpkgs/blob/release-15.09/nixos/modules/system/boot/loader/grub/grub.nix

however, you should be able to use:

boot.loader.grub.device = "/dev/mydisk"

but you will need a udev-ruleset like this:

services.udev.extraRules = ''
  #Bus 001 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
  ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE="666", SYMLINK+="ttyUSB-odroid-u3-1"
  #Bus 003 Device 055: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
  ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="666", SYMLINK+="ttyUSB-odroid-u3-2"
  # Bus 003 Device 057: ID 054c:0268 Sony Corp. Batoh Device / PlayStation 3 Controller
  ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0268", SUBSYSTEMS=="usb", ACTION=="add", MODE="0660", GROUP="users"
'';

but for your external harddrive of course. just by using the symlink feature.