• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Booting a SheevaPlug from a USB hard-drive  (Read 3320 times)
birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« on: October 30, 2010, 08:04:24 PM »

I currently boot and run my system from an SDHC card.   This has /boot, / and /local (for all my stuff) on it along with swap.

However, I'd now like to run from an external hard-drive over USB - this will be via a hub.  I'm happy to leave /boot on the SDHC card.

But when I set my root= to /dev/sda1 or LABEL=USBRoot the system starts to boot, then says it can't find the root partition.  It lists what it can see, and that is just the SDHC and NAND partitions.

If I run "usb start", "usb tree", etc. at the Marvell>> prompt then it can see the disk and its partition tables.  I have:
Quote
U-Boot 1.1.4 (Jul 19 2009 - 16:03:28) Marvell version 3.4.19

I've searched for some clues on USB booting, and I'm sure that some people are doing it (through a hub?).  Can someone help with these queries?

a) Is it possible to boot with root on a USB drive through a hub? i.e. is anyone doing it?

b) There is a Uboot version from pingtoo that mentions USB hubs.  Does that affects what the kernel sees as it boots? Woudl this help?

c) If b) can help, how do I install that U-boot as default?


Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #1 on: November 01, 2010, 08:40:53 AM »

u-boot function is to load linux kernel in to memory and jump to linux start address, the rest of boot sequence all depend on how linux was setup/configured. so in your case this is a linux problem, u-boot can not help.

After saying that, you have two options for setting up linux to boot from external hard disk from usb port. If your kernel is build with usb-storage module than you can choose to boot kernel with rootdelay command line option to wait for kernel finish usb probe or you can boot with initrd/initramfs and within the initrd/initramfs there is a linuxrc/init script you can modify to load root file system from external disk.

Good luck  Smiley
Logged

Good Luck Smiley

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #2 on: November 01, 2010, 06:07:08 PM »

u-boot function is to load linux kernel in to memory and jump to linux start address, the rest of boot sequence all depend on how linux was setup/configured. so in your case this is a linux problem, u-boot can not help.[
OK.  I wondered whether U-boot was passing on some information about probed file systems.
So what does your testing-u-boot.bin do that the standard u-boot does not?
Quote
If your kernel is build with usb-storage module than you can choose to boot kernel with rootdelay command line option to wait for kernel finish usb probe
It is.  I'm using cxbiker61's latest, and with the file system moiunted there are no usb or file-system related modules (beyond fuse..) loaded.
Quote
or you can boot with initrd/initramfs and within the initrd/initramfs there is a linuxrc/init script you can modify to load root file system from external disk.
I'll take that as Plan B.
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #3 on: November 02, 2010, 07:47:31 AM »

I don't remember what testing-u-boot.bin do any more. however I remember I only produce testing with some patch(es) to u-boot so it can detect there is a hub attached to plug and this is only so u-boot can load kernel from something attached to the hub.

so if you are going to init script route than I have one tip, once the usb-storage module loaded it will take at lease 6 seconds for plug to detect the device. this is tested with SD card with USB reader and USB key directly attach. I guess the hub should be same.

Good luck  Smiley
Logged

Good Luck Smiley

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #4 on: November 03, 2010, 03:58:55 PM »

Good call on the rootdelay option.  Thanks a lot!
With bootargs_root set to "usb start; root=/dev/sda1 rootdelay=10" I've got it booting from the /boot on the SD card, but running everything else off a USB disk.
Quote
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              5160416    946328   3951920  20% /
tmpfs                   256648        12    256636   1% /lib/init/rw
udev                     10240       180     10060   2% /dev
tmpfs                   256648         8    256640   1% /dev/shm
/dev/mmcblk0p1           99649     11989     82515  13% /boot
/dev/sda5             15481360    346148  14348756   3% /local
/dev/sda7            111945968   3189364 103070052   4% /other
[plug]: swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       614908  0       -1
I thought I'd got it running with root=LABEL=USBRoot when testing yesterday, but when I came to finally set that up today it wouldn't work.
I'll let it run for a few days then look into the possibility of putting a ubifs file system on the NAND (well - there already is one there, so that make that simple) and use that for /boot.  Not sure whether I can get Uboot to read a file from ubifs though.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #5 on: November 03, 2010, 06:14:07 PM »

So much for my memory.  My actual notes for what I did yesterday show I set root=/dev/sda1, not root=LABEL=USBRoot.
And as for putting a ubifs file system on NAND and reading from that - I was thinking about using ext2load.  But ubifs is not ext2!!
So if anyone knows of a way to put a file system on the NAND and let Uboot load a file from it, I'd like to know how....then I can dispense with the SD card.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #6 on: December 22, 2010, 05:47:01 PM »

I thought I'd got it running with root=LABEL=USBRoot when testing yesterday..
Turns out that this only works if you are using an initrd image - which I'm not, but I might look into using a generic one (no module loading) so that I can use LABELs.
In the meantime PARTUUID has just made it into the kernel
.
Logged

Pages: [1]
Print
Jump to: