Guruplug Server Plus — Booting from eSATA

Ive been doing a lot of testing with the guruplug plus lately. Since this thing is a loaner I dont want to make changes to the default settings if I dont have to. This has led me to do all my testing on USB thumbdrives, and on eSATA connected drives. This is a pretty simple thing to setup. Below I will walk you through what you need to do in order to boot from an eSATA connected device.

Pogoplug Multimedia Sharing Device – Gray
Linux Server Hacks

The first thing you need to is get connected to the guruplug through the jtag connector. Instructions for connecting using the jtag connector can be found here. Once connected power up the guru plug and allow it to boot up. Log in as the root user. If you have not yet, plug in and power up your eSATA drive. When I plugged mine in I got the following:

sheevaplug-debian:~# ata1: exception Emask 0x10 SAct 0x0 SErr 0x4010000 action 0xe frozen
ata1: edma_err_cause=00000010 pp_flags=00000000, dev connect
ata1: SError: { PHYRdyChg DevExch }
ata1: hard resetting link
ata1: link is slow to respond, please be patient (ready=0)
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl F300)
ata1.00: ATA-7: WDC WD2000JS-00MHB0, 02.01C03, max UDMA/133
ata1.00: 390721968 sectors, multi 0: LBA48
ata1.00: configured for UDMA/133
ata1: EH complete
scsi 0:0:0:0: Direct-Access ATA WDC WD2000JS-00M 02.0 PQ: 0 ANSI: 5
sd 0:0:0:0: Attached scsi generic sg2 type 0
sd 0:0:0:0: [sdc] 390721968 512-byte logical blocks: (200 GB/186 GiB)
sd 0:0:0:0: [sdc] Write Protect is off
sd 0:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUA
sdc: sdc1
sd 0:0:0:0: [sdc] Attached SCSI disk

Next I need to create a partition on my disk. Normally I would use fdisk for this task but when I try I get:
sheevaplug-debian:~# fdisk /dev/sdc

WARNING: GPT (GUID Partition Table) detected on ‘/dev/sdc’! The util fdisk doesn’t support GPT. Use GNU Parted.

This means I need to install parted.
apt-get install parted
Next I can get a partition set up.
parted /dev/sdc
Now I already have 1 partition on this drive. We can see that by typing print
parted /dev/sdc

GNU Parted 1.8.8
Using /dev/sdc
Welcome to GNU Parted! Type ‘help’ to view a list of commands.

(parted) print

Model: ATA WDC WD2000JS-00M (scsi)
Disk /dev/sdc: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 17.4kB 10.2GB 10.2GB ext2 primary boot

I dont want to mess with this first partition so Im going to make a new one. The first partition was created from 0 to 10240 so I need to go from 10241 to 20481 to make another 10.2G partition.
(parted) mkpart primary ext2 10241 20481
(parted) print

Model: ATA WDC WD2000JS-00M (scsi)
Disk /dev/sdc: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 17.4kB 10.2GB 10.2GB ext2 primary boot
2 10.2GB 20.5GB 10.2GB ext3 primary

Next I want to toggle the boot flag so I type toggle and hit enter
(parted) toggle

Partition number? 2
Flag to Invert? boot/hidden/raid/lvm/hp-service/msftres/bios_grub? boot

(parted) print

Model: ATA WDC WD2000JS-00M (scsi)
Disk /dev/sdc: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 17.4kB 10.2GB 10.2GB ext2 primary boot
2 10.2GB 20.5GB 10.2GB ext3 primary boot

OK. Now Ill type q to quit, and then make a file system on the new partition.
mke2fs /dev/sdc2

… … …
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Now to mount this new partition.
mount /dev/sdc2 /media/usb1/
Now a couple of cp commands will fill this disk with everything you need. This first cp will take a few minutes go grab a drink or something…
cp -avp / /media/usb1
Now to grab dev too. If you look in /media/usb1/dev you will notice it is empty. This would cause a kernel panic if we tried to boot into it now.
cp -ax /dev/ /media/usb1/
Now we are just about ready to reboot and start using our eSATA disk. All we need to do now is to give this new system a different name than the default install so its easy to tell them apart. To do this simply edit a configuration file.
echo "errr-esata" > /media/usb1/etc/hostname
Now we are ready to reboot. Type reboot and wait for the Marvell count down to appear and hit any key to stop the autoboot.
Now at the Marvell command prompt type
set x_bootargs_root root=/dev/sdc2 rootdelay=10
Be sure to use the correct root= line for your drive. This may be sda1 or sdb1 or even sdc1.
Next type boot and hit enter
If you get a kernel panic like so:

VFS: Cannot open root device “sdc2” or unknown-block(8,34)
Please append a correct “root=” boot option; here are the available partitions:
1f00 1024 mtdblock0 (driver?)
1f01 4096 mtdblock1 (driver?)
1f02 519168 mtdblock2 (driver?)
0800 195360984 sda driver: sd
0801 9999983 sda1
0802 10000976 sda2
Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(8,34)
[] (unwind_backtrace+0x0/0xd4) from [] (panic+0x48/0x134)
[] (panic+0x48/0x134) from [] (mount_block_root+0x1c4/0x20c)
[] (mount_block_root+0x1c4/0x20c) from [] (prepare_namespace+0x168/0x1cc)
[] (prepare_namespace+0x168/0x1cc) from [] (kernel_init+0xd4/0x108)
[] (kernel_init+0xd4/0x108) from [] (kernel_thread_exit+0x0/0x8)

This means that you have told Marvell to boot from the wrong partition. In this case its telling me that sdc2 is unknown but it shows me there is an sda1 and sda2 so Im going to try sda2 instead.
Next you will get to this:

Bluetooth: vendor=0x2df, device=0x9105, class=255, fn=2
btmrvl_sdio mmc0:0001:2: firmware: requesting sd8688_helper.bin
btmrvl_sdio_download_helper: request_firmware(helper) failed, error code = -2
btmrvl_sdio_download_fw: Failed to download helper!
btmrvl_sdio_probe: Downloading firmware failed!

This same thing happens every time on the default file system too it just blows past it instead of waiting.. You can hit ctrl+c here or just wait and it will go on past.
Once it has finished booting we will see we are on our eSATA drive by looking at its host name:

Bluetooth: SCO (Voice Link) ver 0.6
Bluetooth: SCO socket layer initialized
Agent registered

Debian GNU/Linux 5.0 errr-esata ttyS0

errr-esata login:

Now I can log in and do what ever to this system and when I reboot unless I intervene it will boot back up in default mode on the default internal flash drive, since what we have done here doesnt last a reboot. I hope this helps some of you out there.

Guru Plug Server Plus — My First Look

So my boss Robert got a Guru Plug Server Plus, and to my great surprise and joy he sent it home with me to play with. Getting connected to it was simple, once it was plugged in it showed up in my wireless access point list on windows.
guruplug-wap-win
Pogoplug Multimedia Sharing Device

Once connected to the access point I got my network info and tried to ssh to the gateway. I was able to log in as root with a clever default root password. I was greeted with a familiar sight. guruplug-first-boot
Debian GNU/Linux 5.0 I connected the device to the internet and tried to apt-get update but found that didnt work. In the /etc/apt/sources.list file there was an entry for a private internal mirror. I had to comment that out and ran dpkg –configure -a since the system suggested it. Once I did that apt-get update worked and so I did an apt-get upgrade Upgraded everything that needed it. Next I installed less, and ntp. I went through the list of pre installed packages, it was pretty long. Some of the packages that stood out were Lighttpd, PERL, PHP5, Python 2.5, MySQL server and client, exim4, udhcpd, and samba 3.2.5. So for dirt you get a pretty powerful cheap ready to rock LAMP stack and File server and Wireless AP. Not so shabby. This puppy supports booting using all kinds of methods. If you are connected to it though the JTAG you will have the option to keep the system from booting. You will be given a prompt:
Hit any key to stop autoboot: 0
Marvell>> help

This will return a nice long list of options. You can choose between USB, TFTP, NFS, and many others. Im looking forward to the next couple of days of playing. I want to try out quagga and maybe asterisk. Check back soon for an update of what I do.