Welcome! Log In Create A New Profile

Advanced

Can't boot into debian after powerfail

Posted by archat68 
Can't boot into debian after powerfail
September 25, 2010 11:10AM
I have Debian installed on my Dockstar. It was running fine except that the system failed to boot into Debian after a powerfail - it would boot into rescue mode instead. This problem usually got solved by running a filesystem check on the HDD.

But today after a power fail the problem recurred and I tried checking the filesytem and restoring a backup of my old installation on my pen drive. But it did not solved the problem.

Then I tried to run netcat. i got the following output.:
Quote

U-Boot 2010.06-00695-gbd23130-dirty (Aug 30 2010 - 23:04:56)
Marvell-Dockstar/Pogoplug by Jeff Doozan
Hit any key to stop autoboot: 0
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=3"
UBI: MTD device size: 219 MiB
UBI: number of good PEBs: 1751
UBI: number of bad PEBs: 1
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 1730
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
scanning bus for storage devices... 0 Storage Device(s) found
** Block device usb 0 not supported
** Block device usb 1 not supported
** Block device usb 2 not supported
** Block device usb 3 not supported
** Block device usb 0 not supported
** Block device usb 0 not supported
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..

NAND read: device 0 offset 0x100000, size 0x400000
4194304 bytes read: OK
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-2.6.32.18-dockstar
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3175992 Bytes = 3 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

So, what's the problem here? I see some UBIFS error there. Pls. help me - I'm completely new to all these.
Re: Can't boot into debian after powerfail
September 25, 2010 08:18PM
any help?
Re: Can't boot into debian after powerfail
September 28, 2010 09:53AM
@archat68

Probably I've come across this same issue - by accident I've turned of my Dockstar and I think from that moment I can't boot from USB.

Did you solved your problem without reinstalling whole system ?
How did you configured Dockstar to use 'netcat' and see booting sequence log ?
Unbricking the Dockstar with CA-42 serial cable.
September 26, 2010 07:36PM
My dockstar was not booting into Debian after a powerfail. So, I was tinkering with the uboot and I messed up it. I can not get SSH access to Dockstar.
I have attached a CA-42 cable with the Dockstar and I', getting the following output with putty:

Quote

U-Boot 2010.06-00695-gbd23130-dirty (Aug 30 2010 - 23:04:56)
Marvell-Dockstar/Pogoplug by Jeff Doozan

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Using egiga0 device
ping failed; host 192.168.2.3 is not alive
Hit any key to stop autoboot: 0
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 0 Storage Device(s) found
** Block device usb 0 not supported
** Block device usb 0 not supported
Wrong Image Format for bootm command
ERROR: can't get kernel image!
resetting ...

And this continues in a loop.

Can somebody help me to restore the uboot?
Re: Unbricking the Dockstar with CA-42 serial cable.
September 26, 2010 09:05PM
I'm trying to follow this guide

Unbricking with serial cable

But I can't issue the "resetenv" command - it says command not found.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 03:50AM
That link is for re-flashing Dockstar with stock uboot. Jeff's U-boot does not have "resetenv".
You may try to set and save envs using "setenv" and "saveenv". If you use "prinenv" to print out your envs and post here (with serial number, mac address removed) , people may help you to set the correct envs.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 03:55AM
O.K will do that when I'm at home.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 08:58AM
Here is the output of printenv:
Quote

ethact=egiga0
bootdelay=3
baudrate=115200
arcNumber=2097
mainlineLinux=yes
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
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_device=0:1
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;
rescue_installed=1
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_start=usb start
usb_stop=setenv usb_device 0:1
usb_root=setenv usb_rootdelay 10
usb_load_uimage=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage
bootcmd_usb=run usb_load_uimage; run set_bootargs_usb; run usb_boot
usb_load_uboot=ext2load usb $usb_device 0x800000 uboot-original-mtd0.kwb
usb_uboot_boot=go 0x800200
bootcmd_usb_pogo=run usb_load_uboot; run usb_uboot_boot
linux_partition=setenv partition nand0,3
linux_root=/dev/mtdblock3
linux_rootdelay=1
linux_rootfstype=jffs2
linux_load_uimage=fsload 0x800000 /boot/uImage
set_bootargs_linux=setenv bootargs console=$console root=$linux_root rootdelay=$linux_rootdelay rootfstype=$linux_rootfstype
bootcmd_linux=run linux_partition; run linux_load_uimage; run set_bootargs_linux; run linux_boot
pogo_partition=setenv partition nand0,2
pogo_load=fsload uboot-original-mtd0.kwb
pogo_boot=go 0x800200
bootcmd_pogo=run pogo_partition; run pogo_load; run pogo_boot
ipaddr=192.168.2.5
serverip=192.168.2.4
ethaddr=00:10:75:1A:XX:XX
cesvcid=6A9K57SP3XZDAPC2YJEBA7XXXX
bootargs_root=root=/dev/mtdblock2 ro
bootcmd=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000
console=console=ttyUSB0,115200
server=192.198.2.4
stdin=serial
stdout=serial
stderr=serial
bootargs=$(console) $(bootargs_root)

Environment size: 3072/131068 bytes

Pls help guys.



Edited 1 time(s). Last edit at 09/27/2010 08:59AM by archat68.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 09:06AM
And here is the output from serial port without USB drive connected:
Quote

U-Boot 2010.06-00695-gbd23130-dirty (Aug 30 2010 - 23:04:56)
Marvell-Dockstar/Pogoplug by Jeff Doozan

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Using egiga0 device
ping failed; host 192.168.2.4 is not alive
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x100000, size 0x300000
3145728 bytes read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 10:59AM
I did not read all lines of your envs, the problem is in your "bootcmd", it tries to load mtd0 (Pogo linux) to SDRAM but that won't work without stock u-boot.

I can post correct envs after I get home today.

Others may point you to the right "bootcmd". You may want change it by "setenv bootcmd 'run bootcmd_usb; ....' "
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 11:03AM
i tried "run bootcmd_usb" but is always getting the following error:

Wrong Image Format for bootm command
ERROR: can't get kernel image!

I also tried "run bootcmd_original" and "run bootcmd_pogo" - everytime I get the same error.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 01:22PM
have you tried ""setenv bootcmd 'ruubifs_bootcmd' "?
Re: Unbricking the Dockstar with CA-42 serial cable.
September 27, 2010 03:23PM
archat68 Wrote:
-------------------------------------------------------
> I'm trying to follow this guide
>
> Unbricking with serial cable
>
> But I can't issue the "resetenv" command - it says
> command not found.



I have done this myself,,,,
You better freash back to the Org Uboot before you do this.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 28, 2010 07:47AM
The instructions you are trying to follow cause more problems than they solve. Flashing partitions from uBoot isn't a very good idea, it's possible that you could brick you device (it's not bricked yet, you've just misconfigured the uBoot environment.)

Having said that, did you stop when you found out that 'resetenv' didn't work, or did you keep going? If so, did you run any of the 'nand erase' instructions from that guide?

If you did not run any nand erase commands, you should be able to boot the original Pogoplug environment by running the following commands from uBoot:
setenv mtdparts 'mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)'
setenv mtdids 'nand0=orion_nand'
setenv partition 'nand0,2'
setenv bootcmd 'fsload uboot-original-mtd0.kwb; go 0x800200'

boot

If that boots, re-run the uBoot installer and choose Y when asked if you want to reset the environment.

-- Jeff
Re: Unbricking the Dockstar with CA-42 serial cable.
September 28, 2010 08:55AM
Thanks Jeff for your reply

I did not proceed when I was unable to run "resetenv" and I did not run any flash erase command. I've only issued "setenv" commands followed by "saveenv" command.

I tried the commands as mentioned above by you. I'm getting the following output:
Quote

### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS: read_nand_cached: error reading nand off 0x24dfe00 size 8192 bytes
read_nand_cached: error reading nand off 0x24e1e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24e3e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24e5e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24e7e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24e9e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24ebe00 size 8192 bytes
read_nand_cached: error reading nand off 0x24ede00 size 8192 bytes
read_nand_cached: error reading nand off 0x24efe00 size 8192 bytes
read_nand_cached: error reading nand off 0x24f1e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24f3e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24f5e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24f7e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24f9e00 size 8192 bytes
read_nand_cached: error reading nand off 0x24fbe00 size 8192 bytes
read_nand_cached: error reading nand off 0x24fde00 size 8192 bytes
read_nand_cached: error reading nand off 0x24ffe00 size 8192 bytes done.
find_inode failed for name=uboot-original-mtd0.kwb
load: Failed to find inode
### JFFS2 LOAD ERROR<0> for uboot-original-mtd0.kwb!
## Starting application at 0x00800200 ...

And it stops there.

What should I do next? Sorry for my ignorance.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 28, 2010 09:10AM
You've got serverip and ipaddr settings in your environment, so I'm assuming that you've got a TFTP server set up on 192.168.2.4. If not, you need to setup a TFTP server someplace on your network and the adjust those variables accordingly.

Download [http://jeff.doozan.com/debian/uboot/uboot-original-mtd0.kwb]uboot-original-mtd0.kwb[/url] and put it on your tftp server.

From uBoot:
tftp 0x800000 uboot-original-mtd0.kwb
go 0x800200

-- Jeff
Re: Unbricking the Dockstar with CA-42 serial cable.
September 28, 2010 10:38AM
My config is as follow
ipaddr=192.168.2.6 (my gateway is 192.168.2.1 - so it can be any unused IP in this range - am I correct?)
serverip=192.168.2.4 (this is ip of my laptop running TFTP server in ubuntu)

When I restart my Dockstar to start TFTP - I get the following output:

Quote

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Using egiga0 device
host 192.168.2.4 is alive

then there is no output on the serial interface and the Dockstar LED starts blinking orange.

What am I doing wrong?
Re: Unbricking the Dockstar with CA-42 serial cable.
September 28, 2010 10:42AM
It sounds like you configured netconsole on uBoot, so once it sees that 192.168.2.4 is alive, it's sending all the console output to that device. Unplug the ethernet cable and reboot the dockstar and you be able to interrupt the boot process with the serial device. After that, connect the ethernet cable and then continue with the tftp commands I posted earlier.
Re: Unbricking the Dockstar with CA-42 serial cable.
September 28, 2010 11:04AM
Whenever I try to TFTP I'm getting the following message:

Quote

Marvel>> tftp 0x800000 uboot-original-mtd0.kwb
Using egiga0 device
TFTP from server 192.168.2.4; our IP address is 192.168.2.6
Filename 'uboot-original-mtd0.kwb'.
Load address: 0x800000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
Re: Unbricking the Dockstar with CA-42 serial cable.
September 28, 2010 02:54PM
It sounds like your tftp server isn't working.

New approach. From your laptop, format a flash drive as ext2, copy that uboot-original file to it, and the connect the drive to your Dockstar. Then run the following from uBoot:

usb start
ext2load usb 0:1 0x800000 /uboot-original-mtd0.kwb 
go 0x800200
Re: Can't boot into debian after powerfail
September 28, 2010 10:38PM
Thanks once again Jeff.

After I issue the "go 0x800200" command I see

Quote

Marvell>> go 0x800200
## Starting application at 0x00800200 ...


U-Boot 1.1.4 (Jul 16 2009 - 21:02:16) Cloud Engines (3.4.16)

U-Boot code: 00600000 -> 0067FFF0 BSS: -> 00690D60

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 128MB
DRAM Total size 128MB 16bit width
Flash: 0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:256 MB

CPU : Marvell Feroceon (Rev 1)
CLOUD ENGINES BOARD: REDSTONE:1.0

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

NAND read: device 0 offset 0x100000, size 0x300000

Reading data from 0x3ff800 -- 100% complete.
3145728 bytes read: OK
## Booting image at 00800000 ...
Bad Magic Number
CE>>

Is everything O.K?

To run the uboot installer I need to be able to see the dockstar should be able to get an IP on the router - right?

Sorry for asking too many questions - but how can I proceed?
Re: Can't boot into debian after powerfail
September 29, 2010 09:11AM
It looks like your Pogoplug install is corrupt.

We're going to manually reset your uBoot environment and then manually install the Rescue System from uBoot.

Follow these steps very, very carefully. If something does not work or does not match, do not keep going:

Download the following images to the root of your ext2 formatted thumb drive, and verify their m5dsum

http://jeff.doozan.com/debian/uboot/uboot.environment
http://jeff.doozan.com/debian/rescue/uImage-mtd1.img
http://jeff.doozan.com/debian/rescue/rootfs-mtd2.img

$ md5sum *
45bd19e21b3600ad46a0379c998a7438 rootfs-mtd2.img
d2252391ce65b8ad99b7b74ca094c742 uImage-mtd1.img
8726be9efc9fe382547b120a0a8685c3 uboot.environment


Connect the thumb drive to your dockstar. Unplug the power from the dockstar, and then reconnect it.

Run the following commands from uBoot:

printenv ethaddr

Save the ethaddr, you are going to need it later

usb start
ext2load usb 0:1 0x800000 /uboot.environment

You should see the following:
# Loading file "/uboot.environment" from usb device 0:1 (usbda1)
# 131072 bytes read

nand erase 0xC0000 0x20000
nand write 0x800000 0xC0000 0x20000
reset

This will reboot your dockstar. Get back into it and run the following

setenv ethaddr 'the ethaddr value that you got earlier'
setenv rescue_installed 1
saveenv

usb start
ext2load usb 0:1 0x800000 /uImage-mtd1.img

The ext2load command may take a few minutes to run.
You should see the following:
# Loading file "/uImage-mtd1.img" from usb device 0:1 (usbda1)
# 3670016 bytes read

nand erase 0x100000 0x400000
nand write 0x800000 0x100000 0x380000

ext2load usb 0:1 0x800000 /rootfs-mtd2.img

This ext2load command will take much longer than the first one, but eventually you should see
Loading file "/rootfs-mtd2.img" from usb device 0:1 (usbda1)
26738688 bytes read

nand erase 0x500000 0x2000000
nand write 0x800000 0x500000 0x1980000

run rescue_bootcmd

If everything worked, that will should take you to a login prompt. You can log in with root/root and then follow the Debian install instructions.

-- Jeff
Re: Can't boot into debian after powerfail
September 29, 2010 10:57AM
WOW!!

This is what called support! Hats off to you - Jeff!

It worked and I can now boot into rescue.

BTW shall I try to boot from backup from my earlier installation?
Re: Can't boot into debian after powerfail
September 29, 2010 11:33AM
You can try booting from your old drive. All you have to do is plug it in and restart the Dockstar. You do NOT need to change any uBoot variables. If it doesn't work, or if you can't figure out how to repair it, you can just run the Debian installer from the Rescue Environment.

-- Jeff
Re: Can't boot into debian after powerfail
September 29, 2010 11:50AM
Yesss! I can boot up from a restored backup.

BTW I'd used Acronis True Image to take the backup and using it to restore the partition.

Is there any better way to take a backup?
Re: Can't boot into debian after powerfail
September 30, 2010 09:41PM
I'm facing problem with the booting into Debian. With Flash drive - it boots sometimes - not always - when it fails to boot into debian it boots into rescue mode.

I restored the same backup to USB HDD that I was earlier using. I'm not at all able to boot into Debian with the HDD. It always boots into rescue mode.

I'm attaching the serial port output here in a .txt file.

Both the drives have been checked for filesystem errors.
Attachments:
open | download - dockstar_log.txt (13.1 KB)
Re: Can't boot into debian after powerfail
October 01, 2010 02:45AM
I re-installed debian into a re-formatted HDD. I still can not boot into Debian - it boots into the rescue mode. The serial cable output is attached for reference.
Attachments:
open | download - Dockstar_new.txt (13.2 KB)
Re: Can't boot into debian after powerfail
October 01, 2010 07:00AM
Try running the following command from the rescue system:

fw_setenv setenv usb_init ''
Re: Can't boot into debian after powerfail
October 01, 2010 08:50AM
Well I tried that command followed by restart of the Dockstar. It still boots into rescue mode. I've attached the serial output and printenv for your reference.
Attachments:
open | download - Dockstar2.txt (13 KB)
open | download - printenv.txt (2.3 KB)
Re: Can't boot into debian after powerfail
October 01, 2010 08:51AM
Quote

UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!

What does this error means?
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: