HowTo: Stora - Debian Stretch and OMV4
December 29, 2019 06:54PM
bodhi's note: In this instruction, fcollingwood is installing OMV4 with the box still has stock U-Boot. So there are some envs settings to do that, which does not apply when you are running my new u-boot releases. If you are already running the new u-boot, then you need to skip the envs settings in this instruction.

=========

MyStora is going away next year, rendering many thousands of Stora devices useless.

Thanks to information found mainly here (but also a little found elsewhere), I have made my Stora into an Open Media Vault. Note that the current release of OMV, OMV4, is NOT supported on Buster and does not install. You must install Stretch

First I made a kernel 4.4.0 USB Stick from the tarball from 20th Feb 2016 found here: https://forum.doozan.com/read.php?2,12096

I then connected to the serial port via PuTTY so that I was on the console of the box. I found that here: https://github.com/Dees7/openstora/blob/master/pages/Root_Access_Via_Serial_Console.md

I backed up all data and removed the disks from the box before starting

I had to change some boot environment variables. When booting, you will see the following in the console:
       __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__| 
 ** MARVELL BOARD: RD-88F6281A LE 

U-Boot 1.1.4 (Sep  4 2009 - 09:36:11) Marvell version: 3.4.14

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CEE60

Soc: 88F6281 A0 (DDR2)
CPU running @ 1000Mhz L2 running @ 333Mhz
SysClock = 333Mhz , TClock = 200Mhz 

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size  64MB 
DRAM CS[1] base 0x04000000   size  64MB 
DRAM Total size 128MB  16bit width
Flash:  0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:256 MB
CRC in Flash: ac06e162, Calculated CRC: ac06e162

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled

Module 0 is RGMII
Module 1 is TDM

USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0, egiga1 [PRIME]
Hit any key to stop autoboot:  3 :


At this point, hit any key to stop the autoboot. Enter the following at the prompt: (bodhi's note: these envs settings only apply to stock u-boot)

setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x1100000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=LABEL=rootfs rootdelay=10; run bootcmd_usb; bootm 0x800000 0x1100000; reset'
setenv console 'console=ttyS0,115200 mtdparts=orion_nand:0x100000@0(uboot),0xff00000@0x100000(root)'
saveenv
reset

The box will reboot into the debian image from the USB stick, login with root/root

Update the uBoot following the instructions here: https://forum.doozan.com/read.php?3,12381

(bodhi's note: So from here on the new u-boot is running)

Some of the steps will fail, but that is OK, this box is a little different from others, see here https://forum.doozan.com/read.php?3,33178,33183 and here https://forum.doozan.com/read.php?2,29259

Once the uBoot is updated, you can proceed to boot with Stretch and install the OS on the disks so you don't have to keep the USB stick in the device.

1. Install Debian Stretch (OMV4 is not supported on Buster)
Install one disk in the left hand bay
Boot from USB stick made from image 4.12.1 from the 24th July 2017 found here: https://forum.doozan.com/read.php?2,12096
Using fdisk, delete the existing partition
Create two partitions on /dev/sda, 1st one 8GB, second one 256MB. Make sure to use 't' command for partition 2 and set it to type 82
Create EXT4 partition on /dev/sda1 and label it rootfs - mkfs.ext4 -l rootfs /dev/sda1
Create swap partition on /dev/sda2 and label it swap - mkswap -L swap /dev/sda2
cd to /root and download the tarball from the 24th July 2017 found here: https://forum.doozan.com/read.php?2,12096 using wget
Mount partition /dev/sda1 on /mnt. Unzip tarball into /mnt
cd to /mnt
edit /mnt/etc/fstab - change file system type from EXT3 to EXT4 for rootfs entry and add "LABEL=swap swap swap default 0 0"
edit /mnt/etc/hosts. Add "127.0.1.1 stora.lan stora"
replace the contents of /mnt/etc/hostname with "stora"


2. Boot and update
Reboot - remove USB stick when uBoot starts
once booted run:
    apt update
    apt upgrade
    cd /boot
    mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.12.1-kirkwood-tld-1 -d initrd.img-4.12.1-kirkwood-tld-1 uInitrd


3. Update kernel to 5.2.9
Download the kernel 5.2.9 tarball from 18th August 2019 at https://forum.doozan.com/read.php?2,12096
run the following:
    cd
    mkdir boot_4.12.1
    cd boot_4.12.1
    cp -r /boot/* .
    cd /boot
    tar xjf /root/linux-5.2.9-kirkwood-tld-1-bodhi.tar.bz2
    tar xf linux-dtb-5.2.9-kirkwood-tld-1.tar
    apt-get remove flash-kernel
    dpkg -i linux-image-5.2.9-kirkwood-tld-1_1.0_armel.deb
    mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d vmlinuz-5.2.9-kirkwood-tld-1 uImage
    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
OMV4 requires systemd, so add it to boot env
    fw_setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params init=/bin/systemd'
systemd requires a larger /run tmpfs than the default, so add "none /run tmpfs defaults,size=20M 0 0" to /etc/fstab
reboot


4. Install OMV4
Backup current /boot
    cd
    mkdir boot_5.2.9_pre-OMV4
    cd boot_5.2.9_pre-OMV4
    cp -r /boot/* .
Prepare for OMV4 install
    apt install -y aptitude curl apt-transport-https
Set up sources
    echo "deb http://packages.openmediavault.org/public arrakis main" > /etc/apt/sources.list.d/openmediavault.list
    curl -k -s http://packages.openmediavault.org/public/archive.key | apt-key add -
    apt update
Start Installation
    export LANG=C.UTF-8
    export DEBIAN_FRONTEND=noninteractive
    export APT_LISTCHANGES_FRONTEND=none
    apt-get --yes --auto-remove --show-upgraded \
	--allow-downgrades --allow-change-held-packages \
	--no-install-recommends \
	--option Dpkg::Options::="--force-confdef" \
	--option DPkg::Options::="--force-confold" \
	install postfix openmediavault-keyring openmediavault
    cp /usr/share/openmediavault/templates/config.xml /etc/openmediavault/
    omv-initsystem
    omv-mkconf interfaces
    omv-mkconf issue
If there are problems with masked services:
    systemctl unmask openmediavault-beep-up
    systemctl unmask openmediavault-beep-down
    systemctl unmask openmediavault-cleanup-monit
    systemctl unmask openmediavault-cleanup-php
    systemctl unmask openmediavault-engined
    systemctl unmask openmediavault-issue
    apt install -y openmediavault
    omv-initsystem
If network interface has stopped working after a reboot, add the following to /etc/network/interfaces:
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp


5. Set up raid
Insert the second disk
Partition /dev/sdb the same as /dev/sda in step 1 but don't create filesystems
Create RAID 1 arrays on second drive and create filesystems:
    mdadm --create /dev/md0 --metadata=0.90 --level=1 --raid-devices=2 missing /dev/sdb1
    mdadm --create /dev/md1 --metadata=0.90 --level=1 --raid-devices=2 missing /dev/sdb2
    mkfs.ext4 -L rootfs /dev/md0
    mkswap -L swap /dev/md1
In the DEVICE section of /etc/mdadm/mdadm.conf add "DEVICE /dev/sd?*"
run:
    mdadm --detail --scan >> /etc/mdadm/mdadm.conf
    dpkg-reconfigure mdadm
    cd /boot
    mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d vmlinuz-5.2.9-kirkwood-tld-1 uImage
    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
clone rootfs from /dev/sda1:
    mkdir /tmp/mnt
    mount /dev/md0 /tmp/mnt
    rsync -auHxv --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* /* /tmp/mnt
Power off the unit and remove disk 1
Power on the unit and make sure it boots off md0
check that swap mounts using the "free" command
Insert Disk 1. Note that this becomes /dev/sdb
Add the Disk 1 partitions to the RAID 1 Arrays:
    mdadm --add /dev/md0 /dev/sdb1
    mdadm --add /dev/md1 /dev/sdb2
Create partitions on the drives taking up the remaining free space
Create a third array:
    mdadm --create /dev/md2 --level=1 --raid-devices=2 missing /dev/sda3
    mdadm --add /dev/md2 /dev/sdb3


6. Add OMV Extras:
Install dependancies:
    apt install -y dirmngr

install Extras:
    wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash



Thanks to Bodhi for all your hard work

Resources:

Serial port console: https://github.com/Dees7/openstora/blob/master/pages/Root_Access_Via_Serial_Console.md
Installing Debian on Stora: https://forum.doozan.com/read.php?2,12096
Upgrading uBoot on Stora: https://forum.doozan.com/read.php?3,12381
Installing OMV: https://forum.openmediavault.org/index.php/Thread/21234-Install-OMV4-on-Debian-9-Stretch/
OMV Extras: http://omv-extras.org/
Setting up mdadm on Stora: https://forum.doozan.com/read.php?2,27308

Edit: There were a few errors and omissions corrected

==========

bodhi's note: I've inserted some clarification about u-boot in blue text



Edited 5 time(s). Last edit at 04/25/2020 05:57PM by bodhi.
Re: HowTo: Stora - Debian Stretch and OMV4
December 30, 2019 02:05AM
fcollingwood,

Excellent How-to! Will add this to the Wiki. Thanks for your contribution!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
December 30, 2019 08:04PM
bodhi Wrote:
-------------------------------------------------------
> fcollingwood,
>
> Excellent How-to! Will add this to the Wiki.
> Thanks for your contribution!

Thank YOU Bodhi for all your work that made this possible.

I've made a few updates, as there were a few errors and omissions, so the Wiki may need updating. Also, I didn't even know the Wiki existed, could you please direct me to the URL for it?



Edited 1 time(s). Last edit at 12/30/2019 08:28PM by fcollingwood.
Re: HowTo: Stora - Debian Stretch and OMV4
December 31, 2019 01:57AM
The Wiki thread is up above in each subforum stickies.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
January 02, 2020 07:59AM
Up in the Wiki:

https://forum.doozan.com/read.php?2,23630

Quote

Media Streaming

OpenMediaVault
Debian Stretch and OpenMediaVault (OMV4) on Netgear Stora

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
TrashCanMan
Re: HowTo: Stora - Debian Stretch and OMV4
January 08, 2020 05:02PM
Just a FYI i am trying to follow your guide for a slightly different device but also in the kirkwood family and i was strugling when i had to create the partition, bear in mind that im merelly an advanced user, not expert at all, where you tell:

Create EXT4 partition on /dev/sda1 and label it rootfs - mkfs.ext4 -l rootfs /dev/sda1

it needs to be

Create EXT4 partition on /dev/sda1 and label it rootfs - mkfs.ext4 -L rootfs /dev/sda1

see the capital L, i was getting super weird errors and i was unable to find the cause
Re: HowTo: Stora - Debian Stretch and OMV4
January 21, 2020 06:38AM
I thought omv-extras and its plugins weren't supported on armel... what would one gain from installing it?



Edited 1 time(s). Last edit at 01/21/2020 07:07AM by archon.
Re: HowTo: Stora - Debian Stretch and OMV4
February 24, 2020 11:48PM
Здравствуйте. Может кто нибудь мне поможет. У меня проблема с загрузкой Debian на Netgear Stora Поменял как по инструкции setenv и пошла загрузка линукс но почему пустые строки и в конце ошибка.Что же мне делать дальше? Как хотя бы вернуться к стандартным настройкам загрузчика?
Attachments:
open | download - экрана (2).png (97 KB)
Re: HowTo: Stora - Debian Stretch and OMV4
February 25, 2020 12:57AM
Google translate:

Quote

Hello. Maybe someone will help me. I have a problem downloading Debian on Netgear Stora. I changed it as per setenv instructions and Linux started to load, but why there are empty lines and an error at the end. What should I do next? How to at least return to the default bootloader settings?

Not sure about the question. I need to see the serial boot log to understand what was done.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
February 25, 2020 03:42AM
Прикрепил снимок в предыдущем сообщении почемуто он не отобразился.вот еще два
Attachments:
open | download - экрана (2).png (97 KB)
open | download - экрана (3).png (96.5 KB)
Re: HowTo: Stora - Debian Stretch and OMV4
February 25, 2020 04:14AM
Извините может мало информации. Я только включил флешку с вашим rootfs от 25 августа 2019 г. в усб разьем Netgear Stora включил последовательное соединение через com port в Putty остановил загрузку стоковой прошивки ввел >> setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x1100000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=LABEL=rootfs rootdelay=10; run bootcmd_usb; bootm 0x800000 0x1100000; reset'
setenv console 'console=ttyS0,115200 mtdparts=orion_nand:0x100000@0(uboot),0xff00000@0x100000(root)'
saveenv
reset<< а дальше как на снимке скриншот.
Re: HowTo: Stora - Debian Stretch and OMV4
February 25, 2020 04:21AM
cergei,

As a courtesy, I've translated your 1st post for you :) Please translate your post to English before posting to make it easier to read.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
February 25, 2020 04:26AM
cergei,

You missed Step 4 during rootfs creation. You are booting with stock u-boot so the DTB must be appended to uImage.


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

So mount the USB rootfs on another Linux box and login as root, do step 4 to create the uImage with Stora DTB appended to it. Bring it back to the Stora and boot.

=====

By the way, we should move this trouble shooting session to a new thread, it is way off topic for this thread. If you cannot boot , please create a new thread and repost your posts in that new thread.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 02/25/2020 04:31AM by bodhi.
Re: HowTo: Stora - Debian Stretch and OMV4
February 25, 2020 03:42PM
cergei ,

Please continue on this new thread with booting problem:

https://forum.doozan.com/read.php?2,96569

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
March 04, 2020 10:32PM
Hello. Will this script run on Netgear Stora with Debian installed from Bodhi. I want to install OMV4 on Debian already installed. And I don 't know how to do that. I ask to help.
imianz
Re: HowTo: Stora - Debian Stretch and OMV4
March 30, 2020 12:45AM
First of all I would like to give a big thank you to bodhi for this invaluable forum and of course also to fcollingwood for this useful guide.
Now, on my old STORA MS2000, I have the latest version of U-Boot, debian 9 (with OMV4) which loads from ide (RAID1 on two 2TB WD Green disks).
So I'm transferring all my data to the NAS but I'm having an annoying problem:

systemd-journald [302]: Failed to open runtime journal: No space left on device


the file transfer stops after some time because tmpfs / run is full, I tried to increase the size of tmpfs up to half the available ram (57MB) but the system seems never to be enough. The problem increases when the transfer involves many small files (all my archive of documents and source codes, for example, which is several gigabytes large).
Any suggestions?

root@stora:/# df -h -BM
Filesystem     1M-blocks    Used Available Use% Mounted on
udev                 51M      0M       51M   0% /dev
tmpfs                57M     14M       44M  24% /run
/dev/md0           8000M   2055M     5520M  28% /
tmpfs                57M      0M       57M   0% /dev/shm
tmpfs                 5M      0M        5M   0% /run/lock
tmpfs                57M      0M       57M   0% /sys/fs/cgroup
tmpfs                57M      0M       57M   0% /tmp
/dev/md3          31911M    244M    30025M   1% /srv/dev-disk-by-label-BACK
/dev/md2        1836265M 463241M  1279679M  27% /srv/dev-disk-by-label-DATI


root@stora:/# free
              total        used        free      shared  buff/cache   available
Mem:         115344       37760        6092        2808       71492       68172
Swap:        262076       51456      210620


root@stora:/# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>        <dump>  <pass>
LABEL=rootfs    /               ext4    noatime,errors=remount-ro 0  1
LABEL=swap      swap            swap    defaults             0       0
tmpfs           /tmp            tmpfs   defaults             0       0
##none            /run            tmpfs   defaults,size=20M    0       0
none            /run            tmpfs   defaults,size=57M    0       0
Re: HowTo: Stora - Debian Stretch and OMV4
March 30, 2020 03:40AM
imianz,

> systemd-journald [302]: Failed to open runtime
> journal: No space left on device

I don't use systemd on these NAS so can't advise you to the specifics.

In general, RAM is precious on this Stora and other 128MB NAS boxes, and you have HDD, so all logging should goes to the log in HDD. Don't use tmpfs for logging.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
imianz
Re: HowTo: Stora - Debian Stretch and OMV4
March 31, 2020 02:24AM
Thanks bodhi for replying.
I noticed that changing the file transfer program the load on tmpfs /run also changes a lot. So I temporarily solved it. In any case you are right, I have to learn more about how tmpfs works with systemd.
Thanks again.
imianz
Re: HowTo: Stora - Debian Stretch and OMV4
April 08, 2020 08:06AM
Hello,
i have some time to spend around to my nas stora so i tried to install debian 10 with OMV5. No problem during installation but OMV5 has some problems ... however, on balance, with both versions of OMV (with all the circus of systemd daemons) the system becomes a little more lazy.

So, at the end, I decided to restart from zero and configure my stora without OMV and using builtin sysvinit.
Ok, coming to the point, you built the system to be primarily run on USB devices, right? So syslogd stores the logs in ram, but since my system is installed on hard disk it is logical that the logs are stored on files (as you suggested).

Could the pre-installed syslogd to store logs on files or it has been compiled so that it only works on ram? (I see that no syslog.conf file exists).
In both cases, what do you suggest me to do?

Thanks in avance.
imianz
Re: HowTo: Stora - Debian Stretch and OMV4
April 08, 2020 01:09PM
ok, i searched the forum again and again and finally I found this::


Here is the config file for syslogd. If that SYSLOG_OPTS line is commented out like below, 
then the system logging will be back to disk (var/log). 

cat /etc/default/busybox-syslogd

# Defaults for busybox-syslogd initscript
# This is a POSIX shell fragment sourced by /etc/init.d/busybox-syslogd

# Additional options that are passed to the daemons.  Default is to log
# to ring buffer (to be read with logread(1)) and drop duplicates.
SYSLOG_OPTS="-C128"
KLOG_OPTS=""


Temporarily remove the option by commenting it out.

#SYSLOG_OPTS="-C128"

And then restart busybox-syslogd, or reboot the system.


It is enough?
Re: HowTo: Stora - Debian Stretch and OMV4
April 08, 2020 05:42PM
imianz,


>
> #SYSLOG_OPTS="-C128"
>
> And then restart busybox-syslogd, or reboot the
> system.

> It is enough?

Yes. That's all you need to do.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
April 25, 2020 05:25AM
Hello,
i am trying to restore my old Stora. I stuck on point 2) when i unplug the usb drive, debian 4.12.1 will not load from hdd in left bay. There is no need to do change in envs?


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:38:05 -0700)
Netgear Stora MS2110

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
Unknown command 'etenv' - try 'help'
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
** Bad device usb 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
resetting ...
Maybe i did something wrong with creating 8gb partition?
root@debian:~# fdisk -l
Disk /dev/mtdblock0: 1 MiB, 1048576 bytes, 2048 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock1: 6 MiB, 6291456 bytes, 12288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock2: 249 MiB, 261095424 bytes, 509952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9F0307D4-C7E5-4737-AD10-A0D4F61C7FEE

Device        Start      End  Sectors  Size Type
/dev/sda1      2048 16779263 16777216    8G Linux filesystem
/dev/sda2  16779264 17303551   524288  256M Plan 9 partition


Disk /dev/sdb: 7.5 GiB, 8053063680 bytes, 15728640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x98c0bdf7

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1        2048 15728639 15726592  7.5G 83 Linux
Re: HowTo: Stora - Debian Stretch and OMV4
April 25, 2020 06:55AM
bubenduben Wrote:
-------------------------------------------------------
> Hello,
> i am trying to restore my old Stora. I stuck on
> point 2) when i unplug the usb drive, debian
> 4.12.1 will not load from hdd in left bay. There
> is no need to do change in envs?
>
>
> 
> U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:38:05
> -0700)
> Netgear Stora MS2110
> 
> SoC:   Kirkwood 88F6281_A1
> DRAM:  128 MiB
> WARNING: Caches not enabled
> NAND:  256 MiB
> In:    serial
> Out:   serial
> Err:   serial
> Net:   egiga0
> PHY reset timed out
> 88E1116 Initialized on egiga0
> Hit any key to stop autoboot:  0
> Unknown command 'etenv' - try 'help'
> starting USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 1 USB Device(s)
> found
>        scanning usb for storage devices... 0
> Storage Device(s) found
> ** Bad device usb 0 **
> ** Bad device usb 0 **
> Wrong Image Format for bootm command
> ERROR: can't get kernel image!
> resetting ...
>
> Maybe i did something wrong with creating 8gb
> partition?
>
> root@debian:~# fdisk -l
> Disk /dev/mtdblock0: 1 MiB, 1048576 bytes, 2048
> sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512
> bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> 
> 
> Disk /dev/mtdblock1: 6 MiB, 6291456 bytes, 12288
> sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512
> bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> 
> 
> Disk /dev/mtdblock2: 249 MiB, 261095424 bytes,
> 509952 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512
> bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> 
> 
> Disk /dev/sda: 2.7 TiB, 3000592982016 bytes,
> 5860533168 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 4096
> bytes
> I/O size (minimum/optimal): 4096 bytes / 4096
> bytes
> Disklabel type: gpt
> Disk identifier:
> 9F0307D4-C7E5-4737-AD10-A0D4F61C7FEE
> 
> Device        Start      End  Sectors  Size Type
> /dev/sda1      2048 16779263 16777216    8G Linux
> filesystem
> /dev/sda2  16779264 17303551   524288  256M Plan 9
> partition
> 
> 
> Disk /dev/sdb: 7.5 GiB, 8053063680 bytes, 15728640
> sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512
> bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x98c0bdf7
> 
> Device     Boot Start      End  Sectors  Size Id
> Type
> /dev/sdb1        2048 15728639 15726592  7.5G 83
> Linux
>

Interrupt serial console at count down and,

printenv

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
April 25, 2020 12:31PM
printenv:
Netgear Stora> printenv
arcNumber=2743
baudrate=115200
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=8
bootargs_usb=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=ser                                                                                                                     ial
bootcmd=etenv bootargs $(console) root=LABEL=rootfs rootdelay=10; run bootcmd_us                                                                                                                     b; bootm 0x800000 0x1100000; reset
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then boo                                                                                                                     tm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_a                                                                                                                     ddr $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_usb=usb start; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1                                                                                                                      0x1100000 /boot/uInitrd
bootdelay=10
bootdev=usb
console=00 mtdparts=orion_nand:0x100000@0(uboot),0xf00000@0x100000(root)
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-netgear_stora_ms2000
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
fileaddr=800000
filesize=943910
if_netconsole=ping $serverip
ipaddr=192.168.0.51
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $d                                                                                                                     tb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /b                                                                                                                     oot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /bo                                                                                                                     ot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
preboot_nc=run if_netconsole start_netconsole
rootfstype=ext2
rootsetenv=bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 init=/bi                                                                                                                     n/systemd
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 di                                                                                                                     sknum 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.0.87
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10                                                                                                                      $mtdparts $custom_params init=/bin/systemd
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$root                                                                                                                     delay rootfstype=$rootfstype $mtdparts earlyprintk=serial
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; se                                                                                                                     tenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_init_devices=setenv init_usb "usb start";  setenv init_ide "ide reset";  se                                                                                                                     tenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_loadsetenv=usb_init
usb_ready_retry=15

Environment size: 2766/131068 bytes
Re: HowTo: Stora - Debian Stretch and OMV4
April 25, 2020 04:42PM
bubenduben,

Your listing of envs is messed up in your post. It is very hard to read.

However, I can see the problem is you already have my new u-boot and envs images installed. And it should remain that way. No envs change is needed.

fcollingwood boots this box with stock u-boot so the envs needed to change:

Quote

At this point, hit any key to stop the autoboot. Enter the following at the prompt:

setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x1100000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=LABEL=rootfs rootdelay=10; run bootcmd_usb; bootm 0x800000 0x1100000; reset'
setenv console 'console=ttyS0,115200 mtdparts=orion_nand:0x100000@0(uboot),0xff00000@0x100000(root)'
saveenv
reset

But with the new u-boot, you should not do the above. So you need to restore the bootcmd back to the original (uboot.2016.05-tld-1.environment):

setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
April 26, 2020 11:53AM
Thanks! Now it is booting correctly from hdd



Edited 1 time(s). Last edit at 04/26/2020 03:02PM by bubenduben.
Attachments:
open | download - printenv.txt (3 KB)
Re: HowTo: Stora - Debian Stretch and OMV4
April 26, 2020 03:06PM
You are installing the Debian distribution in the disk drives, and while it's good for storage... wouldn't render the box unusable (not bootinh) if there's a raid inconsistency or if both of the disks fail?

Wouldn't it be better if the Operating Systems is loading in the Flash disk? Is it any way to do that? Or perhaps I got it wrong and while debian is loaded in the flash OMV is loaded in the disk...



Edited 1 time(s). Last edit at 05/03/2020 08:36AM by cotarelo.
Re: HowTo: Stora - Debian Stretch and OMV4
June 27, 2020 04:56AM
Dear Bodhi
Well so far my Stora is behaving well since your help with recovery. I am now ready to put it to some use which means initialising the two HDDs and installing OMV. I now realise that the Debian Buster which we installed is not a good base for OMV on the Stora (underpowered) and that I need to downgrade to Debian Stretch and OMV4 per this posting. Do you recommend that I update the u-boot and flash it before changing the Debian? I was thinking of preserving the current USB drive (with saved copies of printenv and mtd0) and starting the Stretch / OMV4 process on a new USB drive which would need to be configured so that there is a Swap file partition for the 2 disk RAID. Does this make sense?
Thanks again and regards, Paul
Re: HowTo: Stora - Debian Stretch and OMV4
June 27, 2020 03:58PM
Hi Paul,

> Do you recommend that I update the
> u-boot and flash it before changing the Debian? I
> was thinking of preserving the current USB drive
> (with saved copies of printenv and mtd0) and
> starting the Stretch / OMV4 process on a new USB
> drive which would need to be configured so that
> there is a Swap file partition for the 2 disk
> RAID. Does this make sense?

You could do create a new Stretch USB rootfs with Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2. Save the Buster rootfs as a recovery rootfs. If there is problem in Stretch rootfs, you can just swap the USB rootfs out and boot into Buster, and and then plug in the Stretch rootf to fix it.

There is no need to change u-boot envs at all. Both USB rootfs will boot fine with your current u-boot envs.

Of course, it is always good to run the latest u-boot, but for your box (without kwboot), you should take it slow, and don't take uneccessary risk. In the future, you might consider installing new u-boot should you want to boot with Ext4 rootfs on USB, or use NFS rootfs,.. i.e. one of the advance features that you cannot do with stock u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: Stora - Debian Stretch and OMV4
June 29, 2020 10:00AM
Dear Bodhi

Thanks for your prompt response. I researched OMV and concluded that working with .ext4 format was essential, so I decided to proceed with your latest u-boot. All has gone well until I have reached step
e.2 Box specific envs:

Then for all boxes, restore these 2 envs using the saved envs text in step c (replace xxx with the real saved values)
fw_setenv mtdparts 'xxxxxxxxx'
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
Both of my saved copies of 'current_envs.txt' have no mtdparts defined, and the 'ethaddr' definition looks too simple:
ethaddr=00:00:11:22:33:44
I can see from my printenv I logged following the successful recovery, the following partition data
 3 fixed-partitions partitions found on MTD device orion_nand
 Creating 3 MTD partitions on "orion_nand":
 0x000000000000-0x000000100000 : "u-boot"
 0x000000100000-0x000000700000 : "uImage"
 0x000000700000-0x000010000000 : "root"
Is this 'long hand' for the mtdparts definition?
Please advise what I should do. Best regards, Paul



Edited 1 time(s). Last edit at 06/29/2020 10:32AM by pdc78.
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: