Welcome! Log In Create A New Profile

Advanced

HowTo: Stora - Debian Stretch and OMV4

Posted by fcollingwood 
HowTo: Stora - Debian Stretch and OMV4
December 29, 2019 06:54PM
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:

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

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



Edited 3 time(s). Last edit at 12/30/2019 08:02PM by fcollingwood.
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
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
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
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
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
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



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
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
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.
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: