Welcome! Log In Create A New Profile

Advanced

Can't obtain an IP address

Posted by eltommi 
Can't obtain an IP address
March 14, 2011 08:40AM
First of all I want to say hello and thanks everyone for the documentation about dockstar i've found in this beautiful place until now!
Now i'm in trouble and I need the help of someone with an higher skill than me!

I was a happy "debian-on-dockstar" user for the past few days.
I configured an external USB drive with an ext4 partition for root, a swap partition, and another big ext4 partition for data. Everything worked like a charm until yesterday evening.
A power cut (damn rainy night) made my dockstar unusable. It is still visible with nc command though.
Now the situation is:
- When I boot the dockstar with the USB drive insterted it starts the kernel
..
Loading file "/boot/uImage" from usb device 0:1 (usbda1)                                                                                                                   
1 bytes read                                                                                                                                                               
Found bootable drive on usb 0:1                                                                                                                                            
Loading file "/boot/uImage" from usb device 0:1 (usbda1)                                                                                                                   
2676840 bytes read                                                                                                                                                         
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)                                                                                                                  
** File not found /boot/uInitrd                                                                                                                                            
## Booting kernel from Legacy Image at 00800000 ...                                                                                                                        
   Image Name:   Linux-2.6.35.7-dockstar                                                                                                                                   
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                                                     
   Data Size:    2676776 Bytes = 2.6 MiB                                                                                                                                   
   Load Address: 00008000                                                                                                                                                  
   Entry Point:  00008000                                                                                                                                                  
   Verifying Checksum ... OK                                                                                                                                               
   Loading Kernel Image ... OK                                                                                                                                             
OK                                                                                                                                                                         
                                                                                                                                                                           
Starting kernel ...

But orange led blink two times and then no, like a heartbeat ( 1 1 0 1 1 0 1 1 0 - to make you understand ) instead of being a static green, like it was.

- When I boot the dockstar without the USB drive inserted it seems to boot
..
Wrong Image Format for bootm command                                                                                                                                       
ERROR: can't get kernel image!                                                                                                                                             
stopping USB..                                                                                                                                                             
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000                                                                                                                    
Scanning JFFS2 FS: ......... done.                                                                                                                                         
### JFFS2 load complete: 524288 bytes loaded to 0x800000                                                                                                                   
## Starting application at 0x00800200 ...

But..orange led keep blinking ( 1 1 1 1 1 1 ...) and I can't access the dockstar via ssh anymore.
So i've tried to connect the LAN cable directly to my pc, using nmap to search the default ip address. After a night searching for the IP, this morning i've noticed out that the dockstar isn't completely dead, it has found the right ip, and I can connect to it.

The problem is that I definitely don't know what's the problem and what to do now that I'm stuck at this point..I thought to find a way to install the rescue system, but I'd like to hear the opinion of someone with more knowledge than me!

Thanks in advance and sorry for my redundancy ;)
Re: Can't obtain an IP address
March 14, 2011 04:43PM
I take it you are unable to ssh into the Dockstar with the USB drive installed. What probably happened is that the drive has some corruption and needs to be fscked. Normally, you do this from the console -- Linux comes up to a certain point and says a manual fsck is required and waits for your input -- and with a console this would be clear. However, unless you have hacked in a console, you won't see this on a Dockstar. So, take your USB drive to another Linux box (one that is recent enough to understand ext4 file systems) and fsck it there. Understand that fscking involves cleaning up a corrupt file system. Normally, no critical files are involved, but that is not an absolute. So, pay attention to what fsck is clearing and don't just blindly type 'Y' to its queries. Then, when you have a clean filesystem, take it back to your Dockstar and see if it boots. If you cleaned it correctly, and have lost no critical files, it should. If not, well, you did back up that file system at some point, didn't you?

And, make sure the fs-type is specified in /etc/fstab. I have found that if it is not specified, or specified generically as "rootfs", the system runs fine, but the kernel can't keep the file system properly synced and corruption will be present when the system is rebooted.

As far as booting the Dockstar from its default NAND Linux, I suspect as you found out that it is acquiring a different IP address. If you know how to query your DHCP server, you should be able to get that address without scouring the entire address range for it. (If you have no DHCP server, it will default to a special IP address based on its MAC address.)

Good luck.
Re: Can't obtain an IP address
March 14, 2011 06:24PM
Hey restamp, thanks for your answer.
Regarding file system corruption, I've already made a fsck of root partition on my arch box. this has already saved me a couple of time. but not this time. I've also tried to boot with a working usb stick (it's not properly a backup..it's the original one. the root partition on my drive has been cloned from this stick) with the same result (kernel starts but it doesn't seem to terminate its boot procedure)

Anyway I'm not really worried about the debian stuff. I would easily reinstall and reconfigure it in a while.
I'm worried about the pogoplug OS that isn't able to obtain an ip from the dhcp server on my netgear router (can't query this dhcp server. I only know that the dockstar isn't present anymore in the list of "attached devices" of my network)
The only way to reach pogoplug is to SSH that "special" ip address that you described at the end of your post. But then I'm in pogoplug without a internet connection because eth0 is plugged to my own PC. And here's where i'm stuck!

What i'm thinking is:
I can see the device booting with
 nc -l -u -p 6666 
after I did
fw_setenv serverip 192.168.0.9
(my own pc) and
fw_setenv ipaddr 192.168.0.8
so uboot do succesfully connect to my network.

Why pogoplug does not?! is the NAND corrupted as well?

I'm, at the moment, afraid to do something irreparable and brick it completely!
I hope to be as clear as possible. My "italianized" english doesn't help me so much :)
Thanks again.



Edited 1 time(s). Last edit at 03/14/2011 06:37PM by eltommi.
Re: Can't obtain an IP address
March 14, 2011 07:25PM
eltommi, your English is fine. It is unlikely that a power failure has corrupted the NAND memory. Honestly, I would suspect some problem with your DHCP server, since both the Dockstar internal Linux and the Debian load both seem to be unable to get a dynamic IP address, yet netconsole is capable of using the same ethernet connection to pass packets to your PC.

I suppose if this were me:

1. If I had the ability to add a real console to the Dockstar, I would do so, so that I could see what is happening.
2. I might try pulling the drive, mounting it on my PC, and altering the /etc/network/interfaces file to give it a static IP address.
3. You could try invoking a script to wait and then dump some information to disk to try to fathom what is going on, and then sync and halt. I must admit I've been tempted, but I've never done this myself.

The only other thing I can suggest is if your Dockstar's MAC address has ever changed -- either you've tried booting it on another Dockstar, or you've changed it in the uBoot, then by default Debian will assign a new device to the ethernet, which will cause it to break. If so, you need to make the following changes:
Fix to allow thumbdrive to be moved from one Dockstar to another:
http://forum.doozan.com/read.php?3,323,2038#msg-2038
# vi /etc/udev/rules.d/70-persistent-net.rules
        /* comment out line: SUBSYSTEM=="net",...NAME="eth0" */
# vi /lib/udev/rules.d/75-persistent-net-generator.rules
        /* change line: KERNEL!="eth*...  to  KERNEL!="Eth*... */

One more possibility: You said your device was running OK until you had a power failure. During the time it was running did you make any changes to any system files? If so, this may be the cause.

But, neither of these explain why the internal OS appears similarly affected.

Good luck. Let us know if you figure it out.
Re: Can't obtain an IP address
March 15, 2011 06:05AM
I'm going to try to use an old router to check the dhcp or better to create a dhcp server on my pc with capabilities of logging what's happening there.
The other step will be to try to set a static IP for debian and/or pogoplug OS.
Eventually, if I'm still at the same situation, I'll buy a serial cable! I've never use something like that. It's time to learn though.


p.s. MAC address is the same as the one written under the dockstar, so it hasn't changed
p.p.s. before the power failure dockstar was running since some days. As far as I remember, I didn't change anything lately..only, for example, enabled an apache web server or set a subsonic server..nothing regarding system files.

Thanks again for routing me in some (hopefully good) directions..I'll try to fix it and I'll let you know!

Regards
Re: Can't obtain an IP address
March 15, 2011 08:39AM
DHCP server of router has gone crazy. That was the problem. I was scared about nothing!Other router made it work at the first attempt.. I managed to make it obtaining an ip address playing with (my new) router configuration.

Debian keep being unusable though..but that's another fact, and I'll manage to make it work in some way!

I would like to take advantage of your kindness and experience to ask you why I suffered of severals fs corruption using the dockstar and almost never with my PC (same ext4 filesystem). Is the usb connection of the external hard drive guilty of this?

Now i've seen that fs type of / in /etc/fstab has been changed from ext4 back to ext2.. I swear I didn't change it!! fsck did? or perhaps i'm a sleepwalker that change file system type during the night.

It still doesn't boot, I will figure out where the problem is..this is totally not about UBoot section :) Thank you again for your time.

Tommaso.
Re: Can't obtain an IP address
March 15, 2011 02:51PM
Glad you found the DHCP problem with your router, Tommaso. With regards to file system corruption, fsck would not have modified your /etc/fstab, but the OS will remount the file system in the mode specified there. Actually, mounting an ext3 file system (and probably ext4) as an ext2 should work OK. You'll just lose the benefit of the journal. For actual disk devices, I use ext3. ext4 is probably fine, but not all my Linux boxes recognize it yet, which makes it hard to use ext4 file systems universally. For static memory devices, I prefer ext2, since it has reduced disk writes. One problem with ext2, though, is that it seems more susceptible to corruption in power-fail type situations. On my Dockstar, /dev/root points to the root device, and I have the following in my /etc/fstab:
# <device> <mnt pt> <type>  <options>                             <dump> <pass>
/dev/root   /        ext3    relatime,errors=remount-ro               0      1
Hope this helps.
Re: Can't obtain an IP address
March 15, 2011 04:08PM
Mine
/dev/root / ext2(4?) noatime,errors=remount-ro 0 1

I've been persuaded to use ext4 almost everywhere by several devs of Galaxy S, looking for a good replacement for the poor vfat based RFS, in the Samsung phone with kernel linux. It has been concluded that ext4 should be a good compromise between speed and the avoid data corruption. Not having compatibility problems, I use it, as I said before, almost everywhere, in my phone too!!
I'll never know about this debian trouble though.
System was reasonably young and it has been erased. Surfing the web I've found the arch based (I love it) PlugApps linux, and now I'm playing with that.

This 36€ toy really satisfies my little spare time
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: