LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Linux installed on USB will not boot (http://www.linuxquestions.org/questions/linux-general-1/linux-installed-on-usb-will-not-boot-4175454475/)

Teckno 03-17-2013 11:54 PM

Linux installed on USB will not boot
 
I have spent the last month trying to make a fully installed and persistent (read: not-live) USB install. I have mainly tried Mint, Xubuntu, and Puppy, and I have run into the same issue with each.

I can make a live-USB just fine and my computer boots to it just fine.

I run the installer but tell it to install to another USB flash dive instead of the internal hard drive. Usually I let everything go on one big partition on the flash dive, but I have tried a separate boot partition a couple of times. Everything is going smoothly so far.

Installation completes successfully.

I shut down the computer, remove the live-USB flash drive and boot the system.

Here is where the problem starts:

Left alone, The bios seems to check the flash drive (the light on it flashes). Then it goes straight into Windows on the main HD.

If I go into the bios boot selection menu, it lists the windows boot manager, the internal hard drive, and the USB flash drive. If I select the flash drive with Linux installed the screen goes blank for a second then returns to the boot selection menu.

Let me reiterate, a Live-mode USB flash drive in this same situation works perfectly.

I have tried:

Installing grub from the live-mode USB to the normal install USB. which installed, rechecked and updated without errors.

Copying the entire grub folder from the live-mode USB to the normal install USB.

Double and triple checking the bios settings, but again USB boots fine with live-mode.

Banged head against desk a few times for good measure.


It all ends up the same, no errors, no grub rescue prompts, just no booting.

What am I missing here?

RockDoctor 03-18-2013 09:47 AM

It's Grub's fault, and I seem to run into this problem frequently when trying to create a full install on a flash drive. If I paid better attention, I'd know which distros are problematic.

My last attempt, with PCLinuxOS, which uses legacy grub, worked as expected. Code tags aren't working, but the following may help:

$ cat device.map
(hd0) /dev/sdg
(hd1) /dev/sda


$ cat menu.lst
timeout 65
color black/cyan yellow/cyan
#gfxmenu (hd0,0)/boot/gfxmenu
default 0


title linux
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=linux root=LABEL=Red vmalloc=256M acpi=on
initrd (hd0,0)/boot/initrd.img
<snip>


However, when things don't work, I just install extlinux as the bootloader on the flash drive.

yancek 03-18-2013 10:43 AM

Quote:

Left alone, The bios seems to check the flash drive (the light on it flashes). Then it goes straight into Windows on the main HD
That would be expected behavior if you have the flash drive you installed 'TO' set to first boot priority and did not install Grub to the mbr of that flash drive. Did you install Grub to the mbr of that flash drive? With Mint and Xubuntu, which option for Installation Type did you select? Usually Something Else option will give you more control and you will be able to see more of what is happening during the install.

You indicate you installed Grub from the installation media to the other flash drive. What commands or method did you use? The command below should work after you create the mount point (/mnt/sdc1) and mount that partition. You will have to check to see if sdc is what the device you are trying to install to actually is.


Quote:

sudo grub-install --root-directory=/mnt/sdc1 /dev/sdc

schneidz 03-18-2013 10:51 AM

what type of pc do you have ?

i have an acer revo and when i hit f12 when the bios beeps it gives me a list of drives i can boot from so i can force it to boot from usb when needed.

John VV 03-18-2013 02:17 PM

I have never had any issues doing a "normal " install on a usb2 thumb drive ( mind you usb2 is DEAD SLOW for running a operating system )

burm the iso image to a dvd
plug in the usb thumb drive
pop the dvd into the tray
reboot ( mind you booting from dvd must be enabled )

install to the usb drive
Warning:
pay VERY close attention to where the bootloader is going to be installed
put grub ON THE USB !!!
And not on the computer hard drive

schneidz 03-18-2013 03:46 PM

^ assuming op doesnt have a dvd drive you will need to use 2 usb drives.

the first one will need to be loaded with the live-usb so then when you boot it and run the 'install to harddrive' program you can select the other usb as the drive to install to (maybe pay extra attention to make sure that grub is loaded to the mbr of the usb).

Teckno 03-18-2013 07:03 PM

Quote:

Originally Posted by RockDoctor (Post 4913881)
It's Grub's fault, and I seem to run into this problem frequently when trying to create a full install on a flash drive. If I paid better attention, I'd know which distros are problematic.

My last attempt, with PCLinuxOS, which uses legacy grub, worked as expected. Code tags aren't working, but the following may help:

$ cat device.map
(hd0) /dev/sdg
(hd1) /dev/sda


$ cat menu.lst
timeout 65
color black/cyan yellow/cyan
#gfxmenu (hd0,0)/boot/gfxmenu
default 0


title linux
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=linux root=LABEL=Red vmalloc=256M acpi=on
initrd (hd0,0)/boot/initrd.img
<snip>


However, when things don't work, I just install extlinux as the bootloader on the flash drive.

I think part of the problem is that all are guides I find dealing with these non-standard installs are written for grub legacy, but every distro I come across only has grub 2. I might try that extlinux thing though.

Quote:

Originally Posted by yancek (Post 4913908)
That would be expected behavior if you have the flash drive you installed 'TO' set to first boot priority and did not install Grub to the mbr of that flash drive. Did you install Grub to the mbr of that flash drive? With Mint and Xubuntu, which option for Installation Type did you select? Usually Something Else option will give you more control and you will be able to see more of what is happening during the install.

I always use the 'Something else' option and (assuming the drive is /dev/sdc according to gparted) specify /dev/sdc as the "Device for boot loader installation" and set /dev/sdc1 for /

Quote:

Originally Posted by yancek (Post 4913908)
You indicate you installed Grub from the installation media to the other flash drive. What commands or method did you use? The command below should work after you create the mount point (/mnt/sdc1) and mount that partition. You will have to check to see if sdc is what the device you are trying to install to actually is.

I seem to remember trying that same command before, with the host showing that grub installed without errors, but with the same end result. But Ill try it again and see what happens.

Quote:

Originally Posted by schneidz (Post 4913916)
what type of pc do you have ?

i have an acer revo and when i hit f12 when the bios beeps it gives me a list of drives i can boot from so i can force it to boot from usb when needed.

Fujitsu T902, I can also hit F12 for a list of boot options and the flash drives shows up. But when selected, the screen go blank for a second like its trying but then returns to the menu.

Quote:

Originally Posted by John VV (Post 4914015)
I have never had any issues doing a "normal " install on a usb2 thumb drive ( mind you usb2 is DEAD SLOW for running a operating system )

burm the iso image to a dvd
plug in the usb thumb drive
pop the dvd into the tray
reboot ( mind you booting from dvd must be enabled )

install to the usb drive
Warning:
pay VERY close attention to where the bootloader is going to be installed
put grub ON THE USB !!!
And not on the computer hard drive

Quote:

Originally Posted by schneidz (Post 4914069)
^ assuming op doesnt have a dvd drive you will need to use 2 usb drives.

the first one will need to be loaded with the live-usb so then when you boot it and run the 'install to harddrive' program you can select the other USB as the drive to install to (maybe pay extra attention to make sure that grub is loaded to the mbr of the usb).

I don't have a CD drive (but I can hook one up) but other then the DVD that is the same process I have been doing.

Also, I know USB 2.0 wont be to snappy, but this is a trial run for a USB 3.0 drive that's coming in the mail. But if I could do that ramdrive thing that the Live-mode does (loads the whole OS into RAM on boot) that would be really cool, but first things first.

John VV 03-18-2013 10:15 PM

grub2 had ZERO issues when i put fedora 18 on a usb thumb drive
i even reinstalled it a few times using different settings - to learn the NEW installer

mater of fact
the fedora18 installer automatically picked the usb drive to install grub on

it was one of the easiest usb installs i ever did
PS. i do not recommend fedora to any one who wants a MS windows replacement
seeing as it is a Research and Development TESTING distro

Teckno 03-19-2013 12:46 AM

Quote:

Originally Posted by John VV (Post 4914218)
grub2 had ZERO issues when i put fedora 18 on a usb thumb drive
i even reinstalled it a few times using different settings - to learn the NEW installer

mater of fact
the fedora18 installer automatically picked the usb drive to install grub on

it was one of the easiest USB installs i ever did
PS. i do not recommend fedora to any one who wants a MS windows replacement
seeing as it is a Research and Development TESTING distro

I might give that a shot. At least to see if its grub install will work. I don't really need a complete windows replacement anyway. 99% of what it will be used for is web access and file access from secure network shares. I just want a completely separate, secure, and easily 'disposable' environment.

Teckno 03-19-2013 02:28 PM

Update.

I just tried
Code:

sudo grub-install --root-directory=/mnt/sdc1 /dev/sdc
and
Code:

install-mbr /dev/sdc
Both ran and completed with out errors, but still no change in the situation. No booting.

At this point I'm thinking I need to isolate where the MBR in the Live disk differs from what all the various utility installs. It looks like grub isn't even touched, so I'm thinking its all in the MBR or maybe some sort of partition flag. The Live mode installer drive is diffidently doing something different than the OS Installer in the boot sector

Does the the root directory need the boot flag?

Is there a way to read, check and/or copy the MBR from one drive to another?

How is the Live-mode USB different form a standard install with regards to its boot information?

Teckno 03-20-2013 12:01 AM

Progress!! Sort of...
 
I went into gparted and enabled the boot flag on the root partition (none of the installers did this automatically). That got the computer to boot to the flash drive! However it boots to a blank screen. After the OEM bioes screen it just goes black and hangs there. For once I would like it to give me a damn error message or something, but no, just emtpy black blankness. Any ideas?

dogpatch 03-21-2013 01:50 PM

A year ago i was trying to do this very thing, and got a partial solution by installing AntiX (a scaled-down Debian) onto a usb flash drive. With AntiX i did get a bootable usb flash drive, but had some issues with the shutdown not cleanly unmounting the boot partition, thereby making subsequent boots a problem. (View that thread here.) AntiX also gave me the easiest way to make a live-boot usb, which is what i've been using since.

Mostly i have posted this so as to be subscribed to the thread, because I would also love to know how to skin this particular cat.

Teckno 03-26-2013 11:32 PM

well it looks like its all a UEFI issue. Out of all the distros I tried, OpenSUSE is the only one to properly detect and set up the disk to be bootable from a UEFI system. it set the MBR to GPT and added a separate special efi boot partition. and it worked. only problem after that was that even USB 3.0 is still not fast enough for the OS.


All times are GMT -5. The time now is 09:02 AM.