[SOLVED] Go-Flex and U-Boot v2016 problem

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

[SOLVED] Go-Flex and U-Boot v2016 problem

Postby Chmielar » Sat Jun 19, 2021 6:53 pm

Hello,

I am new to the group. Couple of days ago I managed to update my GoFlex Home drive following the instructions here:
https://archlinuxarm.org/platforms/armv5/seagate-goflex-home

It all went smoothly. I set the drive, smb plus some other the services and moved all my backup files back on freshly formatted drive. All was perfectly fine until I saw the post that u-boot v2014 can be upgraded to v2016 which should allow installation of newer than 4.4 kernels. Encouraged by previous success I haven't done all my homework and just executed pacman -S uboot-goflexhome. Things happened with no error messages so I rebooted the drive. Of course it didn't come up again. I noticed that there are lots of similar topics on the forum. I reviewed some of them but it all feels a bit overwhelming at the moment. Could somebody please take a quick look at netconsole messages and point me in the right direction. The kernel seems to boot but it gets stuck at some stage so I can't ssh or ping the drive anymore.

If the solution involves re-formatting rootfs perhaps I should do it on USB drive this time. I noticed that when system was booted from hard drive it was not possible to spin it down for longer than 3, 4 mins and this drive will be very rarely used. Please let me know if you agree that booting the system from USB and then mounting HDD would be better solution in this scenario.

u-boot net console - extract
$this->bbcode_second_pass_code('', '
Device 0: Model: ST2000DL001-9VT156 Firm: CC98 Ser#: 5YDA3S0Y
Type: Hard Disk
Supports 48-bit addressing
Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
... is now current device
ide found on device 0
Checking for: /boot/uEnv.txt ...
51 bytes read in 13 ms (2.9 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uenvcmd is set ...
** File not found /boot/zImage **
4661632 bytes read in 907 ms (4.9 MiB/s)
root has been defined by user
loading /boot/dtbs/kirkwood-goflexhome.dtb ...
** File not found /boot/dtbs/kirkwood-goflexhome.dtb **
7071796 bytes read in 1243 ms (5.4 MiB/s)
Booting uImage with initrd
## Booting kernel from Legacy Image at 00810000 ...
Image Name: Linux-4.4.271-1-ARCH
Created: 2021-06-06 1:06:10 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4661568 Bytes = 4.4 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ...OK
')

full kernel netconsole dump
$this->bbcode_second_pass_code('', '
[ 12.256879] console [netcon0] enabled
[ 12.260571] netconsole: network logging started
[ 12.265281] rtc-mv rtc-mv: setting system clock to 2002-09-22 12:48:01 UTC (1032698881)
[ 12.275353] Freeing unused kernel memory: 300K
[ 12.256879] console [netcon0] enabled
[ 12.260571] netconsole: network logging started
[ 12.265281] rtc-mv rtc-mv: setting system clock to 2002-09-22 12:48:01 UTC (1032698881)
[ 12.275353] Freeing unused kernel memory: 300K
[ 117.954260] random: nonblocking pool is initialized
[ 117.954260] random: nonblocking pool is initialized
')

Regards,
Pawel
Last edited by Chmielar on Thu Jun 24, 2021 4:44 pm, edited 1 time in total.
Chmielar
 
Posts: 4
Joined: Sat Jun 19, 2021 6:00 pm

Re: Go-Flex and U-Boot v2016 problem

Postby summers » Sat Jun 19, 2021 7:33 pm

Sorry am posting on my tablet. It looks like uboot is looking for a recent kernel, and also a device tree. So look like you should have upgraded to a recent kernel at the same time. I guess you can pull the HDD and rewrite some things. I'll check tomorrow when on the desk top ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Go-Flex and U-Boot v2016 problem

Postby moonman » Sat Jun 19, 2021 10:17 pm

$this->bbcode_second_pass_quote('summers', 'S')orry am posting on my tablet. It looks like uboot is looking for a recent kernel, and also a device tree. So look like you should have upgraded to a recent kernel at the same time. I guess you can pull the HDD and rewrite some things. I'll check tomorrow when on the desk top ...


This U-Boot is set up to look for both, uImage and zImage+dtb. If it can't load zImage+dtb it tries to load uImage, which it succeeds in this instance.

$this->bbcode_second_pass_quote('', 'I')f the solution involves re-formatting rootfs perhaps I should do it on USB drive this time. I noticed that when system was booted from hard drive it was not possible to spin it down for longer than 3, 4 mins and this drive will be very rarely used. Please let me know if you agree that booting the system from USB and then mounting HDD would be better solution in this scenario.


It's up to you. There are pros and cons to both methods. With USB drive the issues is that it's flash storage (and less reliable than SSD usually without wear leveling etc) and it will fail eventually from constant writes to it, much sooner than SSD, but ultimately will depend on the quality of your flash drive. If you want to save a few dollars (cents?) a year in electricity, then go this way. It may also be easier to take a backup of such installation.

As to your problem, I would suggest to reinsatll using any Linux x86 computer. You don't have to have 2 separate partitions as in the guide if you don't want to. You can also use EXT4 instead of EXT3. So just partition the drive like you want, format first (or the only) partition with EXT4 and extract the rootfs like outlined in the guide. This can be done with either USB or the HDD (which you will have to take out of the enclosure to connect to a PC).
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: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Go-Flex and U-Boot v2016 problem

Postby Chmielar » Sun Jun 20, 2021 12:44 am

@moonman and @summers thank you very much for your help and the support. I am pleased to report that the drive is up and running again with kernel 5.12.9-1-ARCH.

I'm not entirely sure what was exactly the problem as unfortunately I changed 2 things simultaneously:
$this->bbcode_list('1')
  • I assumed (perhaps wrongly) that u-boot v2016 could not handle older kernel versions so I took the drive from the cradle put it into USB cradle and manually copied zImage and kirkwood-goflexhome.dtb from https://archlinuxarm.org/packages/arm/linux-kirkwood-dt package into /boot and /boot/dtbs respectively.
  • I modified uEnv.txt with root=UUID=d2462dc1-834b-483c-a84d-ff415b52edd0. I had it before listed as PARTUUID but the way my disk seem to be formatted does not advertise PARTUUID with blkid.
  • After successful boot I updated the installation with: $this->bbcode_second_pass_code('', 'pacman -Syu linux-kirkwood-dt linux-kirkwood-dt-headers')
    All seem to be OK now. The last item I am planning to do is to convert root partition to ext4 with: $this->bbcode_second_pass_code('', 'tune2fs -O extents,uninit_bg,dir_index /dev/sda1
    e2fsck -fDC0 /dev/sda1.')
    As per comments about running it from USB drive. I take your point and will probably leave it the way it is now. I was more concerned about humming noise as we keep the drive on the shelf under the TV. I may experiment later with spare 2.5", 100 GB drive I've got from the old laptop.

    Regards and thanks again for your assistance,
    Pawel
    Chmielar
     
    Posts: 4
    Joined: Sat Jun 19, 2021 6:00 pm

    Re: Go-Flex and U-Boot v2016 problem

    Postby summers » Sun Jun 20, 2021 8:41 am

    Good you have got it working, and yes to my my mind it is good to update to a modern kernel and device tree.

    Just checked on my nsa325, another kirkwood device, on the same uboot. IIRC in uboot the root variable is set to point at the root file system. Don't recall if this is also used to find the boot partition. I've a very dim recollection that this uboot looks for the boot files both in / and /boot - so can cope with a boot partition, or boot as a directory under root. Having a directory under root makes the file system easier - and this this uboot understands ext4, and so the root and boot partitions can be ext4 formatted.

    The root parameter for uboot in these devices is set in /boot/uEnv.txt, mine is:
    $this->bbcode_second_pass_code('', 'root=PARTUUID=94a2dc27-01
    mtdparts=mtdparts=orion_nand:0xC0000(uboot),0x40000(uboot_env),0x80000(old_uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
    loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}; fdt addr ${fdtaddr}; fdt set /mbus@f1000000/nand@12f chip-delay <45>')
    Where the PARTUUID comes from:
    $this->bbcode_second_pass_code('', '[summers@nas boot]$ blkid /dev/sda1
    /dev/sda1: UUID="9c66e1c4-d82b-4606-b686-f5bc6d42e9d9" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="94a2dc27-01"')

    This uboot IIRC understand PARTUUID, but not UUID.

    ANd just checked, the boot directory that contains the kernel is set in uboot with the variable bootdir. So with a boot partition you have bootdir=/ and with a boot directory you have bootdir=/boot . The device tree is set by fdtdir=/boot/dtbs and fdtfile=kirkwood-nsa325.dtb. Now from uboot position, doesn't look like it needs PARUUID, so instead it must be the kirkwood kernel that needed PARTUUID rather than UUID (e.g. UUID wasn't compiled in kirkwood kernel). [actually just checked its the initramfs that may only recognise PARTUUID and not UUID - this may be ancient history now ...]
    summers
     
    Posts: 984
    Joined: Sat Sep 06, 2014 12:56 pm

    Re: Go-Flex and U-Boot v2016 problem

    Postby summers » Sun Jun 20, 2021 9:49 am

    And from : https://github.com/torvalds/linux/blob/master/init/do_mounts.c this is why we use PARTUUID:
    $this->bbcode_second_pass_quote('', '/')*
    * Convert a name into device number. We accept the following variants:
    *
    * 1) <hex_major><hex_minor> device number in hexadecimal represents itself
    * no leading 0x, for example b302.
    * 2) /dev/nfs represents Root_NFS (0xff)
    * 3) /dev/<disk_name> represents the device number of disk
    * 4) /dev/<disk_name><decimal> represents the device number
    * of partition - device number of disk plus the partition number
    * 5) /dev/<disk_name>p<decimal> - same as the above, that form is
    * used when disk name of partitioned disk ends on a digit.
    * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
    * unique id of a partition if the partition table provides it.
    * The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
    * partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
    * filled hex representation of the 32-bit "NT disk signature", and PP
    * is a zero-filled hex representation of the 1-based partition number.
    * 7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to
    * a partition with a known unique id.
    * 8) <major>:<minor> major and minor number of the device separated by
    * a colon.
    * 9) PARTLABEL=<name> with name being the GPT partition label.
    * MSDOS partitions do not support labels!
    * 10) /dev/cifs represents Root_CIFS (0xfe)
    *
    * If name doesn't have fall into the categories above, we return (0,0).
    * block_class is used to check if something is a disk name. If the disk
    * name contains slashes, the device name has them replaced with
    * bangs.
    */
    summers
     
    Posts: 984
    Joined: Sat Sep 06, 2014 12:56 pm
    Top

    Re: Go-Flex and U-Boot v2016 problem

    Postby Chmielar » Sun Jun 20, 2021 1:51 pm

    $this->bbcode_second_pass_quote('', 'T')he root parameter for uboot in these devices is set in /boot/uEnv.txt, mine is:
    $this->bbcode_second_pass_code('', '
    root=PARTUUID=94a2dc27-01
    mtdparts=mtdparts=orion_nand:0xC0000(uboot),0x40000(uboot_env),0x80000(old_uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
    loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}; fdt addr ${fdtaddr}; fdt set /mbus@f1000000/nand@12f chip-delay <45>
    ')
    Where the PARTUUID comes from:
    $this->bbcode_second_pass_code('', '
    [summers@nas boot]$ blkid /dev/sda1
    /dev/sda1: UUID="9c66e1c4-d82b-4606-b686-f5bc6d42e9d9" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="94a2dc27-01"
    ')
    This uboot IIRC understand PARTUUID, but not UUID.

    I was reading about this last night but just could not get PARTUUID. Any ideas?
    $this->bbcode_second_pass_code('', '[alarm@alarm ~]$ ls -la /dev/disk/by-id/
    total 0
    drwxr-xr-x 2 root root 160 Oct 17 2004 .
    drwxr-xr-x 5 root root 100 Oct 17 2004 ..
    lrwxrwxrwx 1 root root 9 May 19 16:39 ata-ST2000DL001-9VT156_5YDA3S0Y -> ../../sda
    lrwxrwxrwx 1 root root 10 May 19 16:39 ata-ST2000DL001-9VT156_5YDA3S0Y-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 10 May 19 16:39 ata-ST2000DL001-9VT156_5YDA3S0Y-part2 -> ../../sda2
    lrwxrwxrwx 1 root root 9 May 19 16:39 wwn-0x5000c500537f8b15 -> ../../sda
    lrwxrwxrwx 1 root root 10 May 19 16:39 wwn-0x5000c500537f8b15-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 10 May 19 16:39 wwn-0x5000c500537f8b15-part2 -> ../../sda2
    [alarm@alarm ~]$ lsblk -o +partuuid,name
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS PARTUUID NAME
    sda 8:0 0 1.8T 0 disk sda
    |-sda1 8:1 0 18.6G 0 part / sda1
    `-sda2 8:2 0 1.8T 0 part /mnt/goflex sda2
    [alarm@alarm ~]$ blkid /dev/sda1
    /dev/sda1: UUID="d2462dc1-834b-483c-a84d-ff415b52edd0" BLOCK_SIZE="4096" TYPE="ext3"
    [alarm@alarm ~]$ blkid /dev/sda2
    /dev/sda2: UUID="8e65e4f1-fdd7-4aa1-903a-fdedb44ccad6" BLOCK_SIZE="4096" TYPE="ext4"')
    Chmielar
     
    Posts: 4
    Joined: Sat Jun 19, 2021 6:00 pm
    Top

    Re: Go-Flex and U-Boot v2016 problem

    Postby moonman » Mon Jun 21, 2021 6:51 pm

    PARTUUID was picked because it doesn't require initial ramdisk, while UUID does.

    Your PARTUUID might just be all zeros because you used old tools (supplied with GoFlex firmware) to partition and format, and it's not showing up. You can use fdisk to change PARTUUID. Since you are using MBR, you can launch fdisk /dev/sdx and then press 'x' and then 'i' to change identifier (MBR doesn't actually have PARTUUID, it's derived from disk identifier). You can also repartition with GPT if you ever upgrade your drive beyond the 2TB that you have right now.

    TL;DR
    PARTTUID doesn't require initrd, UUID does. It the end it doesn't matter. ALARM supplies initrd now (while it didn't before) for most installations, including Kirkwood so if UUID is working for you, just use it.
    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: 3387
    Joined: Sat Jan 15, 2011 3:36 am

    Re: Go-Flex and U-Boot v2016 problem

    Postby Chmielar » Thu Jun 24, 2021 4:43 pm

    Thank you for prompt and robust answer. I used old formating tool as you suggested hence the problem with PARTUUID.

    I am very impressed and grateful how quickly I managed to find a help and guidance to solve the problem and also learnt so much in the process. Thank you!
    Chmielar
     
    Posts: 4
    Joined: Sat Jun 19, 2021 6:00 pm


    Return to Marvell Kirkwood

    Who is online

    Users browsing this forum: No registered users and 6 guests