Welcome! Log In Create A New Profile

Advanced

[SOLVED] How to mount SATA ports on GoFlex Net STAK100?

Posted by rcaron 
[SOLVED] How to mount SATA ports on GoFlex Net STAK100?
August 15, 2011 10:54PM
Is there a kernel out there that allows one to mount drives attached to the SATA ports?

I am not interested in booting from them, just use them as a software RAID for data backups. Everything I've been able to find on the forum thus far implies booting, which involves changes to uBoot etc that I'd rather avoid.

I have a USB drive acting as a root partition, with Jeff's standard squeeze install on it and the rescue on the NAND data.



Edited 2 time(s). Last edit at 08/18/2011 12:57AM by rcaron.
Re: How to mount SATA ports on GoFlex Net STAK100??
August 16, 2011 01:46AM
I had compiled a Kernel with SATA Support for the GoFlex Net.

Quote

wget http://www.varkey.in/files/linux-image-2.6.37.6-goflex_1.0_armel.deb

dpkg -i linux-image-2.6.37.6-goflex_1.0_armel.deb

cd /boot

# Create the images for uBoot

/usr/bin/mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-2.6.37.6 -d /boot/vmlinuz-2.6.37.6-goflex /boot/uImage
/usr/bin/mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs -d /boot/initrd.img-2.6.37.6-goflex /boot/uInitrd

After installation, you need to change the Arch Number to 3089 to enable the SATA ports.

http://www.varkey.in/2011/06/boot-debian-from-sata-seagate-goflex-net/
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 02:23AM
A huge step in the right direction. mdadm is now syncing the disks.

Problem is that it does not boot properly when the disks are inserted. I have to remove them, wait for it to boot, and then plug in the disks. I'm guessing the root partition is getting lost somewhere along the line? Drive order?
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 03:22AM
Hi everyone,

I have the exact same problem with my GoFlex Net and a SATA hard drive: you have to wait till the end of boot, then you can plug the disk. That's annoying when you need to remotely reboot.

I've checked the uBoot sequence and it seems that everything goes find, it even prints "Starting kernel" at the end. After booting, the led is green but the device is not reachable.

Same conf than rcaron: squeeze on a USB stick, rescue on the NAND, varkey's 2.6.37.6 kernel.

Any ideas? Thanks!
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 07:05AM
I think its because the SATA ports gets initialised first and gets assigned sda and in case of Jeff's uBoot the root partition is explicitly given as /dev/sda1

I think if you use the LABEL option it might work.

Try this -- http://forum.doozan.com/read.php?2,5233,5334#msg-5334
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 09:43AM
Yes! Please try passing the kernel the root as a LABEL. I'm very curious to know if this will work around this annoyance with the GoFlex Net. It works fine with my Dockstar so I'm pretty sure it'll work for the GoFlex Net. You can test it out safely with either serial console or net console access. The procedure outlined at the bottom of that thread is non permanent.
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 01:49PM
Thanks for your answers. I just tried this and it doesn't solve the issue unfortunately...

When I run printenv bootargs I get exactly the same output than you do with cat /proc/cmdline kraqh3d (except that my rootfs is ext2):

console=ttyS0,115200 root=LABEL=ROOTFS rootdelay=10 rootfstype=ext2 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)

Maybe there's a parameter to set in the kernel?



Edited 1 time(s). Last edit at 08/17/2011 01:50PM by darkoo.
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 03:23PM
Did you set the set label of your root partition to ROOTFS?

ls -lF /dev/disk/by-label

This should work as this is how all the major distro's boot. They pass the kernel a root parameter that specifies either a LABEL or UUID, and then the kernel lets the initrd resolve it to a device via /dev/disk/by-label or /dev/disk/by-uuid.

We can extract the initrd image and see. It should be in the root init script.
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 04:04PM
Oops, my mistake...

Indeed it works like a charm! To make it permanent, I just have to use saveenv instead of setenv for command setenv usb_root LABEL=ROOTFS?

Anyway, thanks for your help and reactivity!

Edit: Ok, apparently you need to issue saveenv after setenv usb_root ... to write the variable to the NAND, but it doesn't seem to be permanent either...



Edited 2 time(s). Last edit at 08/17/2011 04:22PM by darkoo.
Re: How to mount SATA ports on GoFlex Net STAK100??
August 17, 2011 07:39PM
Good. I extracted the kirkwood initrd for giggles. It's got the same init script as the stock 686 initrd. I would've been surprised if it didn't work.

You can't just change usb_root and save the environment. The problem is that it gets modified when usb_scan is run. The easiest way to make it permanent is to modify the usb_init line.

It defaults to:
usb_init=run usb_scan

so change it with this:
fw_setenv usb_init "run usb_scan; setenv usb_root LABEL=ROOTFS"

You need to run usb_scan as that finds the kernel and sets usb_device which is required to actually load the kernel. But it also tries to assume what the linux kernel device name for that usb device would be and passes that to the kernel as the root parameter.

I don't have a GoFlex. Your uBoot script may be different than what's in my Dockstar. Post your fw_printenv output. There may be a better place to make this permanent.



Edited 5 time(s). Last edit at 08/17/2011 08:13PM by kraqh3d.
Re: How to mount SATA ports on GoFlex Net STAK100??
August 18, 2011 12:56AM
Success. From a fresh squeeze install using Jeff's standard script, my steps from start to finish were:

  1. boot with just flash drive installed
  2. wget http://www.varkey.in/files/linux-image-2.6.37.6-goflex_1.0_armel.deb
  3. dpkg -i linux-image-2.6.37.6-goflex_1.0_armel.deb
  4. cd /boot
  5. /usr/bin/mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-2.6.37.6 -d /boot/vmlinuz-2.6.37.6-goflex /boot/uImage
  6. /usr/bin/mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs -d /boot/initrd.img-2.6.37.6-goflex /boot/uInitrd
  7. reboot (still just flash drive)
  8. fw_setenv arcNumber 3089
  9. e2label /dev/sda1 ROOTFS
  10. fw_setenv usb_init "run usb_scan; setenv usb_root LABEL=ROOTFS"
  11. power down and install drive(s)
  12. power up

Huge thanks to varkey and kraqh3d. I can now leave my two SATA drives installed and I get successful cold and warm boots to the flash drive.


For those looking to setup mdadm, I should note that the array doesn't always show up as /dev/md0. I ended up labeling that too and putting the label in the fstab.
Re: How to mount SATA ports on GoFlex Net STAK100??
August 18, 2011 02:23AM
Yes many thanks to you varkey and kraqh3d!!

Yesterday I finally managed to make it permanent by modifying usb_scan line. But this is cleaner with your solution kraqh3d.

My device boots even with the SATA drive plugged in now! Thanks again.
Re: How to mount SATA ports on GoFlex Net STAK100??
March 24, 2012 07:33PM
@ varkey, if you are around... had anyone posted/commented on booting the stock Debian kernel w/ machid set to 0xa76 since the eSATA Guruplug is kind of close?

Granted the LED's don't do do much, but USB and SATA booting both work (at least w/ the u-boot I'm testing).
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: