Booting entirely off an external USB device
From ComputingPlugs
The simplest way of adding additional storage is to plug an external USB device into the Sheeva Plug. You can then mount the external storage as some mount point in the default filesystem. You may go a bit further and change /etc/fstab so that it mounts the external storage on startup. However, with a bit more work, you can boot the kernel and the filesystem off the external device instead. There are many advantages to doing that.
- Keep the original kernel/filesystem in NAND flash untouched as a back up.
- Mounting the external device as a mount point means that the bulk of your storage is located in a sub directory. It may be fine for the most part, but if you plan on apt-get'ting a lot of software then it can fill up the / directory quickly.
- Accessing an external hard drive is very fast, take a look at the performance numbers here.
- Updating the kernel is very easy. The boot partition is mounted at /boot like most desktop Ubuntu.
- Backup/duplicate your Sheeva Plug's filesystem is a snap. Simply plug the external storage into another computer and just tar everything up.
You can use any USB external storage device, this guide is generic enough to handle both USB flash storage or disk storage. The process of booting off the SD memory card is basically the same with the exception of the device nodes (ex. SD mounts to /dev/mmcblk0p1). You can find detail instructions on booting off a SD card here.
Contents |
Prep your external storage
Boot the Sheeva plug to prompt and plug in your external storage. The Sheeva Plug should be able to recognize the device and create a new mount point on /dev/sda. Then you need to delete any old partitions on the external storage and create new ones. To do that, you use fdisk, which already exist in the default filesystem. Create 2 partions, the first holds the kernel images (/boot) and the second the filesystem(/). Right now is a good time to determine if you want a swap space. My suggestion is use swap only if you are using a disk storage. Flash base storage is slower (unless you buy the expensive models), and that you may run into the problem of wearing down the flash prematurely. As an example, here is my partition table with 3 partitions.
Command (m for help): p Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x41ffc810 Device Boot Start End Blocks Id System /dev/sda1 1 4 32098+ 6 FAT16 /dev/sda2 5 38800 311628870 83 Linux /dev/sda3 38801 38913 907672+ 82 Linux swap / Solaris
I chose to make my swap space as sda3 because I want to be option to move the data to a flash base device. With the swap on sda3 all my mount points in fstab remains the same. Also note that sda1 is type FAT16. This is because U-Boot has a build-in fatload command to load files from a FAT base partition. U-Boot also has a ext2load as well but I have not tried it. So if you're worry about Micro$oft knocking on your door about FAT royalties, you may want to look into using ext2 instead.
After the partition tables are created, format each partition with mkfs.vfat and mkfs.ext3. You can use any other filesystem type if you wish (like ext4), but make sure that the kernel you're running has the filesystem type build into the kernel and not as a module. The default kernel has ext3 build in so that is what I used.
Problems with using vfat on /sda1
The original kernel that cames with the Sheeva Plug, as well as the default settings of the orion and mainline kernel does not have vfat support compiled into the kernel. This means that you can't use the Sheeva Plug to mount the vfat partition. Earlier I had talked about using ext2 instead of vfat to avoid Micro$oft royalties. So I decided to change my /dev/sda1 to use ext2 instead. The procedure is still the same except the partition table now looks like:
Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x41ffc810 Device Boot Start End Blocks Id System /dev/sda1 1 4 32098+ 83 Linux /dev/sda2 5 38800 311628870 83 Linux /dev/sda3 38801 38913 907672+ 82 Linux swap / Solaris
Now instead of formating /dev/sda1 with mkfs.vfat, use mkfs.ext2.
Copy over the default kernel and filesystem
The next thing to do is to copy the original kernel and filesystem to the external storage. Make some temporary directories.
mkdir /mnt/mtdroot mkdir /mnt/sda1 mkdir /mnt/sda2
Mount the filesystems
mount /dev/mtdblock1 /mnt/mtdroot mount /dev/sda1 /mnt/sda1 mount /dev/sda2 /mnt/sda2
The first line is to mount the root filesystem (/dev/mtdblock1) from NAND flash to /dev/mtdroot. It is possible that the root filesystem is at another location other than /dev/mtdblock1. This happens if you burn a new image into the flash or by changing the default bootcmd in U-Boot. You can tell the root filesystem's mount point by with cat /proc/mtd:
$ cat /proc/mtd dev: size erasesize name mtd0: 00100000 00020000 "u-boot" mtd1: 00400000 00020000 "uImage" mtd2: 1fb00000 00020000 "root"
root is listed as mtd2. So the correct mount point in this case is /dev/mtdblock2. Therefore, change the first line of the mount instructions from
mount /dev/mtdblock1 /mnt/mtdroot
to
mount /dev/mtdblock2 /mnt/mtdroot
Next copy the filesystem from the NAND flash to the external storage.
cp -av /mnt/mtdroot/. /mnt/sda2
Finally, you need to copy the kernel(uImage) to /mnt/sda1. You can get a copy of the original uImage from Marvell's LSP package here. I also have just the uImage itself here, don't forget to unzip the file! Then copy the uImage to sda1.
cp uImage /mnt/sda1
Edit fstab to use sda1
You need to edit /mnt/sda2/etc/fstab so that it knows about the new location of the root filesystem. Replace the line:
rootfs / rootfs rw 0 0
with these lines:
/dev/sda2 / ext3 rw 0 0 /dev/sda1 /boot vfat rw 0 0
Here's what the fstab should look like after all the changes:
# UNCONFIGURED FSTAB FOR BASE SYSTEM tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0 /proc /proc proc rw,noexec,nosuid,nodev 0 0 sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0 varrun /var/run tmpfs rw,nosuid,mode=0755 0 0 varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0 udev /dev tmpfs rw,mode=0755 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0 /dev/sda2 / ext3 rw 0 0 /dev/sda1 /boot vfat rw 0 0 # tmpfs /var/cache/apt tmpfs defaults,noatime
You may notice that I commented out the last line tmpfs /var/cache/apt tmpfs defaults, noatime. This is to fix the apt-get problem. The apt-get problem is explained here.
You're now done with the prep, reboot the Sheeva Plug and make the necessary changes to U-Boot.
Changes to U-Boot
You need to make changes to U-Boot so that it loads the kernel from the external devices instead of NAND flash. Connect to the serial console and reboot the Sheeva Plug. Stop the U-boot boot process by pressing any key when it prints
Hit any key to stop autoboot
You should make a backup of the boot arguments so that it is easy to go back if it doesn't work. Type the following at the Marvell prompt:
setenv bootargs_nand $(bootargs) setenv bootcmd_nand $(bootcmd) saveenv
Then, write the new arguments to boot from the external storage:
setenv bootargs 'console=ttyS0,115200 root=/dev/sda2 rootdelay=10 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw' setenv bootcmd 'usb start; fatload usb 0:1 0x8000000 uImage.sheeva.040309; bootm 0x8000000; reset' saveenv
In the first line, the rootdelay option is there to allow the kernel to scan the USB system and create the necessary mount points. Without it, the kernel will be unable to mount the root filesystem and you will end up with a kernel panic. The value 10 depends on the speed of the scan and may have to be adjusted for your particular system.
In the second line, you may need to change uImage.sheeva.040309 to whatever name your uImage is called. Also on the second line you may notice a reset at the end. This is a hack to fix the problem with U-Boot where every other boot it is unable to properly scan the USB system if you have a disk base storage. The error is a timeout when it tries load the uImage from the first partition. The reset is there so that if it failed to get the uImage, it will reboot and try again.
If you used ext2 instead of vfat for the /dev/sda1 partition, replace the line:
setenv bootcmd 'usb start; fatload usb 0:1 0x8000000 uImage.sheeva.040309; bootm 0x8000000; reset'
with this:
setenv bootcmd 'usb start; ext2load usb 0:1 0x8000000 /uImage.sheeva.040309; bootm 0x8000000; reset'
Be careful with the forward slash "/" in front of uImage.sheeva.040309. You have to reference files in ext2 with the full pathnames. When in doubt, use the command extls to list the files in the ext2 partition.
If you are using the Orion or Mainline kernel, you will need to add the following variables to U-Boot.
setenv arcNumber 2097 setenv mainlineLinux yes saveenv
Reboot the system and the Sheeva Plug should now use the external storage as its root.
|
|
Click here to leave a comment
Did you find this page useful? |
||


May 18 2009 2:12 pm
Please keep comments clean and constructive. Inappropriate comments will be removed. Thank you.
May 23 2009 8:32 am
What size does the boot partition need to be? Is block size always the same?
May 23 2009 9:06 am
It doesn't have to be very big. The boot partition is really only to hold kernel images and each image is about 2.5Mbytes. I set mines to 32Mbytes so I can hold about 10 different images. I'm pretty sure linux defines a block size as 1K bytes. At least, I've ever only ran across 1K block sizes.
May 26 2009 2:54 am
Where it says to change the fstab file, the path is wrong. Should be /mnt/sda2/etc/fstab (the original text does not contain the etc directory).
May 26 2009 10:54 am
Good catch, I've fixed the statement. Thanks.
Jun 01 2009 6:22 am
What does "usb start" do? I can't find it in the uboot docs. Thanks, Ian
Jun 01 2009 9:14 am
I think "usb start" was something Marvell did for the sheeva plug. It starts the usb subsystem and scans the bus for usb devices. There are other "usb xxxx" commands you can do to see what devices are available. I think you can get the help by typing "help usb" on the uboot prompt.
Jun 01 2009 10:30 am
Thanks, I'll try it when I get home.
Jun 01 2009 3:52 pm
I have a Pogoplug and it seems that the uboot is different. There is no "help usb" and usb alone says "Unknown command 'usb' - try 'help'". I'm thinking that I want to update uboot but it may break the Pogoplug application.
Jun 01 2009 9:37 pm
hmm...thats too bad. I guess you can't boot the kernel off a usb device. You can still mount the usb device as a root filesystem. You'll have to boot the kernel off the flash first though.
Jun 02 2009 12:41 am
I managed to mount the root filesystem from the usb. The pogoplug uboot does not have a fatload but it does have an ext2load. I have the usb formated as ext2 for the root filesystem. I will try to load the kernel.
Jun 02 2009 8:46 am
it's odd that uboot has ext2load but not fatload. Most uboots I came across has it the other way around. Don't forget to drop a line if it works, I'm sure lots of people would be interested in the results.
Jun 03 2009 5:40 am
I've had no luck booting the kernel from usb using ext2load. Do you happen to know if there is a way to save the uboot image from nand to a file? Or maybe I could copy the code from nand flash to an unused part of nand flash? I would like to upgrade uboot so that I can use your method of booting from usb but I need the safety net.
Jun 03 2009 8:43 am
That make sense, because you can't load anything for an uninitialized USB device. I think you can copy flash from one part to another with cp. The command, I think, is "cp ". As far as a recovery method, I think the best bet is to use the sheevaplug installer from Marvell. It is suppose to be a tool you can use to reflash the entire flash, uboot and all. Here's the link: http://www.plugcomputer.org/plugwiki/index.php/SheevaPlug_Installer. I don't know how well it works because I've never tried it.
Jun 03 2009 9:23 am
I was planning on trying out the SheevaPlug_Installer after figuring out how to save the pogoplug uboot. I already have copies of the kernel and file system from Pogoplug. So far they haven't supplied the uboot image ... I'm now looking at the uboot manual and I'm enjoying the learning experience.
Jun 05 2009 6:16 am
Well I gave up waiting for the uboot image from Pogoplug. I decided to 'bubt' the uboot image from here :
http://plugcomputer.org/plugforum/index.php?action=dlattach;topic=183.0;attach=3
After all what's the worst that could happen?
Bubt worked just fine and loaded the new uboot. I re-entered all of my environment parameters. Now when I boot it hangs after loading the kernel. I've tried booting the kernel from nand and tftp with the root file system on nand and USB using the environment parameters that worked with the original uboot. All hang after "done, booting the kernel."
I was not expecting the uboot update to prevent previous successful booting parameters to fail ...
So next I will try the SheevaPlug_Installer.Jun 05 2009 10:46 am
A little confused. You're moving the rootfs to usb (I did something similar using SD and ext3 there), but the kernel is still on flash disk isn't it ?
I really like the idea of running off SD or USB and having the built-in flash as a rescue environment, but once you build up your internal disk with custom kernels etc. and copy the rootfs over, your SSD and SD/USB disk can get out of synch.
Is there a pointer to how to move it "all" to SD/USB so that the flash disk contents, other than the UBoot settings, can remain unaltered ?Jun 05 2009 9:41 pm
Ian, are you booting the new orion or mainline kernel image. Did you remember to add the environment variable arcNumber and mainineLinux because it sounds like thats the problem that caused the boot to hang when uboot pass control to the kernel
Jun 05 2009 9:44 pm
Vince, I don't understand what you mean by out of sync. Both the kernel image and rootfs are on the usb disk so there is nothing to be out of sync. The kernel image that's in nand flash is still there but uboot no longer uses that image, it uses the one from the usb disk. If you move both the kernel image and rootfs from the nand flash to usb, then the nand flash serves as a backup in case something goes wrong.
Jun 06 2009 4:06 am
Kenny, I've tried booting the original pogoplug kernel and the 2.6.22.18 kernel which do not need the environment variable arcNumber and mainineLinux. The last time I had the hang it was because I wasn't passing the console args. It still could be something with that.
Jun 09 2009 4:17 pm
Pogoplug posted their uboot image, I installed it with bubt and now, magically, the kernel boots. Yeah! So I'm back to where I was on June 2nd but now I have the safety net and can get more adventurous. BTW I haven't been able to get the SheevaPlug_Installer to work. The usb to serial cable I have is based on the Prolific 2303 chip and not the ftdi2232 chip and I haven't been able to convince openOCD to recognize it. If you have any tricks up your sleeve on that front let me know.
Jun 09 2009 11:02 pm
Thanks for the instructions, followed them and my debian is working greatly from usb disk. The lack of iptables in the marvell stock kernel is bothering me, so is it possible to easily upgrade newer kernel (this one http://plugcomputer.org/plugforum/index.php?topic=377.0) without breaking the boot process ? Should newer kernel work when adding these to enviromental variables ?
setenv arcNumber 2097 setenv mainlineLinux yes
Can you post instructions for upgrading kernel ?Jun 10 2009 11:07 pm
Ian - glad to hear you got it to work again with bubt. I haven't done too much work with uboot or openocd because I can't really take down the sheeva plug for too long now that I'm running computingplugs.com on it. But if I come across anything I'll pass along the info.
Sillis - I have a page dedicated to compiling your own kernel. Check out http://computingplugs.com/index.php/Building_a_custom_kernel. The new kernel defintely works when you add in the correct environment variables to uboot, I'm living proof.
Jun 12 2009 3:39 pm
Thanks for posting this guide. However I have a very weird error occurring. When it attempts to run the command USB Start it hangs when scanning the bus for storage devices. It has a T instead of a number of devices. After a while it decides it has wasted enough time and then moves on the try and boot the image. It then breaks and says the magic number is bad. Is there anyway to delay the USB boot time or try a more esoteric boot?
Jun 13 2009 7:44 am
I had this same problem. Make sure that you are typing in the uBoot configuration lines, instead of copy/pasting them, if you have different settings than the ones posted here. That basically meant, for me, it was looking for /dev/sda2 as an ext2 volume, when it was swap, because I setup both the uImage and the rootfs on the same partition (sda1).
Jun 13 2009 1:58 pm
I get the "T" sometimes when I'm using a usb harddrive (never with a usb flash drive). I notice that the usb scan will work after a hard power cycle, and it will fail if you do a reset from Linux or uboot. But then, if you reset again after it fail it will scan correctly. So the way I hacked around the problem is to have a "reset" command at the end of the boot command so that it'll reset the sheevaplug if it fails to scan the usb devices.
Jul 16 2009 7:12 pm
I discovered that you need to change mtdparts=nand_mtd to mtdparts=orion_nand if you are using a more recent uImage such as the one that comes the alpha 6 installer. Thanks for the hints to get going.
Jul 26 2009 5:46 am
I'd really like to do this but am having trouble following these instructions. I need further help with fdisk and connecting to the serial console. What are all the steps involved with fdisk and mkfs? When I try to partition the disk the table reads "/dev/sda1p1" not /dev/sda1" and I don't see any changes when I use mkfs. I'm using a mac and have read about using screen to connect via serial console but I can't see the plug as a serial device at all. Any help appreciated.
Jul 26 2009 5:14 pm
hmm...did you plug the external disk to your mac and tried to partition it there? The instructions I wrote assumes you to do all the partitioning on the sheevaplug.
As far as getting serial to work on the mac, here a link to some instructions:
http://plugcomputer.org/plugforum/index.php?topic=34.0
Aug 15 2009 8:19 pm
I'm trying to boot off an sdcard. I was able to follow all the instructions (adjusting for my device: /dev/mmcblk0p1,2).
I'm getting the error below. I wonder if I need to change the bootcmd 'usb start' to something else for an sdcard?
U-Boot 1.1.4 (Mar 19 2009 - 16:06:59) Marvell version: 3.4.16 U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CEE80 Soc: 88F6281 A0 (DDR2) CPU running @ 1200Mhz L2 running @ 400Mhz SysClock = 400Mhz , TClock = 200Mhz DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6 DRAM CS[0] base 0x00000000 size 256MB DRAM CS[1] base 0x10000000 size 256MB DRAM Total size 512MB 16bit width Flash: 0 kB Addresses 8M - 0M are saved for the U-Boot usage. Mem malloc Initialization (8M - 7M): Done NAND:512 MB CPU : Marvell Feroceon (Rev 1) Streaming disabled Write allocate disabled USB 0: host mode PEX 0: interface detected no Link. Net: egiga0 [PRIME], egiga1 Hit any key to stop autoboot: 0 (Re)start USB... USB: scanning bus for devices... 1 USB Device(s) found scanning bus for storage devices... 0 Storage Device(s) found
- Booting image at 08000000 ...
Bad Magic NumberFYI, here's the env settings I used (I'm using ext2 on the sdcard).
setenv bootargs 'console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=30 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw'
setenv bootcmd 'usb start; ext2load usb 0:1 0x8000000 /uImage.sheeva.040309; bootm 0x8000000; reset'
Thanks for any help (and for this great site!)
Dan
Aug 22 2009 5:53 pm
Hi
Thanks for the site, been very useful so far.
I'm trying to 'mount /dev/mtdblock1 /mnt/mtdroot' but it comes back with 'mount: you must specify the filesystem type'.
I've tried all the file types listed here - http://linux.die.net/man/8/mount (in the options section) and some of them mount with differing files resulting (can't remember which ones showed what, if you need to know I can go through them again) - what files/folders should show?
Hope you can help, thanks
Aug 24 2009 3:34 pm
I found my solution, you don;t actually seem to have to mount mtdblock1, you can use:
>cp -ax / /mnt/sda2
>cp -a /dev /mnt/sda2
based on sdcard instructions here: http://plugcomputer.org/plugwiki/index.php/SD_Card_As_Root_File_System
Aug 27 2009 10:40 am
I am trying to boot from external USB drive. I copied the uImage from the web site to my ext2 /dev/sda1 partition. I renamed the file to uImage instead of uImage.sheeva.040309 for faster editing (I am lazy).
When I boot the Sheeva plug, I always get the following error messages :
USB: scanning bus for devices... T
USB device not responding, giving up (status=80000000)
2 USB Device(s) found
scanning bus for storage devices... 0 Storage Device(s) found
** Bad partition 1 **
## Booting image at 08000000 ...
Bad Magic Number
Here are the modified lines from the printenv command :
bootargs=console=ttyS0,115200 root=/dev/sda2 rootdelay=30 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw
bootcmd=usb start; ext2load usb 0:1 0x8000000 /uImage; bootm 0x8000000; reset
Note the mtdparts=orion_nand is the last I tried. But I also get the same error message when using mtdparts=nand_mtd. What am I doing wrong ?
Aug 29 2009 4:52 pm
Thanks for the guide, I followed the instructions and it worked on the 1st try.
Now I'd like to boot back from the NAND flash, so I restored the variables using:
Marvell>> setenv bootargs $(bootargs_nand)
Marvell>> setenv bootcmd $(bootcmd_nand)
Marvell>> saveenv
...but when I reset the plug I get this error:
NAND read: device 0 offset 0x100000, size 0x300000
reading NAND page at offset 0x100000 failed
3145728 bytes read: ERROR
## Booting image at 00800000 ...
Bad Magic Number
Is there anything I can do besides restoring the device using the sheevaplug-installer?
these are the actual values:
bootcmd=nand read.e 0x800000 0x100000 0x300000; bootm 0x800000
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x100000@0x00000(u-boot),0x300000@0x100000(uImage)ro,0x1fC00000@0x400000(rootfs)rw root=/dev/mtdblock2
Aug 31 2009 1:49 pm
Kris, yeah, the mount point for the SD card is different than one for USB. Thanks for the pointer to the correct SD mount point.
Aug 31 2009 1:54 pm
The part about that said "0 Storage Device(s) found" concerns me. I don't think it detected your usb drive correctly. You should try doing a "usb start" and and check to make sure you could read the drive's partition.
Aug 31 2009 2:06 pm
Strange that the flash would be corrupted like that. But since your sheevaplug is running a proper uboot, you could simply overwrite the kernel/rootfs partitions from uboot instead of the installer. In fact, if you could boot into linux (via usb), you should be able to write to the /dev/mtdblock directly.
Sep 01 2009 3:56 pm
U-boot works fine, so I booted via usb and I see the mtdblocks, but Im not sure which one is the right one.
From the docs I read:
You should see 3 partitions after issuing the command below.
root@sheeva:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00020000 "uImage"
mtd1: 1fb00000 00020000 "rootfs"
I see only 2, so I guess the names are wrong, and one of them is the u-boot partition, and the missing one is the cause of the problem. Does this make sense?
Thanks again for your help :)
Sep 02 2009 9:16 am
It is likely due to the fact that your bootargs only defined 2 mtd partitions (uImage and rootfs). Although it doesn't really matter to have 2 or 3 partitions as long as the offset and length is correct. I suggest comparing the 2 bootargs (nand vs usb) and make sure that the usb version of the bootarg has the same "mtdparts" definition as the nand version.
Sep 02 2009 10:47 am
Kenny, you were absolutely right about the non-detection of the drive. Somehow, the USB disk does not spin upon Sheeva boot. The command "usb start" did not help. It is like my drive is awaiting for some sort of command to start spinning which the Sheeva does not send... I had to first boot the Sheeva, then plug the USB drive and it finally got recognized. For now all is good and I can dive deeper in my Sheeva experiment. Thank you for your response.
Sep 06 2009 7:36 pm
ok I'll try to flash the nand once I boot with the usb, thanks for the advice.
Sep 15 2009 3:15 am
Just to say thanks for this guide and your site. My plug is booting debian off a WD 500gb external usb drive powered by the plug itself as you suggest on another page. Streaming to a Squeezebox, serving files to Macs over afp and downloading torrents my plugs been up for weeks now with no problems (cross fingers). I do have some trouble with booting the plug though, nt every boot works and uboot often complains about a bad magic number. Rebooting again mostly helps. One day I'll track down what is wrong
Sep 15 2009 9:38 am
No problem, Stuart. The sheevaplug is definitely a cool little device. The plug has been running for 111 days straight so far without any problems. I agree with you about uboot, its flaky and it really needs to be looked at more closely.
Oct 15 2009 11:37 am
Thanks a lot for this. It didn't work on the first try for me, but that was my fault. I misspelled the image (uImage.sheeva instead of uImage.sheeva.040309). After I figured out that was the problem everything worked out ok. Excellent work, thanks again.
Dec 29 2009 6:32 am
Typo? "..because I want to be option to move the data.."
Dec 30 2009 4:42 pm
I have an Ionics version plug, with a 250gb usb drive I am trying to transfer the system to. It has 3 primary partitions, a 5gb ext3 partition with uimage on it, a 245gb ext3 partition with the rootfs on it, and a 2gb linux swap partition. I copied the files on to there from the cd that came with the unit.
I entered the commands to change the uboot parameters as shown, I entered just 'uimage' as that was the name of the file on the cd.
setenv bootargs 'console=ttyS0,115200 root=/dev/sda2 rootdelay=10 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw' setenv bootcmd 'usb start; fatload usb 0:1 0x8000000 uImage; bootm 0x8000000; reset' saveenv
they entered ok.
on reboot it shows an error message:
USB: scanning bus for devices... 2 USB Device(s) found
reading uImage
Bad Magic Number รพ
can anyone please point out what I need to enter here to get it to boot correctly? thanks in advanceDec 31 2009 7:19 pm
I found the problem, repartitioned the drive to use ext2 partitions and entered the correct 'ext2load' command. case closed
Jan 04 2010 7:22 pm
Following link explains a solution:
http://plugcomputer.org/plugforum/index.php?topic=478.0
Jan 09 2010 4:30 am
I followed this with the exception that swap is partition 2 & rootfs is partition 3 and adjusted the bootargs accordingly.
This is using a USB HDD (6Gb disk in a MAPOWER container).
On booting I get the response
USB: scanning bus for devices... 2 USB Device(s) found
0 Storage Device(s) found
Bad Magic Number
The device then resets. I assume the 2 USB Devices found are the ttys and that the protocol2 indicates an incompatibility between my USB HDD device.
What sort of USB HDD are you using?Jan 09 2010 5:17 am
I tried plugging in another HDD, this time it was a SATA disk (previous one was PATA) in a different USB housing. Although I hadn't configured this with the Sheeva FS (it has a Hardy installation for a thin client) usb start scans it OK. So it looks as if a trip to eBay is called for. Oh well, the 6G disk was only for testing purposes but at least I know now not to buy a PATA for the old housing.
Jan 31 2010 5:06 am
Really nice guide.
I noticed that the fstab sample that you provide does use vfat for boot and does not mention the optional (and suggested) change to ext2. Also, there is no mention of a swap partition there:
Regards,May 18 2010 6:32 am
Hi all,
This guide seems so nice but something goes wrong with my sheeva, when I want to use an external usb drive, stick or disk, I've got the same kind of error when copying root fs.
During this line
cp -av /mnt/mtdroot/. /mnt/sda2
After a while of copy, I've got a kernal panic with the message below.
Notice that :
- my sheeva is a RD-88F6281-BPLUG-A, and it was deliver with
UBOOUT 3.4.16 and Linux Debian 2.6 in NAND flash.
- I had first a problem to format my second partition, mkfs.ext2 /dev/sda2 was also giving a kernel panic during excution so I did this on my linux PC.
Console message:
(cut because wp plugin doesn't display correctly, sorry)
May 21 2010 12:26 am
@JYF:
I know this is old for you, but I think I had this same problem today. Several places online (at least one here) the line breaks aren't clear, making it look like you should "setenv mtdparts orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw" or some such. but looking again at the printenv from before I started tinkering, mtdparts only exists in bootargs, so the line to change mtdparts=orion_nand would be something like
setenv bootargs 'console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw rootfstype=jffs2 ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none'
Note here, again, that mtdparts= may seem to be on a new line; I'm not sure what the implications of cutting and pasting here are, but when I put that all on one line, it booted OK.
Anyway, I hope that helps someoneJun 11 2010 10:45 am
This is what I did to get Debian stable (lenny) working on a 4GB usb stick:
1. I inserted the usb stick into a Ubuntu desktop and ran: sudo gparted.
2. I located the usb drive in the device dropdown and unmounted the partition.
3. I Formatted the existing partition as EXT3 and then quit gparted.
4. I copied the daily Debian lenny installer files to the usb drive from:
http://people.debian.org/~joeyh/d-i/armel/images/daily/kirkwood/netboot/marvell/sheevaplug/
5. I inserted the usb drive into a usb hub connected to my sheevaplug and booted it up into the u-boot shell.
6. I ran:
a. usb start
b. ext2ls usb 0:1 (to verify that I could see the two installer files)
c. ext2load usb 0:1 0x01100000 /uInitrd
d. ext2load usb 0:1 0x00800000 /uImage
e. setenv bootargs 'console=ttyS0,115200 base-installer/initramfs-tools/driver-policy=most mirror/suite=stable apt-setup/local0/repository="http://people.debian.org/~tbm/orion lenny main" apt-setup/local0/key=http://people.debian.org/~tbm/orion/68FD549F'
f. bootm 0x00800000 0x01100000
7. The sheevaplug then booted up into the Debian installer application.
DONE AND DONE
Jun 11 2010 10:56 am
Sorry for the spaces in the setenv statement in my instructions above (6e).
Here is the site where I got those setenv commands:
http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html
DannoThanks,
Jun 14 2010 8:49 am
Thanks for the instructions Danno.
Jul 21 2010 7:20 pm
Where / how do you get ext2ls?
Aug 05 2010 2:37 am
what a fantastic set of documentation. very very much appreciate your hard work in its authoring as well as working through problems in the user comments.
a couple of recommendations to enhance the article:
1) you show the reader how to backup the environment variables, but it might be helpful to review how to reload those in case they screw something up. would save a newbie a ton of time.
2) i was dead in the water (like IanJB) after linux was uncompressed and said "done, booting the kernel". i'm running the ferocean uBoot, but for some reason had the arcNumber and mainlineLinux params set in the environment variables. once i removed those (that might help a newbie too), it fired right up.
3) it may be easier to partition the usb device using a stable desktop environment, as well as copying the uImage over. fdisk can be a little cumbersome with the sizing and partition type.
4) kudos to kris above who mentioned the easier way of copying the filesystem over ("cp -ax / /dev/sda2", instead of accessing it through /dev/mtdblock1).
Just some recommendations to enhance a great writeup that saved my backside.
Oct 14 2010 6:13 am
I have a sheevaplug 1.2 Ghz that only came with Uboot - otherwise nothing preloaded. I have had a hard time to get anything up and running - finally got something going with Debian.
This website seemed very promising. However, when booting the uImage.sheeva.040309 I get silence. Nothing at al - need to reset.
Questions: 1) is something in the NAND flash needed for the above to work? I have not been able to find out how to set the NAND with mtdparts configuration
2) which filesystem - where to download for the above guidance?