Welcome! Log In Create A New Profile

Advanced

NAS 220 doesn't work with debian install

Posted by gigirock 
NAS 220 doesn't work with debian install
October 13, 2021 05:14PM
Hi all,
Proud to be in this forum where a lot of experts are.
I have a seagate nas220 bricked as someone starts an (official) upgrade and tried to stop it disconnecting power supply connector.

I have a 3.3V rs232 connection to the device and a stable connection , following https://github.com/hn/seagate-blackarmor-nas I tried several times and ways to get debian installed but the point where i'm stuck is :

## Booting kernel from Legacy Image at 00040000 ...
Image Name: kernel 4.19.0-17-marvell
Created: 2021-09-29 21:27:21 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2068066 Bytes = 2 MiB
Load Address: 00040000
Entry Point: 00040000
Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
nas220>


I can boot from usb easly and run the installer , i tried openwrt but with the same results. Anyway I'm interested in install Debian to use the nas as nas. No need for special apps o application. I want to install nas220 in a local network and share /yourbackup to some users that will backup their files.
As I learned from other post in the forum i place my env here....

nas220> printenv
autoload=no
autostart=no
baudrate=115200
bootargs=console=ttyS0,115200
bootargs_base=console=ttyS0,115200
bootcmd=run bootcmd_nand
bootcmd_nand=setenv bootargs ${bootargs_base} ${mtdparts} ${bootargs_extra}; nand read.e 0x40000 0xc0000 0x500000; nand read.e 0x800000 0x5c0000 0x1a3fff0; bootm 0x40000 0x800000
bootcmd_rescue=setenv bootargs_extra rescue/enable=true; run bootcmd_usb
bootcmd_usb=setenv bootargs ${bootargs_base} ${mtdparts} ${bootargs_extra}; usb start; fatload usb 0:1 0x40000 uImage-dtb; fatload usb 0:1 0x800000 uInitrd; bootm 0x40000 0x800000
bootdelay=5
ethact=egiga0
ethaddr=00:00:00:00:00:00 ( yes yes i placed the mac address on the nas label.... :) )
fdtcontroladdr=7b56608
mtdids=nand0=orion_nand
mtdparts=cmdlinepart.mtdparts=orion_nand:0xa0000@0x0(uboot),0x010000@0xa0000(env),0x500000@0xc0000(uimage),0x1a40000@0x5c0000(rootfs)
stderr=serial
stdin=serial
stdout=serial
Re: NAS 220 doesn't work with debian install
October 13, 2021 07:32PM
gigirock,

You could try to boot Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2.

See here for how to boot with stock Kirkwood u-boot:

https://forum.doozan.com/read.php?2,102054,105374#msg-105374

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NAS 220 doesn't work with debian install
October 13, 2021 11:51PM
Current U-Boot source has support for the Seagate NAS220 also, so you could also build and replace the stock U-Boot. OpenWrt has a binary available at https://downloads.openwrt.org/releases/21.02.0/targets/kirkwood/generic/u-boot-nas220/u-boot.kwb

ray
Re: NAS 220 doesn't work with debian install
October 15, 2021 07:25PM
nothing to do i have u-boot new version
i used your Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2 files on usb/SD
I tried ext3 or ext4 fs
The results is always kernel "wrong image format"


nas220> printenv
autoload=no
autostart=no
baudrate=115200
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial
bootargs_base=console=ttyS0,115200
bootcmd=usb reset; run usb_bootcmd; usb stop; reset
bootcmd_nand=setenv bootargs ${bootargs_base} ${mtdparts} ${bootargs_extra}; nand read.e 0x40000 0xc0000 0x500000; nand read.e 0x800000 0x5c0000 0x1a3fff0; bootm 0x40000 0x800000
bootcmd_rescue=setenv bootargs_extra rescue/enable=true; run bootcmd_usb
bootcmd_usb=setenv bootargs ${bootargs_base} ${mtdparts} ${bootargs_extra}; usb start; fatload usb 0:1 0x40000 uImage-dtb; fatload usb 0:1 0x800000 uInitrd; bootm 0x40000 0x800000
bootdelay=5
ethact=egiga0
ethaddr=00:10:75:07:62:85
fdtcontroladdr=7b55608
load_uimage=ext4load usb 0:1 0x800000 /boot/uImage
load_uinitrd=ext4load usb 0:1 0x2100000 /boot/uInitrd
mtdids=nand0=orion_nand
mtdparts=cmdlinepart.mtdparts=orion_nand:0xa0000@0x0(uboot),0x010000@0xa0000(env),0x500000@0xc0000(uimage),0x1a40000@0x5c0000(rootfs)
stderr=serial
stdin=serial
stdout=serial
usb_boot=mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000
usb_bootcmd=run usb_set_bootargs; run usb_boot
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial

Environment size: 1257/65532 bytes
nas220> run usb_bootcmd
Wrong Image Format for bootm command
ERROR: can't get kernel image!
nas220>
Re: NAS 220 doesn't work with debian install
October 15, 2021 08:08PM
gigirock,

The rootfs should be Ext3.

And,

load_uimage=ext4load usb 0:1 0x800000 /boot/uImage 
load_uinitrd=ext4load usb 0:1 0x2100000 /boot/uInitrd

should be
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage 
load_uinitrd=ext2load usb 0:1 0x2100000 /boot/uInitrd

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NAS 220 doesn't work with debian install
October 16, 2021 10:16AM
Yes thank you but with ext3 ( called by ext2load ?) filesystem , my linux box ( the pc from I'm writing now) has strange behaviour like take some minutes to complete the 'sync' command to flush all the files to the SD, that is very hot when I unplug it from the PC, I also saw a note about the version 20.x of the u-boot is able to load rootfs from ext4 filesystems
https://github.com/ARM-software/u-boot/blob/master/doc/README.ext4

is there a way to 'load' the file through the tftp command ?
I think the type of file used to load kernel is somehow not compatible with my configuration, but I don't know where the issue or error is coming from.
I will investigate more.
Re: NAS 220 doesn't work with debian install
October 16, 2021 02:50PM
gigirock,

> Yes thank you but with ext3 ( called by ext2load
> ?) filesystem , my linux box ( the pc from I'm
> writing now) has strange behaviour like take some
> minutes to complete the 'sync' command to flush
> all the files to the SD

Ext2load command is used for both Ext2 and Ext3 file system.

> version 20.x of the u-boot is able to load rootfs
> from ext4 filesystems
> https://github.com/ARM-software/u-boot/blob/master/doc/README.ext4

That's just general mainline u-boot capability. You stock u-boot is likely quite old. None of old stock u-boots has Ext4 capability.

And to boot manually step by step, you must do

usb reset
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
run usb_bootcmd

Do the commands above and post the entire serial console log (everything from u-boot banner until the last line on the terminal).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NAS 220 doesn't work with debian install
October 16, 2021 04:45PM
something is moving.....
I changed SD card with an old one about 4Gb and something happens:

How to create the right image for my Seagate nas220 ?
mkimage in /boot ?

nas220> run usb_bootcmd
5435888 bytes read in 313 ms (16.6 MiB/s)
9671091 bytes read in 536 ms (17.2 MiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.13.6-kirkwood-tld-1
   Created:      2021-09-24   0:22:58 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5435824 Bytes = 5.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02100000 ...
   Image Name:   initramfs-5.13.6-kirkwood-tld-1
   Created:      2021-09-24   1:06:32 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9671027 Bytes = 9.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image
   Loading Ramdisk to 0721b000, end 07b54173 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00000691, r2=0x00000100
  r2[]=05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00
Available machine support:

ID (hex)        NAME
ffffffff        Generic DT based system
ffffffff        Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.

=====
moderator edit: please use code tags (formatted code buttom) to post log.



Edited 1 time(s). Last edit at 10/16/2021 04:48PM by bodhi.
Re: NAS 220 doesn't work with debian install
October 16, 2021 04:51PM
You need to do Step 4 when you create the rootfs.


Quote

4. (Stock u-boot only) Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Skip this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time, or running kwboot with latest u-boot image).

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.13.6-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.13.6-kirkwood-tld-1 -d zImage.fdt uImage
sync

Your box DTB file name is kirkwood-blackarmor-nas220.dtb.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NAS 220 doesn't work with debian install
October 18, 2021 10:30AM
Hi Bodhi, just like always you are right. :)

Ok now I have a kind of boot , also openwrt starts as expected, but I prefer to have a pure Debian enviroment

No way to start from nand,
How to check if I have some bad blocks ?

Can I test to start from hdd ?
I guess to create a partition etx3 named rootfs with the same files I have in actual SD ( boot from USB/SD is ok now) , I can create a chroot and modify fstab in order to mount hard disk from the beginning, then I can manage to have a Debian NAS box.

If I will reach this status , then can I "apt update & apt upgrade" without problems ?
Re: NAS 220 doesn't work with debian install
October 18, 2021 03:32PM
gigirock,


> Ok now I have a kind of boot , also openwrt starts
> as expected, but I prefer to have a pure Debian
> enviroment

That's booting with Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2. on USB, which you did.

>
> No way to start from nand,
> How to check if I have some bad blocks ?

dmesg | grep -i bad


> Can I test to start from hdd ?
> I guess to create a partition etx3 named rootfs
> with the same files I have in actual SD ( boot
> from USB/SD is ok now)

That's all you need to do to prepare the HDD rootfs. Note that when you copy the root file system from SD to HDD, you must be root user.

Wiki thread:
Quote
https://forum.doozan.com/read.php?2,23630
Backup and Cloning rootfs

Back up a live rootfs using rsync
CrashPlan 4.3.0
Backup/Restore rootfs using tar command
Adjust udev rules after cloning rootfs
Stock Pogoplug rootfs
How to clone a rootfs from one Kirkwood box to another: Step 1 and Step 2
How to clone SATA rootfs to USB rootfs

> I can create a chroot and
> modify fstab in order to mount hard disk from the
> beginning, then I can manage to have a Debian NAS
> box.

No need to do that. You can adjust the u-boot envs to boot from the HDD rootfs. The fstab is already correct for both USB and HDD. Your bootargs contains this root device:
root=LABEL=rootfs

======

To boot with HDD rootfs, the envs should be:


load_uimage=ext2load ide 0:1 0x800000 /boot/uImage 
load_uinitrd=ext2load ide 0:1 0x2100000 /boot/uInitrd

sata_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial 
sata_boot=mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000 
sata_bootcmd=run sata_set_bootargs; run sata_boot

bootcmd=ide reset; run sata_bootcmd; reset

Note that usb_set_bootargs and sata_set_bootargs are identical.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NAS 220 doesn't work with debian install
October 19, 2021 04:53PM
I have :

nas220> nand bad

Device 0 bad blocks:
0127c000
01284000
0128c000

but the help system said: nand markbad off [...] - mark bad block(s) at offset (UNSAFE)
are this 3 blocks already marked as bad ?
Is it a good idea markbad the 3 bad blocks ?
Re: NAS 220 doesn't work with debian install
October 19, 2021 05:13PM
gigirock,

Quote

>
> How to check if I have some bad blocks ?

dmesg | grep -i bad

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NAS 220 doesn't work with debian install
October 20, 2021 06:24PM
No chance to start from hdd , because hdd is not seen by u-boot , is the disk gpt or mbr ?
note some examples here , the only command that has an answer is ide reset
No chance to boot from nand, no chance to come back to original firmware ... do I throw away ?

nas220> ide reset

Reset IDE: Bus 0: OK Bus 1: OK 
  Device 0: Model: ST32000542AS Firm: CC95 Ser#: 5XW0M7ZQ
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
  Device 1: Model: ST32000542AS Firm: CC34 Ser#: 6XW04VRL
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
nas220> ide info
nas220> ide device ide

Device 0: unknown device
nas220> ide device 0  

Device 0: unknown device
nas220> ide part 0

ide device 0 not available
nas220> ide part ide

ide device 0 not available
nas220> ide part    

no ide partition table available
nas220> diskboot
** No device specified **
nas220> diskboot ide
** No device specified **
nas220> diskboot ide 0:!
nas220> diskboot ide 0:1
nas220> e  
  echo editenv env exit ext2load ext2ls ext4load ext4ls ext4size
nas220> ext2ls ide0
** No device specified **
nas220> ext2ls ide 
** No device specified **
nas220> ext2ls ide 0:1
nas220> ext2ls ide 2:1 
nas220> ext2ls ide 1:1 
nas220> version
U-Boot 2020.04 (Jun 13 2021 - 22:02:19 +0000)
NAS 220

arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 8.4.0 r16172-2aba3e9784) 8.4.0
GNU ld (GNU Binutils) 2.34
nas220> 

Re: NAS 220 doesn't work with debian install
October 20, 2021 06:51PM
gigirock,

> No chance to start from hdd , because hdd is not
> seen by u-boot , is the disk gpt or mbr ?
> note some examples here , the only command that
> has an answer is ide reset
> No chance to boot from nand, no chance to come
> back to original firmware ... do I throw away ?

No need to throw away a good piece of hardware! You can boot to USB Debian rootfs already. Then it is most likely you can boot to HDD Debian rootfs.

With old u-boot, or modern OpenWrt u-boot, the disk should be MBR. But when in doubt, use MBR, no need to use GPT for small disk.

Quote

> nas220> ide reset
>
> Reset IDE: Bus 0: OK Bus 1: OK
> Device 0: Model: ST32000542AS Firm: CC95 Ser#:
> 5XW0M7ZQ
> Type: Hard Disk
> Supports 48-bit addressing
> Capacity: 1907729.0 MB = 1863.0 GB
> (3907029168 x 512)
> Device 1: Model: ST32000542AS Firm: CC34 Ser#:
> 6XW04VRL
> Type: Hard Disk
> Supports 48-bit addressing
> Capacity: 1907729.0 MB = 1863.0 GB
> (3907029168 x 512)

It's a very good sign that the HDDs are recognized like above.

Check partitions:

ide part

And then try to list the files. Assuming you already copied from USB, or create a new Debian rootfs on one of the HDDs.

ext2ls ide 0:1 /boot
ext2ls ide 1:1 /boot

See which one has the rootfs. And then adjust the envs I've posted previously to boot that rootfs. If the rootfs is on the IDE 1 then the 0:1 device below should be 1:1

load_uimage=ext2load ide 0:1 0x800000 /boot/uImage 
load_uinitrd=ext2load ide 0:1 0x2100000 /boot/uInitrd

sata_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial 
sata_boot=mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000 
sata_bootcmd=run sata_set_bootargs; run sata_boot

bootcmd=ide reset; run sata_bootcmd; reset

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 10/21/2021 06:38AM by bodhi.
Re: NAS 220 doesn't work with debian install
October 23, 2021 04:21PM
i tried

full disk ext3 or ext4 partition mbr with/without boot flag and
5Gb ext3 or ext4 partition mbr with/without boot flag but from consolle never saw the ext2ls or ext4ls command to work
also ide info never gave me some result.
Ony ide reset works as expected
i want to test an old u-boot , i think the issue is about there.

GiGiRoCk
Re: NAS 220 doesn't work with debian install
October 23, 2021 06:11PM
GiGiRoCk,

Either stock u-boot . But you should try UART booting with kwboot first. Use the stock image that you can find, or use the OpenWrt image.

Example:
https://forum.doozan.com/read.php?3,51739,51919#msg-51919

Or I will build a new 2021.07 u-boot image for you. Looks like the OpenWrt u-boot came straigth from mainline, and there is no SATA support.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 10/23/2021 06:32PM by bodhi.
Re: NAS 220 doesn't work with debian install
October 23, 2021 07:51PM
Here is the 2019.10 u-boot for Seagate NAS220 with SATA support.

This is untested. So make sure you can kwboot with this u-boot image.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 10/23/2021 08:31PM by bodhi.
Attachments:
open | download - uboot.2019.10-tld-1.nas220.mtd0.kwb (512 KB)
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: