I have grub2 installed on a usb flash drive.
Along with a minimal installation of ubuntu server 10.04 LTS.
This was created using the debootstrap utility.
However, now I'm trying to make it boot and having trouble getting it to do so.
The thumb drive has a single ext2 primary partition on it and I've copied the bootloader onto it along with the kernel and kernel modules that I need and the grub.d scripts.
I thought since this is a thumb drive I should probably use uuid's instead of device names.
Anyway, when it tries to boot grub2 is throwing it back to the rescue prompt with this error.
error: no such device: 792f......aaee3
So I ran the ls command like so:
grub rescue> ls
(hd0) (hd0,msdos1)
That's confusing. is grub2 assuming the first partition is msdos and not ext2? could that be why it's not starting? I recall seeing somewhere that some bios's treat thumb drives as floppy drives and make the first partition msdos? is that what's going on here?
EDIT:
Interestingly, Ubuntu's make startup disk produced exactly the same error.
However, I'm not 100% on this because when I ran it, it failed to install the bootloader.
So I installed it manually with the command "grub-install /dev/sdb"
Update1:
I discovered that because I created the grub.cfg on another system that it had hd1 in all the entries. So I changed it to hd0.
Now I noticed that I can run these commands at the rescue prompt.
ls (hda,1)/
I decided to try
insmod normal
normal
And sure enough it came up with the menu and I was able to select a menu item and boot linux.
Now, how do I fix the "no such device" error. The uuid of /dev/sda1 is definately what it is.
Update2:
Ok this is really weird. I pulled the flash drive out and plugged it back into my other computer. blkid is saying the following:
/dev/sdb1: LABEL="Transcend" UUID="597D-50B2" TYPE="vfat"
/dev/sda5: UUID="0c81f24b-edeb-4be9-9859-074f3783e618" TYPE="swap"
Firstly, /dev/sda1 is not showing up. Could that be something to do with it being on LVM?
Secondly, the UUID for sdb1 my trancend thumb drive is short? and it's different to what it was earlier. How did that happen? Are UUID's generated once when the filesystem is created or are they re-generated sometimes by some utilities that I may have run?
Update3:
The UUID changed back to normal once I unmounted the drive and remounted it.
Maybe that's a bug in Kubuntu 11.10 (my desktop machine).