• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Booting from USB drive.  (Read 8058 times)
kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« on: April 10, 2009, 07:34:17 PM »

I wanted to get the root files system running on an external USB hard drive.  I took me a while but I finally figured out how to do this.  Currently it is still loading the kernel from the internal flash.

Try:
Quote

bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/sda1 rootdelay=10
bootcmd=nand read.e 0x800000 0x100000 0x400000; bootm 0x800000


The rootdelay=10 is needed to give the kernel time to start the USB system.  It seems to take a while because loading the MTD system is slow.  You might need a longer delay.  If you start off with it extra long you can see how long it takes for the console to show the USB system active and shorten it back down to what you need.

You also need to make sure your /etc/fstab is mounting the USB drive as root.  See the FAQ on the wiki and do it the same as described for an SDcard except use /dev/sda1.

Mark
« Last Edit: April 10, 2009, 07:43:28 PM by kilowatt » Logged

moshiach
Guest
« Reply #1 on: April 10, 2009, 10:17:50 PM »

You stole my thunder! Smiley  I just now figured out how to get it to make the usb drive the root.  Good Job Smiley
Logged

tap
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #2 on: April 11, 2009, 01:28:28 PM »

If you wish to boot the uImage from the USB Drive rather than inbuilt flash this is what I used:

set bootcmd  'usb start; fatload usb 0:1 0x8000000 uImage.sheeva.20090319;bootm 0x8000000' 
set bootargs  'console=ttyS0,115200 root=/dev/sda2 rootdelay=10'

I have two partitions on my USB Drive, the first one is a FAT partition and contains the uImage file and the second is a ext partition containing the root filesystem

This way I can test custom kernels rather than flash it everytime.
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #3 on: April 11, 2009, 01:57:56 PM »

Nice.  Smiley  Thanks!
Logged

plugit
Global Moderator
Full Member
*****

Karma: 0
Posts: 139



View Profile
« Reply #4 on: April 13, 2009, 08:48:26 AM »

Did you try booting from a uImage on a SD card? Might be interesting to bypass all the internal flash limitations that way.

I'm thinking an 8 gig (or more) SD card for boot/root and an external HD for data might be the way to go, for me.
Logged

tap
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #5 on: April 13, 2009, 10:33:04 AM »

I did try booting uImage from SD, it fails. For USB the interface name is 'usb', it is supposed to be 'mmc' for the sd card however trying to load the uImage using either fatload mmc or ext2load mmc fails so am not sure if the support is there at that stage of the boot. I did read somewhere that like usb start the equivalent command for sd is mmcinit, however I am not able to run it.

Logged

plugit
Global Moderator
Full Member
*****

Karma: 0
Posts: 139



View Profile
« Reply #6 on: April 13, 2009, 11:15:10 AM »

Wonder if the latest-and-greatest uBoot (from Friday) makes any difference... Wonder if there's a changelog.
Logged

egrep
Guest
« Reply #7 on: April 15, 2009, 05:28:15 PM »

You guys make it sound like I should switch over to usb for the boot disk. Had not thought of it much, but it will make kernel tweaks a _lot_ easier, especially if it grows too large. I need to order a couple more of these. In my haste, I have already started using the server. Nothing that cannot be moved, but methinks I need one to tinker with.
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #8 on: April 15, 2009, 05:41:14 PM »

I switched back to booting the kernel from flash verses a USB fat partition.  I found that uboot would not always find the USB drive and would fail to boot sometimes.  It seemed to always boot properly after I hit the reset switch but would fail if I issued shutdown -r now.  This occurred when I used a USB hard drive.  It seemed to be happier when I was using a USB flash stick.

Anyway I played with it for quite a while and determined that it was just too unreliable.

I plan to continue to run my file system on the USB drive.  This has been working great.

Mark
« Last Edit: April 15, 2009, 05:44:36 PM by kilowatt » Logged

plugit
Global Moderator
Full Member
*****

Karma: 0
Posts: 139



View Profile
« Reply #9 on: April 15, 2009, 06:23:50 PM »

I plan to continue to run my file system on the USB drive.  This has been working great.

Agreed. I've given up on SD at the point, too. My uImage runs fine from NAND, and after that I'm on nice, fast, spinning disk.
Logged

moshiach
Guest
« Reply #10 on: April 15, 2009, 06:46:28 PM »

I've done some testing and as far as I can tell the USB chips that are in the plug could definitely use some work.  u-Boot's usb start can sometimes completely fail to see a usb storage device, the console plug can fall out if you breath on it wrong.  When this goes into full production I hope they fix these issues.  Like you guys, I've found putting ht ekernel into nand and booting the root from usb to be the most stable solution.  I've had one test plug running constantly for he last 72 hours without losing it's usb storage so once it's running it seems to stay running.
Logged

Pages: [1]
Print
Jump to: