New IT forum Follow us on Twitter
17 May 2012, 03:36:06 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: EFIKA MX reviewed in Linux User & Developer issue 104
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Migrating from nand only to dual boot sheeva plug  (Read 1708 times)
george_harley
Newbie
*
Posts: 10


« on: 29 January 2011, 08:06:05 pm »

Hello,
I got my sheeva plug a couple of months ago and thought I would be happy enough with the fast nand only version. So I quickly found out that it just isn't enough to have 512 Mb for the / filesystem. I now got my 8G SD card (class 10) from newit but cannot get it to work.
I've followed the instructions on the following page to get it to dual boot:

http://plugcomputer.org/plugwiki/index.php/SD_Card_As_Root_File_System

I did the following:
1) fdisk the sd card
Quote
fdisk /dev/mmcblk0
   press "o"  / delete the existing (FAT) partition table
   press "n"  / create a new partition
   press "p"  / it's a primary partition
   press "1"  / partition #1
   press enter / default first cylinder
   press enter / default last cylinder
   press "a"  / set the boot flag
   press "1" / ... for partition #1
   press "w" / save changes
   
2) copy the files from the nand to the sd
Quote
>cp -axv / /mnt/sdcard # takes 13 minutes
>cp -av /dev /mnt/sdcard

3) boot into u-boot
4) The printenv bootargs command didn't work so I assume this is an alpha6 beta plug. (assumption is the mother of all F....)
5) setenv bootargs_root root=b301
6) check the setting and boot

Quote
Marvell>> printenv bootargs_root                                               
 bootargs_root=root=b301                                                         
 Marvell>> boot                                                                 
 SDHC found. Card desciption is:                                                 
 Manufacturer:       0x1e, OEM "AB"                                             
 Product name:       "SDC  ", revision 1.0                                       
 Serial number:      663                                                         
 Manufacturing date: 9/2010                                                     
 CRC:                0x00, b0 = 0                                               
                                                                                 
 ** Unable to read "/uImage" from mmc 0:1 **                                     
 ## Booting image at 00800000 ...                                               
 Bad Magic Number                                                               
                                                                                 
NAND read: device 0 offset 0x100000, size 0x400000   
 
 mmc0: host does not support reading read-only switch. assuming write-enable.   
 mmc0: new high speed SDHC card at address b368                                 
 mmcblk0: mmc0:b368 SDC   7.51 GiB                                               
  mmcblk0: p1                   

So it didn't work!!

The b368 in the second last line suggests that I should set the bootargs to that instead of b301. Tried that aswel but didn't work.
I read in some places that to make this work I would have to create two partitions with fdisk on the SD card and use the sheeva plug installer file to setup the system, but I would like to try and prevent re-installing the entire system. Is there anyone that can assist. I hope so. Huh
I have attached the entire printenv (without ip and mac info)

Best Regards,
Herman

* printenv (4.58 KB - downloaded 11 times.)
Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #1 on: 29 January 2011, 08:14:28 pm »

You didn't state what format you used for the SD card. U-Boot can read ext2, but not ext3. Hence most SD partitioning schemes create a small ext2 partition for the kernel, with rootfs as ext3, or entire card as ext2.
Logged
george_harley
Newbie
*
Posts: 10


« Reply #2 on: 29 January 2011, 09:02:35 pm »

Hello NewIT_Marcus,
Excuse me for not stating the filesystem format. I started of with ext3 and then indeed read about problems with ext3, so a couple of days ago I tried the entire ext2 (1 partition) option (not my preference) but it still came with errors. Just to be sure I just walked through the steps again

- deleted the existing partition table
- created a new partition, also made it bootable with the "a" option.
Quote
       Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *           1        1758     7879338   83  Linux
- applied the filesystem: mkfs -t ext2 /dev/mmcblk0p1
Quote
/dev/mmcblk0p1
              ext2     7755556    658876   6702716   9% /mnt/sdcard
- mount the filesystem
- copied the files from the nand to the sd card

And got this when I booted:
Quote
Marvell>> printenv bootargs_root                                                
bootargs_root=root=b301                                                        
Marvell>> boot                                                                  
SDHC found. Card desciption is:                                                
Manufacturer:       0x1e, OEM "AB"                                              
Product name:       "SDC  ", revision 1.0                                      
Serial number:      663                                                        
Manufacturing date: 9/2010                                                      
CRC:                0x00, b0 = 0                                                
                                                                                
** Unable to read "/uImage" from mmc 0:1 **                                    
## Booting image at 00800000 ...                                                
Bad Magic Number                                                                
                                                                                
NAND read: device 0 offset 0x100000, size 0x400000                              
                                                                                
Reading data from 0x4ff800 -- 100% complete.                                    
 4194304 bytes read: OK                                                        
## Booting image at 00800000 ...                                                
   Image Name:   Linux-2.6.32.7                                                
   Created:      2010-02-10  21:21:03 UTC                                      
   Image Type:   ARM Linux Kernel Image (uncompressed)                          
   Data Size:    2822164 Bytes =  2.7 MB                                        
   Load Address: 00008000                                                      
   Entry Point:  00008000                                                      
   Verifying Checksum ... OK                                                    
OK                                                                              
                                                                                
Starting kernel ...                                                            

It doens't boot into the sd card, but the messages seem different, I miss the mmc0 messages after the "bad magic number" that I saw in the output of my first post. btw I also tried setting this: bootargs_root root=/dev/mmcblk0p1 (instead of root=b301)
« Last Edit: 29 January 2011, 09:26:18 pm by george_harley » Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #3 on: 30 January 2011, 03:20:56 pm »

I don't know what the "alpha6" stuff is about; we've never used the settings that are listed as appropriate to it. If your NAND is still JFFS2, the settings we would recommend are here

Regardless, your error message is clear. The kernel is not being loaded. Either because it doesn't exist on the device that you pointed U-Boot at, or because the device can't be found, or because the kernel is in the wrong place / not prepared correctly. Do you have a kernel (uImage) in / on the SD card?

Logged
george_harley
Newbie
*
Posts: 10


« Reply #4 on: 30 January 2011, 07:57:53 pm »

Hi again,
I bought my system with UBIFS filesystem (the one that boots very quickly, +- 25 secs). I agree that the message is clear. I had a look at the recommended settings that you refer to, but they do mention the second partition i.e. mmcblk0p2

My uImage is on the sd card:
Quote
root@hanuman:~# mount /dev/mmcblk0p1 /mnt
root@hanuman:~# cd /mnt
root@hanuman:/mnt# ls -ltr /boot/uImage
-rwxr-xr-x 1 root root 2620504 Feb 22  2000 /boot/uImage
root@hanuman:/mnt# cd ..
root@hanuman:/# ls -ltr /boot/uImage
-rwxr-xr-x 1 root root 2620504 Feb 22  2000 /boot/uImage
root@hanuman:/#

The device can be found because during boot it says the following:

Quote
Marvell>> boot                                                                 
SDHC found. Card desciption is:                                                 
Manufacturer:       0x1e, OEM "AB"                                             
Product name:       "SDC  ", revision 1.0                                       
Serial number:      663                                                         
Manufacturing date: 9/2010                                                     
CRC:                0x00, b0 = 0                                               
                                                                               
** Unable to read "/uImage" from mmc 0:1 **                                     


Strange thing is that during the boot it seems as if the system expects the uImage to be in the root and not in /boot/uImage, so I decided to cp the uImage into the root. Now it seems to boot further:

Quote
Marvell>> boot                                                                 
SDHC found. Card desciption is:                                                 
Manufacturer:       0x1e, OEM "AB"                                             
Product name:       "SDC  ", revision 1.0                                       
Serial number:      663                                                         
Manufacturing date: 9/2010                                                     
CRC:                0x00, b0 = 0                                               
                                                                               
2620504 bytes read                                                             
## Booting image at 00800000 ...                                               
   Image Name:   Linux-2.6.30.2                                                 
   Created:      2009-07-23   1:53:36 UTC                                       
   Image Type:   ARM Linux Kernel Image (uncompressed)                         
   Data Size:    2620440 Bytes =  2.5 MB                                       
   Load Address: 00008000                                                       
   Entry Point:  00008000                                                       
   Verifying Checksum ... OK                                                   
OK                                                                             
                                                                               
Starting kernel ...                                                             
                                                                               
Uncompressing Linux.............................................................
Linux version 2.6.30.2 (kelly@speedy) (gcc version 4.2.1) #11 PREEMPT Wed Jul 29
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053177             
CPU: VIVT data cache, VIVT instruction cache                                   
Machine: Marvell SheevaPlug Reference Board                                     
Memory policy: ECC disabled, Data cache writeback                               
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048     
Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=5       
NR_IRQS:114                                                                     
PID hash table entries: 2048 (order: 11, 8192 bytes)                           
Console: colour dummy device 80x30                                             
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)                 
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)                 
Memory: 256MB 256MB = 512MB total                                               
Memory: 513408KB available (4728K code, 998K data, 140K init, 0K highmem)       
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1         
Calibrating delay loop... 1192.75 BogoMIPS (lpj=5963776)                       
Mount-cache hash table entries: 512                                             
CPU: Testing write buffer coherency: ok                                         
net_namespace: 980 bytes                                                       
NET: Registered protocol family 16                                             
Kirkwood: MV88F6281-A0, TCLK=200000000.                                         
Feroceon L2: Enabling L2                                                       
Feroceon L2: Cache support initialised.                                         
Kirkwood: Gating clock using mask 0x1ac224                                     
bio: create slab <bio-0> at 0                                                   
SCSI subsystem initialized                                                     
usbcore: registered new interface driver usbfs                                 
usbcore: registered new interface driver hub                                   
usbcore: registered new device driver usb                                       
cfg80211: Using static regulatory domain info                                   
cfg80211: Regulatory domain: US                                                 
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)       
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)           
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)           
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)           
cfg80211: Calling CRDA for country: US                                         
NET: Registered protocol family 2                                               
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)               
TCP established hash table entries: 65536 (order: 7, 524288 bytes)             
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)                     
TCP: Hash tables configured (established 65536 bind 65536)                     
TCP reno registered                                                             
NET: Registered protocol family 1                                               
JFFS2 version 2.2. (NAND) ?© 2001-2006 Red Hat, Inc.                           
JFS: nTxBlock = 4012, nTxLock = 32100                                           
msgmni has been set to 1003                                                     
alg: No test for stdrng (krng)                                                 
io scheduler noop registered                                                   
io scheduler anticipatory registered                                           
io scheduler deadline registered                                               
io scheduler cfq registered (default)                                           
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled                       
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A                   
console [ttyS0] enabled                                                         
brd: module loaded                                                             
loop: module loaded                                                             
Driver 'sd' needs updating - please use bus_type methods                       
MV-643xx 10/100/1000 ethernet driver version 1.4                               
mv643xx_eth smi: probed                                                         
net eth0: port 0 with MAC address 00:50:43:01:43:f8                             
libertas_sdio: Libertas SDIO driver                                             
libertas_sdio: Copyright Pierre Ossman                                         
NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung NAND 512MiB 3,3V 8-b)
Scanning device for bad blocks                                                 
Bad eraseblock 2722 at 0x000015440000                                           
Bad eraseblock 3030 at 0x000017ac0000                                           
Creating 3 MTD partitions on "orion_nand":                                     
0x000000000000-0x000000100000 : "u-boot"                                       
0x000000100000-0x000000500000 : "uImage"                                       
0x000000500000-0x000020000000 : "root"                                         
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver                     
orion-ehci orion-ehci.0: Marvell Orion EHCI                                     
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1         
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000                             
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00                             
usb usb1: configuration #1 chosen from 1 choice                                 
hub 1-0:1.0: USB hub found                                                     
hub 1-0:1.0: 1 port detected                                                   
Initializing USB Mass Storage driver...                                         
usbcore: registered new interface driver usb-storage                           
USB Mass Storage support registered.                                           
usbcore: registered new interface driver ums-datafab                           
usbcore: registered new interface driver ums-freecom                           
usbcore: registered new interface driver ums-jumpshot                           
usbcore: registered new interface driver ums-sddr09                             
usbcore: registered new interface driver ums-sddr55                             
mice: PS/2 mouse device common for all mice                                     
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0                             
i2c /dev entries driver                                                         
cpuidle: using governor ladder                                                 
cpuidle: using governor menu                                                   
sdhci: Secure Digital Host Controller Interface driver                         
sdhci: Copyright(c) Pierre Ossman                                               
mmc0: mvsdio driver initialized, lacking card detect (fall back to polling)     
Registered led device: plug:green:health                                       
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver                       
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver                       
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )                                       
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )                                 
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )                                       
mmc0: host does not support reading read-only switch. assuming write-enable.   
mmc0: new high speed SDHC card at address b368                                 
mmcblk0: mmc0:b368 SDC   7.51 GiB                                               
 mmcblk0: p1                                                                   
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )                                 
usbcore: registered new interface driver usbhid                                 
usbhid: v2.6:USB HID core driver                                               
oprofile: using timer interrupt.                                               
TCP cubic registered                                                           
NET: Registered protocol family 17                                             
RPC: Registered udp transport module.                                           
RPC: Registered tcp transport module.                                           
lib80211: common routines for IEEE802.11 drivers                               
rtc-mv rtc-mv: setting system clock to 2011-01-30 19:41:12 UTC (1296416472)     
Waiting 5sec before mounting root device...                                     
usb 1-1: new high speed USB device using orion-ehci and address 2               
usb 1-1: configuration #1 chosen from 1 choice                                 
scsi0 : SCSI emulation for USB Mass Storage devices                             
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)               
Please append a correct "root=" boot option; here are the available partitions:
1f00            1024 mtdblock0 (driver?)                                       
1f01            4096 mtdblock1 (driver?)                                       
1f02          519168 mtdblock2 (driver?)                                       
b300         7879680 mmcblk0 driver: mmcblk                                     
  b301         7879338 mmcblk0p1                                               
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)
[<c00309c0>] (unwind_backtrace+0x0/0xe0) from [<c003db50>] (panic+0x50/0x120)   
[<c003db50>] (panic+0x50/0x120) from [<c0008ec0>] (mount_block_root+0x1d4/0x214)
[<c0008ec0>] (mount_block_root+0x1d4/0x214) from [<c0009168>] (prepare_namespac)
[<c0009168>] (prepare_namespace+0x16c/0x1c4) from [<c0008734>] (kernel_init+0xc)
[<c0008734>] (kernel_init+0xc0/0xec) from [<c0040b3c>] (do_exit+0x0/0x6ac)     

So it still has a problem, the following message made me think that there is still a p2 configured in my u-boot variables.

Cannot open root device "mmcblk0p2" or unknown-block(179,2) 

And indeed, there is:
bootargs_root_mmc=root=/dev/mmcblk0p2 rootdelay=5     

After i changed that to p1 it booted into the SD card!! Yehoo!  Smiley
So I actually prefer to have the two partition option with ext2 in p1 and ext3 in p2. Is it enough to just copy the uImage into the 1st partition? and put the rest of the nand into partition 2?

Thanks for your help so far!

kind regards,
Herman                                               
Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #5 on: 30 January 2011, 09:08:11 pm »

So I actually prefer to have the two partition option with ext2 in p1 and ext3 in p2. Is it enough to just copy the uImage into the 1st partition? and put the rest of the nand into partition 2?

In brief: Yes, that plan is fine.

In detail, there are a few things that you still have choices about; which kernel version - the ones at http://sheeva.with-linux.com/sheeva/ are most popular - and how you go about copying your rootfs. Once you have mounted suitable external storage, cp -ax works well enough.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!