Welcome! Log In Create A New Profile

Advanced

[Pogoplug] Booting with multiple USB devices plugged in

Posted by Clark 
Apologies if this has already been answered before - I looked but didn't find it.

I have Debian Squeeze running on my Pogoplug per the instructions here: http://projects.doozan.com/debian/

My boot device is a thumb drive. When just the thumb drive is plugged in, it boots up great. However, if I have an external USB drive plugged in, it doesn't boot up. If I plug the USB drive in after it is booted up, everything works fine.

How do I tell the bootloader to boot from a specific USB drive?
Re: [Pogoplug] Booting with multiple USB devices plugged in
February 23, 2013 06:17PM
Thanks for the info. Unfortunately, this doesn't seem to be working. When I boot with other USB drives plugged in, I get the following output from netconsole:

U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 5 USB Device(s) found
       scanning bus for storage devices... 3 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)

And it never goes any farther. According to cfdisk, the label on the first primary partition on my thumb drive is indeed "rootfs"

My fw_printenv:
ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_device=0:1
usb_root=/dev/sda1
usb_rootfstype=ext2
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
ethaddr=00:25:31:00:7B:9D
arcNumber=2097
ipaddr=192.168.1.123
serverip=192.168.1.102
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
preboot=run if_netconsole start_netconsole
usb_init=run usb_scan; setenv usb_root LABEL=rootfs
It may be worthwhile noting that my other USB drives are formatted as ext3.
Re: [Pogoplug] Booting with multiple USB devices plugged in
March 01, 2013 03:56PM
If you don't care about rescue system, a quick fix would be: boot with only the system thumb drive, and then at Linux com mandline,

change this
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
to
bootcmd=usb start; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset

When you decide to install rescue system, then "run force_rescue_bootcmd" needs to be put back into bootcmd as before.
Thanks for the suggestion, and as a matter of fact I had already tried that. The boot still hangs - this is what I see...

U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 5 USB Device(s) found
       scanning bus for storage devices... 3 Storage Device(s) found
Device nand0 not found!
Error initializing mtdparts!
Loading file "/boot/uImage" from usb device 0:1 (usbda1)

and it never goes any farther. It booted up normally after removing the hard drives.

If it makes any difference, in addition to being formatted ext3, the hard drives are also 3TB.
Re: [Pogoplug] Booting with multiple USB devices plugged in
March 01, 2013 06:56PM
Looks like it got worse?! do you see this if booting with only the thumb drive?

Device nand0 not found!
Error initializing mtdparts!

Yes, the 3TB drives tend to cause problem booting. Is the Ext3 formatted as whole GPT partition? If it is then it's best to plug it in later, because even though you don't have rootfs on it, I suspect it still causes problem because uBoot must have tried to scan it (current uBoot can not boot with 3TB GPT drive as system drive).

I don't have any 3TB drive. So the above is just an educated guess.
I do not get that error when booting with just the thumb drive.

Is it safe to do "run usb_bootcmd" before "run ubifs_bootcmd" - like so?

bootcmd=usb start; run usb_bootcmd; usb stop; run ubifs_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset
Re: [Pogoplug] Booting with multiple USB devices plugged in
March 01, 2013 08:27PM
Sure, you can the boot order for any these parts, except reset is independent so it should be last.
OK - I've trimmed down bootcmd and usb_scan to attempt to bypass testing for the right drive bu loading /boot/uImage, as that is where it seems to hang. However, that is what is being used to determin usb_device.

I know the label and UUID of the drive I'm looking for - can I have usb_scan check for those instead of attempting to read in uImage? Is blkid available in uboot?

Thanks,
Clark
Re: [Pogoplug] Booting with multiple USB devices plugged in
March 01, 2013 09:36PM
bodhi Wrote:
-------------------------------------------------------
>
> Yes, the 3TB drives tend to cause problem booting.
> Is the Ext3 formatted as whole GPT partition? If
> it is then it's best to plug it in later, because
> even though you don't have rootfs on it, I suspect
> it still causes problem because uBoot must have
> tried to scan it (current uBoot can not boot with
> 3TB GPT drive as system drive).
>

Are they GPT 3TB drives? if they are, your're probably wasting time try to get around the limitation.

Also, the order of recognition for the USB drives are unpredictable in Pogo E02 or Dockstar. Usually, the hard drives get recognized first, so they will be assigned sda1, sdb1,... If all drives are of the same type, usually the drive connected to USB port next to the Ethernet port is most likely to be sda1.
Re: [Pogoplug] Booting with multiple USB devices plugged in
March 02, 2013 12:58AM
Perhaps this thread will give you some ideas to get around this problem:
http://forum.doozan.com/read.php?3,10966
They are GPT partitons. I'm using this thing as a backup server, and I'm hoping to make it able to boot cold without intervention.

I'll check out the link - thanks!
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: