You are not logged in.

#1 2017-08-29 18:06:59

euclid211
Member
Registered: 2017-08-24
Posts: 6

[Solved] Dell XPS 15 9560 bios confused by similar grub instances

I have a Dell XPS 15 9560 running arch, booting from grub with encrypted boot sector using instructions on the wiki. It boots from a .efi file on the EFI system partition of the hard drive, in /EFI/boot/grubx64.efi. (I had intended to change it to bootx64.efi, but apparently forgot).

I have an older Dell Latitude laptop which also has an encrypted boot sector setup, but is additionally booted from a USB drive, using /EFI/boot/bootx64.efi on the USB drive's EFI system partition. The kernel and system files are on the latitude's hard drive; the USB contains just the EFI partition, along with an ext4 partition which is used for transferring data from machine to machine.

If the USB drive happens to be in the XPS 15 when it is powered on, the machine goes directly to memory test (which is what it would do if there is no bootable media present), and will not boot even after the USB drive is removed and the machine is rebooted. Examination of the BIOS reveals that the hard drive's NVRAM entry has been replaced by that of the USB drive. I can get the XPS 15 to boot properly again by deleting the boot entry and manually creating another one, or by booting from the liveCD and reinstalling the entry from there.

This all is of course easily fixable (use a larger variety of EFI directory names), but I'm left wondering:

1) Shouldn't the USB drive boot process happen, at least getting to grub rescue (when I try to boot from a hard drive that isn't there)?
2) Is this "normal" behavior, or is my BIOS buggy?
3) Is it generally considered dangerous to use the same bootloader-id on different drives?

Last edited by euclid211 (2017-09-07 01:04:26)

Offline

#2 2017-09-05 18:19:36

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [Solved] Dell XPS 15 9560 bios confused by similar grub instances

I would think you should have the ESP on the hard drive only. That way the drive that UEFI always uses the same drive to launch what ever is desired from. I haven't run into this personally but I have seen others say they have trouble with boot entries being some how dropped when an external drive with boot targets on it are removed. Also, what is your boot order in UEFI? I have the boot order that shows in the UEFI NVRAM variables and I have the old style boot order that you configure in the UEFI "bios". For example I have the old style boot order set to CD/DVD drive, then USB, then HDD. All of my boot entries that efibootmgr reports are those I configure on the HDD but if I want to boot from the optical drive or USB I just have to insert one and re-boot. I don't have to set the UEFI variable for boot next to the optical drive or USB. That would be more secure but this system never travels anyway.


Simple and Open

Offline

#3 2017-09-06 08:50:57

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [Solved] Dell XPS 15 9560 bios confused by similar grub instances

@Blasphemist The problem comes after plugging a USB bootable key. The ability to boot various devices is desirable and of course, in this case, you have two EFI partitions when you boot (one the key and the "main" one on the hard disk). You can't avoid that; if you remove the EFI partition on the USB key, it won't be bootable, at least not in a generic way on an arbitrary computer. For example, if you plug the Archlinux install USB key on a machine that boots an arbitrary OS (for example Windows), you have two EFI partitions when the key is plugged in.

@euclid211 Your problem could most probably be solved by adjusting some settings in the UEFI firmware. You can probably insist to put the hard disk or the boot entry you have added on top of the priority list. Booting from another media like a USB key is most probably handled by pressing a special key during the boot process which let you choose the device you boot, this key is often F8 or F12 but can be another Fn key or ESC, DEL... Just try a little. The problem arises because there is a confusion with the boot order variables. These variables work well for a fixed machine where the hardware is always the same. They do not manage USB keys that you can optionally plug very well. Usually, UEFI firmware dealt with that by adding a Boot variable on the fly when it detects a bootable key but that can cause confusion. Usually, this behavior can be controlled in the firmware but I agree this is not always completely clear.

Last edited by olive (2017-09-06 08:57:23)

Offline

#4 2017-09-07 01:03:08

euclid211
Member
Registered: 2017-08-24
Posts: 6

Re: [Solved] Dell XPS 15 9560 bios confused by similar grub instances

Thanks for your replies. This is not my favorite BIOS as far as boot options go. On the "Legacy" (MBR) side, I get the usual orderable list of options which allow me to set the order in which external devices are tried. I have Legacy Boot disabled, and on the UEFI side there is exactly one entry (for the hard drive). I've deleted and manually re-added that entry in the BIOS, choosing a description other than "boot" so that it does not get overwritten. This seems to work and I can alter my grub configuration files to avoid recreating the problem next time I regenerate grub's configuration. There's an option in another menu (I think it's the USB menu), to enable USB boot, which is currently enabled, but the BIOS provides no way to control the boot order as near as I can tell. Creating a manual entry provides you the opportunity to enter or edit a slightly cryptic descriptor string; it may be that you can enter something which corresponds to "any bootable USB media", but I haven't had a chance to look into this. My memory is that other Dell BIOSes give you more control over such things. Oh well.

Offline

#5 2017-09-07 07:38:06

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [Solved] Dell XPS 15 9560 bios confused by similar grub instances

@euclid211. It would be difficult to answer; unless you find someone who has exactly the same laptop. Usually trying a few thing get the desired result. I assume you know how to add a boot entry with efibootmgr. Add a boot entry to grub (if it's what you use) and see how the firmware handles it. Maybe you can just disable USB boot, assuming you don't boot from USB very often (you can, of course, reenable it if needed). Note that if you use refind, it is able to auto detect plugged in USB keys on the fly and boot from the key. It is usually a good idea to install refind to the hard disk and rely on its menu to boot what you like, the main kernel, USB keys, etc... Unlike grub refind autodect what it needs to detect at boot time, with no need to update a configuration file each time something change.

Last edited by olive (2017-09-07 07:40:09)

Offline

#6 2017-09-07 18:56:48

euclid211
Member
Registered: 2017-08-24
Posts: 6

Re: [Solved] Dell XPS 15 9560 bios confused by similar grub instances

Thanks. I'm using grub in order to encrypt /boot, but increasing finding the disadvantages to outweigh the (nebulous) advantages. I will look at refind once I have an opportunity to repartition the drives.

Offline

Board footer

Powered by FluxBB