Nicolas314

All my geeky stuff ends up here. Mostly Unix-related

Posts Tagged ‘dockstar

Seagate dockstar rescue tips

leave a comment »

Seagate dockstar freeagent

Seagate dockstar freeagent

My Seagate dockstar freeagent (shortnamed: dock) has recently received a brand new hard disk to cope with my large data needs. dock has been serving me so well over the past months that I decided to entrust the new disk with the complete operating system (Debian) and let it run from there. Little did I know that the brand new hard disk would fail miserably one week later, taking away my only copy of Debian for dockstar. Now I do you unbrick these things again? I spent a couple of nights hunting for information and performing experiments so will document that and leave it here in case it may be useful to someone else.

The boot system

Dockstar is an ARM-based micro-computer with a very interesting feature: the whole boot system resides in flash memory. No grub, no LILO, no messing around with the boot sector every time you upgrade the kernel. Only problem is: out of the box the default dockstar only tries to boot its own PogoPlug system and nothing else. First thing you want to do is replace your stock flash boot by his.

Update uBoot on your Dockstar

In my case I happened to have fried the default Pogoplug installation on dock. I believe this happened when I mounted the flash partition from Debian as jffs2 filesystems. For some reason this corrupted everything on partitions /dev/mtd[123] and I could not recover them from old backups. Fortunately I did not try to mount /dev/mtd0, which is probably what saved Jeff’s boot sequence.

Another excellent point for the dockstar boot sequence is the Marvell bootloader installed in ROM on the device (this one cannot be fried). This is by far the most powerful and user-friendly boot system I have ever seen. You can get the OS from any connected device, from the network, over tftp, you name it. Commands are nicely documented and it is a pleasure to navigate. The only point is: if you want to have a chance to catch the boot sequence while the machine is loading, you need to connect a JTAG cable as there is no video card onboard. Quite unfriendly. The other solution is to ask the boot software to communicate with another machine on the same network. This is achieved by setting a few configuration variables and is completely described here:

Use netconsole to troubleshoot uBoot without a serial cable

You will see incoming console text and will be able to take over the boot sequence from a simple netcat. I cannot recommend enough that you do this before anything bad happens; finding a JTAG cable in the middle of the night is not always easy. Once you have configured dock for netconsole and made sure you use Jeff’s boot system, you should be on the safe side.

Rescue systems

Just in case you end up with no bootable drive as I did, you may want to keep a couple of files handy. Johannes explained on Jeff’s forum how to boot from tftp in this post:

Rescue system for use with USB stick and tftp

I would also recommend to go one step beyond and replace your PogoPlug installation by a real rescue system. Jeff again offers a complete downloadable system that will make sure your dockstar always boots on something even with no network (and netconsole) or USB drives attached.

Recovery system ready for use

Installing Debian

The easiest way to prepare a hard disk for Debian on the ARM-based Dockstar is to boot from it into a minimal system, hook up the destination hard drive and bootstrap Debian from there using debootstrap. This is exactly what Jeff put together on this page:

Run Linux on your Dockstar

Theoretically you could prepare the same hard drive from a very standard PC but debootstrap unfortunately does not support (yet) cross-platform installation. The only way to do that from an x86 or x64 PC would be to run an ARM emulator and run debootstrap from there, using your hard drive as a target. I tried using qemu in ARM mode but got some weird errors and gave up after many tries. If you want to avoid having to become an expert about cross-compilation, better make sure you can boot your dockstar and run the install from there.

As a beautiful side-effect: if you ever decide to move the dockstar Debian to another disk, no need for dd and gparted magic. A simple ‘cp -ar’ can do the trick since you do not have to deal with boot software on the boot sector or such things.

Executive summary

  • Do not mount /dev/mtd* under a running Debian. This fscked my flash partitions and restoring with dd proved useless
  • Flash your /dev/mtd0 with Jeff’s replacement. Do it now!
  • Activate netconsole so you can take over from another PC on the same network
  • Replace your default PogoPlug with a real rescue system

Putting the boot loader/manager in flash is a brilliant idea, I wish standard PCs had moved to such an option earlier. The Marvell bootloader is especially versatile with a surprisingly rich online help and excellent capabilities. The booting part is often neglectd by hardware vendors but it proves to make the difference between an expensive plastic brick and usable hardware.

A million thanks to Jeff Doozan for making his knowledge available and accessible!

Advertisements

Written by nicolas314

Monday 7 March 2011 at 12:32 am

Posted in Debian, dockstar, Unix

Tagged with , , , , ,