Shutdown of v4 corrupts bootloader?

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

Shutdown of v4 corrupts bootloader?

Postby whytcolr » Tue Feb 11, 2014 7:03 pm

I have a Pogoplug V4 and followed the instructions here: http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 to install. Everything went swimmingly and I got Arch installed and working on an 8GB Kingston DT Micro USB stick. I can issue the command "/sbin/reboot" and the thing will reboot back into Arch, but "shutdown -h" and "poweroff" both fail. After issuing either command, the LED never turns off (and remains solid green). After waiting 15-30 minutes, I pulled the power. Plugging back in results in flashing green.

I can recover by putting in another USB stick with the "revert" folder, and in order to get it to boot back into Arch, I have to reinstall u-boot (using ppv4-install.sh). After /sbin/reboot, it boots back into Arch. This works every time... Any ideas why is u-boot failing to boot to the USB stick after power off? The USB stick doesn't seem to be corrupted, as I don't need to do anything to it and it is recognized by another linux machine. (For what its worth, I've tried 2 other usb sticks besides the DT Micro, and have had the same issue with all of them.)
whytcolr
 
Posts: 4
Joined: Tue Feb 11, 2014 6:47 pm

Re: Shutdown of v4 corrupts bootloader?

Postby Sergeanter » Wed Feb 12, 2014 5:41 pm

I do not think there is an easy way to corrupt a bootloader in rom. What happens is filesystem gets corrupted. PC linux will see and mount the stick, but if you run e2fsck -f on it ( after umount) , you will see orphaned inodes etc. At least for me it fixes the problem every time.
Shutdown does not turn the led off on V4 AFAIK. See my other posts for a script to attach clean shutdown to eject button. That script controls the led. I think if you go through the system of services and targets etc. on Archlinux, you can attach led states to system states.I may try it later.
What we need is to activate initial ramdisk (uInitrd) so that it would check f/s at boot time.
Sergeanter
 
Posts: 87
Joined: Wed Oct 02, 2013 5:14 am

Re: Shutdown of v4 corrupts bootloader?

Postby whytcolr » Thu Feb 13, 2014 5:09 am

That's the strange thing though... The filesystem doesn't seem to be corrupted...

Just for shits and giggles, I installed Arch on another stick, using a puppy Linux liveCD, to be sure that the stick wasn't corrupted... Sure enough, it wouldn't boot. So I reverted the pogo... Then I popped the new stick in and rebooted (stock boot)... Then I installed u-boot and rebooted. And it booted into Arch with no worries. (Now that I've typed that out, the thought strikes me that the fs could have corrupted the first time it wouldn't boot... But that doesn't help because it means that the pogo is corrupting the stick everytime it powers up.) I'll see if e2fsck -f finds anything.

Perhaps u-boot isn't initializing USB on powerup after I shutdown? Or maybe it is expecting the root filesystem in a different place than sda1? I think I may try a SATA drive tomorrow to see if this happens with a different bus... I'll also see what I can do with that script!
whytcolr
 
Posts: 4
Joined: Tue Feb 11, 2014 6:47 pm

Re: Shutdown of v4 corrupts bootloader?

Postby moonman » Thu Feb 13, 2014 6:33 am

Run "sync" a couple of times right before you shut it off. Flash drives are fairly slow so maybe it doesn't have enough time to flush buffers to the drive when you shut it off
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Shutdown of v4 corrupts bootloader?

Postby whytcolr » Thu Feb 13, 2014 12:54 pm

I thought maybe I was being impatient, so I shutdown last night and left it for several hours. This morning, I cycled the power and... Blinky green. ARGHHH!

Pulled the power, yanked the stick and put it in the aforementioned puppy linux machine.

# e2fsck -f /dev/sdb1
e2fsck 1.42.6 (21-Sep-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
ROOTFS: 27273/480496 files (0.6% non-contiguous), 181831/1919264 blocks

After I re-installed u-boot on the pogo, everything works. I'm going to try a SATA drive.
whytcolr
 
Posts: 4
Joined: Tue Feb 11, 2014 6:47 pm

Re: Shutdown of v4 corrupts bootloader?

Postby whytcolr » Thu Feb 13, 2014 2:15 pm

The plot thickens...

I'm not sure if this is the recommended configuration while using a SATA drive, but I put a 50GB ext3 partition on it and unziped the arch install to that partition. Nothing fancy...

SATA works perfectly... Reboot -- no problem. Power off, no problem. Everything's golden.

Shutdown and pop in the USB. No go. Blinky light. If I put in both, and wait a long time, it will boot to the SATA drive. (Blinky green for at least 5 minutes.)

Any guesses on what's happening here, and especially how to fix it?
whytcolr
 
Posts: 4
Joined: Tue Feb 11, 2014 6:47 pm

Re: Shutdown of v4 corrupts bootloader?

Postby tedm » Thu Feb 13, 2014 5:31 pm

I have the older seagate dockstar pogo, which doesn't have sata, and have had similar shutdown problems, but almost always found to be corrupting the usb stick, not the u-boot.

The way I figure this, is that upon re-installing from fresh, the u-boot code mentions that it is intact and I don't need to reinstall (but I do anyways).

Before the latest install and ext3, 2011-ish? the default format for u-boot and main storage were ext2 and dmesg output would show if a stick was starting to fail, with more error messages coming. An 8GB PNY stick worked for a few months, then slowly failed and died.

The last year, I've had a sandisk 16gb stick, but it's been ext3 from the beginning. I haven't seen many mentions of the u-boot code getting corrupted other than your issue, so I hope that your hardware is ok.

I'm looking forward to good solid shutdown methods as well, as shutting down and restarting is an art with these, and at one time, when I absolutely needed it to run, I was moving it around with a dedicated router, missing out on the small form factor size.
tedm
 
Posts: 88
Joined: Tue Jan 01, 2013 1:12 am

Re: Shutdown of v4 corrupts bootloader?

Postby dwentz » Thu Feb 13, 2014 5:32 pm

I have fought with this also, and what I found was that the SanDisk Cruzer thumb drives do not exhibit this problem. I have other thumb drives that would boot the first time and then never boot again. I have 2 v4's here and they both do the same thing. Buy they work every time on the Cruzers. If I take the other drives to my linux system they show a clean file system, so I have no idea what is going on.

I had two older 8 GB cruzers that have worked 100% of the time even after just pulling the power off the thing. I ordered a new 4GB drive to test from amazon "SanDisk Cruzer 4 GB USB Flash Drive (SDCZ36-004G-AFFP)" and it works well also.
I Also have tried some new Kingston drives I had here and they all fail after the first or 2nd shutdown. In fact I have one that I can not get to work even if I reformat it and install Arch on it. So stick with the cruzers and you should not have a problem.

Dale
dwentz
 
Posts: 1
Joined: Thu Feb 13, 2014 5:19 pm

Re: Shutdown of v4 corrupts bootloader?

Postby tedm » Thu Feb 13, 2014 5:51 pm

I think my sandisk is a cruzer, the small black ones with the mini amber led? I will probably get another 16 or 32 just for the pogo.

Before the systemd switch, one user recommended doing a shutdown -r now, and pulling the power off during the pogo's amber blinking (on that device, he was pretty sure it was in the u-boot code and not usb stick), and was able to safely powerback on with nothing corrupted.

However, after first moving to the systemd archlinuxarm, I was told not to use shutdown, but poweroff, halt, or systemctl poweroff, so haven't used shutdown commands since, and I'm not sure the blinking amber mode is always safe, and if he were a second too early or late, it could be trouble, so I'm not liking that method much.
tedm
 
Posts: 88
Joined: Tue Jan 01, 2013 1:12 am

Re: Shutdown of v4 corrupts bootloader?

Postby pepedog » Thu Feb 13, 2014 6:30 pm

Don't keep messing with uboot, you will wear it out.
Best way to shut down is $this->bbcode_second_pass_code('', 'sync && poweroff')
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Next

Return to ARMv5

Who is online

Users browsing this forum: No registered users and 28 guests