Grub can't boot a gpt external USB drive. Tells me device not found.
I bought a new external USB disk drive to put various
distros on to play with and try out. I didn't think about what I was buying because Linux usually handles anything. It turned out to be a gpt drive, something I've never had to deal with before. It's a 4 terabyte drive. Here's what my linuxfromscratch-8.3 says it is: Code:
terry [ ~ ]$lsusb partitions. 4 that I formatted into ext4 and a smaller 100 megabyte partition in case I needed some boot stuff. Here's what fdisk shows on the drive: Code:
Disk /dev/sdb: 3.7 TiB, 4000787029504 bytes, 7814037167 sectors I installed a distro on sdb1, MX Linux to try out. No problems there as far as I could tell. It seemed to install fine from the dvd. Here's what /boot on the drive shows: Code:
terry [ ~ ]$ ls /mnt/gpt1/boot I do the grub2 stuff from my Ubuntu system on sda1 because that's where this current incarnation of various Linux distros started. From Ubuntu I ran "update-grub" so it could pick up the new MX Linux distro and add it to the menu of bootable systems. It saw the MX I installed to sdb1 and added it to the grub menu. Here's what it says is there: Code:
menuentry 'MX 18.3 Continuum (18.3) (on /dev/sdb1)' --class mx --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-1d88c0e8-9d75-4832-896c-3a06cdbc795a' { grub boot menu I am told that the device is not found and it refers to the uuid 1d88c0e8-9d75-4832-896c-3a06cdbc795a. I don't understand. When "update-grub" was run it certainly saw this uuid because it wrote it in grub.cfg.I also get messages that the partition is not found and "kernel must be loaded first" I suspect this is related to the fact that the disk is gpt and needs some special magic but I don't know. I'm fairly knowledgeable with Linux having used it for years but this one has me stumped. Can anyone help? |
gpt disks need a partition for the boot code to be installed into. For BIOS you need a BIOS_BOOT partition rather than using the "spare" sectors after the MBR.
For UEFI, you need a EFI partition for the loader code. |
Grub maybe switching the boot order when the usb drive is plugged, where the usb is hd0 and the internal drive is hd1. My system does this when a usb is plugged in and that is where the search uuid stuff comes into play in the grub menus. Maybe changing set root=(hd1,1) to set root=(hd0,1) will work.
use blkid /dev/sdb to check the uuids of the usb partitions. |
Quote:
Code:
/dev/sdb5 2048 206847 204800 100M BIOS boot |
if you are going to boot a usb OS, I'd suggest you install your grub on that drive as well, no matter if it is UEFI or MBR. that way all you got a do is point your BIOS to that drive and its grub will do the rest.
Just keep in mind when you update your grub it is going to pick up every OS that it knows and add it to its listings as well. |
Quote:
and the partition always remains hd1,1 |
what I was suggesting was at the grub menu when you first boot, press e to edit the mx menu entry and change to root=(hd0,1), to see if that works.
post the output of Code:
sudo blkid /dev/sdb |
Quote:
Code:
terry [ ~ ]$ sudo blkid /dev/sdb |
try: set root=(hd0) or (hd1)
and or search --no-floppy --fs-uuid --set=root 1d88c0e8-9d75-4832-896c-3a06cdbc795a to Code:
search --no-floppy --fs-uuid --set= e79fd96e-32f6-41b9-9471-36742ab20de6 |
Quote:
message. Grub boot seems to not see the hardware in the first place, let alone the file systems on it. Which doesn't make sense to me because all the tools for looking at devices see the drive and its partitions. |
at the grub menu press c for a grub prompt then
Code:
ls |
Quote:
Quote:
|
You should probably load the ehci host controller interface module manually in the grub entries.
insmod ehci xhci is used for USB3.0 but doesn't appear to be supported by grub2 yet. The ehci interface is older but many motherboards have a ehci compatibility mode for xhci controllers. Unfortunately many new motherboards are xhci only meaning there isn't any grub support. Quote:
Quote:
|
The following page explains the grub2 (lack of) support for xhci and USB3.0
https://unix.stackexchange.com/quest...ie-card/323080 Linux itself has had xhci support for quite some time. My Gigabyte Z68 MB is from 2011 with xhci USB3.0 controllers Code:
$ lspci -k |
Quote:
There is a large difference between the grub2 configuration tools which run on Linux and the grub2 bootloader itself. Linux has xhci support. Grub2 does not. The following is quite wrong. /dev/sdb is the drive itself. Code:
$ sudo blkid /dev/sdb MX Linux is on /dev/sdb1 Code:
menuentry 'MX 18.3 Continuum (18.3) (on /dev/sdb1)' Quote:
|
All times are GMT -5. The time now is 05:21 PM. |