Page 1 of 1

Boot from second usb device?

Posted: Fri Jan 13, 2012 7:06 pm
by johnnygal
Hi,

I have an internally mounted usb flash drive running unr that I want to backup. I was thinking about booting from the external usb port and using dd to make an image to the externally mounted usb drive. I am having problems getting it to boot from the external port though as it always boots from the internal one.

I tried hitting ESC to get to the efi shell and blindly typing:
fs0:
boot.nsh

I also tried this using fs1: instead but neither work.

Is there a way to do this?

Thanks.

Re: Boot from second usb device?

Posted: Fri Jan 13, 2012 11:48 pm
by mickchip
one of the sticks will be sda and the other wil be sdb so you have to have your grub.cfgs set up accordingly

Re: Boot from second usb device?

Posted: Sat Jan 14, 2012 12:48 am
by johnnygal
Hi mickchip,

Thanks for the reply.

Where will the grub.cfg get loaded from? I have not created one unless there is already one on one of the boot devices already?
I have the Stephen Ford UNR OS loaded onto the internal USB stick. I loaded a clean ubuntu onto the external USB port boot.
At no point have I created a grub.cfg. Not even sure if I'm using grub? Think that was removed from the UNR for joggler

I'll do a bit of research on grub.

Cheers.

Re: Boot from second usb device?

Posted: Sat Jan 14, 2012 1:09 am
by mickchip
There will be two partitions on the internal usb stick, one is the efi bootloader,ie grub.efi the other is the UNR file system
when you have it loaded and running can you not see the efi partition called BOOTV13.

Re: Boot from second usb device?

Posted: Sat Jan 14, 2012 11:49 am
by johnnygal
ok, I see the grub.cfg on the internal BOOTV13 slice.
The contents are:
set timeout=0

menuentry "Generic Linux" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda2 acpi=force ro idle=halt
initrd /initrd
}

Is it just a case of changing it to /dev/sdb2 and hd1,1?

Re: Boot from second usb device?

Posted: Sat Jan 14, 2012 4:34 pm
by mickchip
On the joggler, usually the external usb has priority you can leave the (hd0,1) and change sda2 to sdb2.
If you are usiing the same image for the external usb you should be able to tell if that one is loading by the iight
on the stick

Re: Boot from second usb device?

Posted: Sat Jan 14, 2012 6:44 pm
by roobarb!
Oddly enough, I'm just messing with the same thing. I'm using a suggestion by a contributor called Alasdair on my site, which, so long as you don't give your drives all the same names, should work. It will boot a Joggler from a USB device dependant on the drive labels and not their manifestation in /dev/.

For you this should work:

Code: Select all

set timeout=0
menuentry "Generic Linux" {
    search --label --no-floppy --set=boot BOOTV13
    linux ($boot)/vmlinuz root=/dev/disk/by-label/<label of root> acpi=force ro idle=halt
    initrd ($boot)/initrd
}
You just need to change <label of root> to your actual root filesystem label; I don't think you mentioned what it was, but it should work once you've added it.

Re: Boot from second usb device?

Posted: Sat Jan 14, 2012 8:44 pm
by johnnygal
Cheers.
After I edited the grub.cfg it still booted from the internal usb stick. Then I realised I had the external usb stick connected via a hub.

Once I plugged it straight into the side of the joggler, it worked ok and booted from that stick. It even boots from the external one by default, without touching the grub.cfg file - doh!