I'm trying to install Lubuntu to a USB drive, but I'm having a difficult time installing GRUB to the drive. The rest of the install seems to go fine.
This is what I have tried
Went through the normal install process. At the end of the process I got an error
Executing 'grub-install /dev/sdf' failed. This is a fatal error.
It then prompted me to try to reinstall GRUB or continue without a bootloader. I attempted to reinstall, but this seemed to have no effect as I was left with a non-bootable drive.
After the normal install failed I tried
mount /dev/sdf1 /mnt/USB grub-install --force --no-floppy --root-directory=/mnt/USB /dev/sdf
This gave me an error. I can't remember the exact error at the moment, but I can try to run it again later and edit the question.
I then ran Boot-Repair and used the advanced options to select "Reinstall GRUB" on "/dev/sdf". Boot-Repair wouldn't do this on my normal install (I don't know why) and told me I needed to boot into a LiveCD environment.
I did this and Boot-Repair ran, but gave an error. I don't know why, it simply said, "Boot-Repair ran with errors." Nothing more descriptive than that. Needless to say, I still couldn't boot.
I finally tried the following
sudo mount -t ext3 /dev/sdf1 /mnt/USB sudo mount -t proc none /mnt/USB/proc sudo mount -o bind /dev /mnt/USB/dev sudo chroot /mnt/USB /bin/bash grub-install /dev/sdf
This gave no errors and seemed to successfully install GRUB to my USB drive. Unfortunately it still doesn't boot.
When I boot from the drive I get a blank screen with a flashing cursor.
How can I install GRUB to this disk and get it to successfully boot? Moreover, why is the GRUB install failing in the first place?
--root-directory
is correct? Isn't it--boot-directory
? – Samik Jun 18 '12 at 13:30sudo fdisk -l
and indicate which device is your USB drive? If you have a UEFI motherboard, you'd probably want a GPT partition table where the first partition is an EFI partition with your /boot files on it, and your second partition is your root filesystem. Otherwise, you'd want an msdos (MBR) table with a FAT32 partition for /boot or for the entire root filesystem. – Timothy Zorn Dec 20 '16 at 20:59