On Ubuntu 16.04, when installing Ubuntu to an nvme drive, Ubiquity fails to install grub. In ubiquity/misc.py the function default_grub targets /dev/nvme0 instead of /dev/nvme0n1, which is the real name of the device.
For single drive scenarios, this can be fixed by filtering out nvme devices from the regex line:
old:
target = re.sub(r'(/dev/(cciss|ida)/c[0-9]d[0-9]|/dev/[a-z]+).*', r'\1', target)
fixed:
target = re.sub(r'(/dev/(cciss|ida)/c[0-9]d[0-9]|/dev/(?!nvme)[a-z]+).*', r'\1', target)
For multi-drive scenarios, Ubiquity behaves inconsistently between bios and uefi modes. In UEFI mode, default_grub behaves like the single drive scenario and only sees the usb media (which it ignores) and the nvme drive.
In BIOS mode, there is a device listed at /dev/sda before the nvme drive. Ubiquity then tries to put grub on /dev/sda regardless that we're installing to the nvme drive. Grub then fails to install on /dev/sda.
This makes Ubuntu a pain to reinstall for our customers if they have an nvme drive.
On Ubuntu 16.04, when installing Ubuntu to an nvme drive, Ubiquity fails to install grub. In ubiquity/misc.py the function default_grub targets /dev/nvme0 instead of /dev/nvme0n1, which is the real name of the device.
For single drive scenarios, this can be fixed by filtering out nvme devices from the regex line: r'(/dev/ (cciss| ida)/c[ 0-9]d[0- 9]|/dev/ [a-z]+) .*',
r'\1', target) r'(/dev/ (cciss| ida)/c[ 0-9]d[0- 9]|/dev/ (?!nvme) [a-z]+) .*',
r'\1', target)
old:
target = re.sub(
fixed:
target = re.sub(
For multi-drive scenarios, Ubiquity behaves inconsistently between bios and uefi modes. In UEFI mode, default_grub behaves like the single drive scenario and only sees the usb media (which it ignores) and the nvme drive.
In BIOS mode, there is a device listed at /dev/sda before the nvme drive. Ubiquity then tries to put grub on /dev/sda regardless that we're installing to the nvme drive. Grub then fails to install on /dev/sda.
This makes Ubuntu a pain to reinstall for our customers if they have an nvme drive.