Linux on Hard Drive Partition, Bootloader on USB Flash Drive

arch linuxboot-loadergrub2usb-drive

How can I use a USB flash drive to boot Linux from a partition on (another) hard drive?

I'm trying to install Linux on an encrypted partition on the hard drive (using LVM on LUKS).

Since /boot must be on a separate, unencrypted partition, I would like to store it on a USB flash drive.

My plan was to install GRUB (2) to the flash drive (/dev/sdb) and boot Linux from it's MBR, or if the drive was unplugged simply boot Windows from the hard drive's (/dev/sda) MBR.


I installed GRUB (2) to /dev/sdb, but when I tried to boot from the flash drive I got the following message:

Grub Loading

After a couple of seconds I got an additional message:

Read Error

For testing purposes, I tried to delete the contents of /boot, and I got the same message after booting again from the flash drive.


PARTITIONING DETAILS

/dev/sda (Hard Drive):

MBR: Windows Bootloader
/dev/sda1 - Windows System Partition
/dev/sda2 - Windows Boot Partition
/dev/sda3 - Windows Data Partition
/dev/sda4 - Linux partition

/dev/sdb (USB Flash Drive):

MBR: GRUB
/dev/sdb1 - Linux /boot Partition

GRUB DETAILS

/etc/default/grub:

GRUB_CMDLINE_LINUX="cryptdevice=/dev/disk/by-uuid/$SDA4_UUID:vg root=/dev/mapper/vg-root resume=/dev/mapper/vg-swap cryptkey=/dev/disk/by-uuid/$SDB1_UUID:ext2:/key"
..
GRUB_DISABLE_LINUX_UUID=true

Installation command

grub-install --target=i386-pc --recheck /dev/sdb

I'm using Arch Linux.

Best Answer

Have you tried

grub-install --target=i386-pc --recheck /dev/sdb1

Note the /dev/sdb1 which appears to be your USB device.

MBR: GRUB
/dev/sdb1 - Linux /boot Partition

Maybe try this :

title Start Ubuntu from USB DISK (PC)
root (cd)
kernel /boot/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper noprompt cdrom-detect/try-usb=true persistent
initrd /boot/initrd.lz
boot
Related Question