Boot from second usb device?

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
User avatar
johnnygal
Posts: 148
Joined: Tue Oct 11, 2011 1:07 am
Location: Stockport, UK

Boot from second usb device?

Post 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.
User avatar
mickchip
Posts: 408
Joined: Thu Apr 14, 2011 7:06 am
Location: Handforth, Cheshire, UK

Re: Boot from second usb device?

Post 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
Jogglermaniac
User avatar
johnnygal
Posts: 148
Joined: Tue Oct 11, 2011 1:07 am
Location: Stockport, UK

Re: Boot from second usb device?

Post 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.
User avatar
mickchip
Posts: 408
Joined: Thu Apr 14, 2011 7:06 am
Location: Handforth, Cheshire, UK

Re: Boot from second usb device?

Post 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.
Jogglermaniac
User avatar
johnnygal
Posts: 148
Joined: Tue Oct 11, 2011 1:07 am
Location: Stockport, UK

Re: Boot from second usb device?

Post 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?
User avatar
mickchip
Posts: 408
Joined: Thu Apr 14, 2011 7:06 am
Location: Handforth, Cheshire, UK

Re: Boot from second usb device?

Post 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
Jogglermaniac
User avatar
roobarb!
Posts: 1772
Joined: Sat Mar 05, 2011 1:30 pm
Location: Salford, UK
Contact:

Re: Boot from second usb device?

Post 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.
BirdsLikeWires - Get fresh builds of Debian Bullseye, Bookworm, and Trixie for OpenFrame with the latest 5.10, 6.1, and 6.12 kernels! 8-)
User avatar
johnnygal
Posts: 148
Joined: Tue Oct 11, 2011 1:07 am
Location: Stockport, UK

Re: Boot from second usb device?

Post 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!
Post Reply