Welcome! Log In Create A New Profile

Advanced

Goflex Home - Installed uBoot and Debian but now stuck

Posted by ador 
Goflex Home - Installed uBoot and Debian but now stuck
November 21, 2020 09:25AM
Hello and huge thanks for all your work.

I have an old GoFlex Home that was hacked and I decided to install alternative fw which eventually led me to this forum.

I followed the two main tutorials:

https://forum.doozan.com/read.php?3,12381

and

https://forum.doozan.com/read.php?2,12096 (followed the instructions under 25 Aug 2019 as indicated)

Initially, all went relatively well, netconsole was working and I was able to ssh to the new debian installation!
My old HDD could not be mount though. netconsole reported:
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **

So I started researching what I could do.

In the meantime I decided to do:
sudo apt-get upgrade

During that I got:
update-initramfs: Generating /boot/initrd.img-5.2.9-kirkwood-tld-1

So I issued:
cd /boot
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-5.2.9-kirkwood-tld-1 -d initrd.img-5.2.9-kirkwood-tld-1 uInitrd

on another terminal which I already had open (and without yet rebooting), I also tried installing testdisk to try and figure out what was wrong with the HDD.
I again got:

update-initramfs: Generating /boot/initrd.img-5.2.9-kirkwood-tld-1

So I figured I would again need to regenerate the uInitrd boot file::
cd /boot
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-5.2.9-kirkwood-tld-1 -d initrd.img-5.2.9-kirkwood-tld-1 uInitrd

then I rebooted... The usb stick was somehow corrupt(?) and on netconsole I saw that the usb could not be recognised.
I took the usb stick to another linux machine and there it couldn't be mounted and fdisk was reporting a readonly fs and 1TB space!

Anyway then I got a fresh usb stick and followed the 25 Aug 2019 instructions of https://forum.doozan.com/read.php?2,12096
Now on netconsole I see:
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot:  0
Initializing devices...
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices...
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST3000DM001-9YN166 Firm: CC9F Ser#: S1F13FQH
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
Unknown command 'mmc' - try 'help'
Loading envs from usb 0...
** File not found /boot/uEnv.txt **
Loading envs from usb 1...
** Bad device usb 1 **
Loading envs from usb 2...
** Bad device usb 2 **
Loading envs from usb 3...
** Bad device usb 3 **
Loading envs from ide 0...
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Loading envs from ide 1...
** Bad device ide 1 **
Loading envs from ide 2...
** Bad device ide 2 **
Loading envs from ide 3...
** Bad device ide 3 **
Loading envs from mmc 0...
** Bad device mmc 0 **
Loading envs from mmc 1...
** Bad device mmc 1 **
Loading envs from mmc 2...
** Bad device mmc 2 **
Loading envs from mmc 3...
** Bad device mmc 3 **
running scan_disk ...
Scan device usb
device usb 0:1
loading 1 bytes read in 723 ms (0 Bytes/s)
Found bootable drive on usb 0
uImage ...
4973929 bytes read in 1013 ms (4.7 MiB/s)
loading uInitrd ...
9713936 bytes read in 930 ms (10 MiB/s)
loading DTB /boot/dts/kirkwood-goflexhome.dtb ...
10249 bytes read in 3260 ms (2.9 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Created:      2020-11-21  15:02:53 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4973865 Bytes = 4.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:50 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes = 9.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
Starting kernel ...

But the goflex does not answer to ping or to ssh.

Here is my printenv from netconsole:
GoFlexHome> printenv
printenv
arcNumber=3338
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-goflexhome.dtb
ethact=egiga0
ethaddr=00:10:75:2E:B0:52
if_netconsole=ping $serverip
ipaddr=192.168.2.243
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
nc_ready=1
ncip=192.168.2.116
partition=nand0,2
preboot=run preboot_nc
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.2.116
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=echo Initializing devices...; setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
usb_ready_retry=15

Environment size: 3039/131068 bytes



Sorry for the long post but I thought it would help to report all the details to help you guys help me :)
Re: Goflex Home - Installed uBoot and Debian but now stuck
November 21, 2020 04:47PM
ador,

The kernel has booted, but with netconsole, the output stops after this:

> Starting kernel ...

So there is no way to tell if it has completed booting in to Debian (i.e. mounted rootfs).

> But the goflex does not answer to ping or to ssh.

Wait for a while and see if you can find a new IP address in the network (in your router). For use IOS Fing, or Linux nmap to find it.

Another option is

ping debian.local


=====

If you still cannot find the GF Home in the network, and without serial console, the best next step is to revisit how you created the rootfs. You can recreate it again and post the session here.

One thing to pay attention to is with the new 2017.07 u-boot, you must skip Step 4 in the rootfs creation:

Quote


4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Do not do this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts for the exact spelling of your Kirkwood box name).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-5.2.9-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d zImage.fdt uImage
sync

If your Linux box does not have mkimage, then install it

apt-get install u-boot-tools

So if Step 4 was done, then now you need to reverse it:
cp -a uImage.orig uImage

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex Home - Installed uBoot and Debian but now stuck
November 22, 2020 11:49AM
Hello bodhi, thank you for taking the time to reply.

I just now tried booting without the HDD on the board and I was able to ssh to debian...
So it seems that the failure to mount the HDD was preventing the proper boot to debian... ?
Does that make sense?

So now on to my next problem, which is why does the hdd appear as "Unrecognized filesystem type"?

printenv reports:

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST3000DM001-9YN166 Firm: CC9F Ser#: S1F13FQH
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
Unknown command 'mmc' - try 'help'

and then:

Loading envs from ide 0...
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **

Is there any way to mount this drive on the newly updated goflexhome?
Should I take it on another pc and try to see if it is detected/mounted?
Re: Goflex Home - Installed uBoot and Debian but now stuck
November 22, 2020 04:04PM
ador,


> Failed to mount ext2 filesystem...
> ** Unrecognized filesystem type **

> Is there any way to mount this drive on the newly
> updated goflexhome?
> Should I take it on another pc and try to see if
> it is detected/mounted?

Since you can boot with USB rootfs, you can fix this in the GF Homew after the system has booted and is running. You can plug it into the slot (but do this at your own risk, I did this many times before, but YMMV). The safest approach of course is mounting the HDD on this box using USB-HDD connector.

If you plug in the HDD on the GF Home. List the mount points and list storage devices and see which drive letter the HDD was assigned to
mount
fdisk -l
You have 1 USB rootfs and 1 HDD, but insert the HDD later so most likely root is /dev/sda1 and the HDD is /dev/sdb1.

Now you can mount it, or running e2fsck to check for errors. Or repartition it. Remember to assign a label to the HDD partition (good practice).

-bodhi
===========================
Forum Wiki
bodhi's corner
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: