Welcome! Log In Create A New Profile

Advanced

Problem booting NSA325v2 on HDD

Posted by saschadd 
Problem booting NSA325v2 on HDD
February 21, 2017 04:14AM
Dear bodhi,

first of all a big thank you for your great work!

I used your 2016.05 U-Boot on my NSA325v2 and everything went fine so far.
I am also using your Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 on my USB-Stick which is also working well.

As this new U-Boot should be able to boot ext4 rootfs i wanted to switch to an ext4 rootfs on the left sata disk which becomes sda when i remove the usbstick.

Because the harddisk is 3TB i made a clean GPT partition table and created partition 1 with 50GB and formatted it with ext4 and labeled it rootfs.
Then i followed your instructions for installing the rootfs on the stick by using the partition i just created on the disk.
After removing the stick it starts to boot but then gives kernel panic.

Here is the end of the output before it stops

[    1.253586] usb usb2: Product: xHCI Host Controller
[    1.258482] usb usb2: Manufacturer: Linux 4.4.0-kirkwood-tld-1 xhci-hcd
[    1.265138] usb usb2: SerialNumber: 0000:01:00.0
[    1.270348] hub 2-0:1.0: USB hub found
[    1.274179] hub 2-0:1.0: 2 ports detected
[    1.278648] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.283951] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 3
[    1.291442] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    1.299690] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003
[    1.306521] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.313853] usb usb3: Product: xHCI Host Controller
[    1.318755] usb usb3: Manufacturer: Linux 4.4.0-kirkwood-tld-1 xhci-hcd
[    1.325414] usb usb3: SerialNumber: 0000:01:00.0
[    1.330584] hub 3-0:1.0: USB hub found
[    1.334405] hub 3-0:1.0: 2 ports detected
[    1.339173] mousedev: PS/2 mouse device common for all mice
[    1.345090] i2c /dev entries driver
[    1.349188] rtc-pcf8563 0-0051: chip found, driver version 0.4.4
[    1.359673] rtc rtc0: invalid alarm value: 2017-2-29 22:74:0
[    1.365547] rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0
[    1.374822] hidraw: raw HID events driver (C) Jiri Kosina
[    1.380545] drop_monitor: Initializing network drop monitor service
[    1.387065] NET: Registered protocol family 17
[    1.391744] Key type dns_resolver registered
[    1.396649] registered taskstats version 1
[    1.400798] Loading compiled-in X.509 certificates
[    1.405679] zswap: loaded using pool lzo/zbud
[    1.410881] Key type encrypted registered
[    1.416726] rtc-pcf8563 0-0051: setting system clock to 2017-02-21 09:53:50 UTC (1487670830)
[    1.427005] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.434691] Please append a correct "root=" boot option; here are the available partitions:
[    1.443297] 1f00          131072 mtdblock0  (driver?)
[    1.448378] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.456681] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0-kirkwood-tld-1 #1
[    1.463670] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[    1.469983] [<c0016784>] (unwind_backtrace) from [<c00129f8>] (show_stack+0x10/0x14)
[    1.477761] [<c00129f8>] (show_stack) from [<c00c2200>] (panic+0x80/0x214)
[    1.484669] [<c00c2200>] (panic) from [<c07d9280>] (mount_block_root+0x204/0x24c)
[    1.492182] [<c07d9280>] (mount_block_root) from [<c07d93b4>] (mount_root+0xec/0x118)
[    1.500047] [<c07d93b4>] (mount_root) from [<c07d9504>] (prepare_namespace+0x124/0x184)
[    1.508086] [<c07d9504>] (prepare_namespace) from [<c07d8e9c>] (kernel_init_freeable+0x208/0x258)
[    1.517002] [<c07d8e9c>] (kernel_init_freeable) from [<c05b16b4>] (kernel_init+0x8/0xe4)
[    1.525127] [<c05b16b4>] (kernel_init) from [<c000f090>] (ret_from_fork+0x14/0x24)
[    1.532730] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Unfortunately i am not able to get all output as i am using my raspi with "sudo screen /dev/ttyAMA0 115200" to get to the console and the first parts are no longer available.

Something i must be doing wrong but couldnt find it yet.

Here is my printenv output:

U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:48:40 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
NSA325> printenv
ide_rootfstype ext4
arcNumber=4495
baudrate=115200
bootargs=root=/dev/nfs nfsroot=: ip=::::::off
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 ide
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa325.dtb
ethact=egiga0
ethaddr=00:00:00:00:00:00
ide_rootfstype=ext4
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)
partition=nand0,2
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
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_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 0; do run uenv_read_disk; done; done;
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_ready_retry=15

Environment size: 2715/131068 bytes

Thanks in advance for any hint on that failure.

sascha



Edited 1 time(s). Last edit at 02/21/2017 05:03AM by bodhi.
saschadd,

Don't use screen. picocom is among the best tools for serial console. On rPi you can install picocom, and you will be able to capture the entire serial boot log.

apt-get install picocom


[    1.427005] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.434691] Please append a correct "root=" boot option; here are the available partitions:
[    1.443297] 1f00          131072 mtdblock0  (driver?)
[    1.448378] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.456681] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0-kirkwood-tld-1 #1
[    1.463670] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[    1.469983] [<c0016784>] (unwind_backtrace) from [<c00129f8>] (show_stack+0x10/0x14)
[    1.477761] [<c00129f8>] (show_stack) from [<c00c2200>] (panic+0x80/0x214)
[    1.484669] [<c00c2200>] (panic) from [<c07d9280>] (mount_block_root+0x204/0x24c)
[    1.492182] [<c07d9280>] (mount_block_root) from [<c07d93b4>] (mount_root+0xec/0x118)
[    1.500047] [<c07d93b4>] (mount_root) from [<c07d9504>] (prepare_namespace+0x124/0x184)
[    1.508086] [<c07d9504>] (prepare_namespace) from [<c07d8e9c>] (kernel_init_freeable+0x208/0x258)
[    1.517002] [<c07d8e9c>] (kernel_init_freeable) from [<c05b16b4>] (kernel_init+0x8/0xe4)
[    1.525127] [<c05b16b4>] (kernel_init) from [<c000f090>] (ret_from_fork+0x14/0x24)
[    1.532730] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

This error is becasue the rootfs could not be mounted. And that usually is because one of the following:

1. kernel bootargs was not set properly. Either the serial boot log, or at the minumum dmesg output, must be captured and posted here so I can see what it looks like.

2. A missing step somewhere during the creation of the rootfs. The rootfs instruction must be followed verbatim. If you had to replace a step with something equivalence, then that step might have been wrong.

3. Especially, since you are booting with the new u-boot, step 4 in the rootfs creation is not applicable. You can look at the /boot on the rootfs to see if you have mistakenly appended the DTB to uImage.

After you have checked 3 items above and still can not boot, then please post the entire serial bootlog here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
February 25, 2017 08:31PM
bodhi,

thank you very much for pointing me into the right direction and for the tip with picocom which is far better.
Well its my first time working on the serial console and so i took the first tutorial which mentioned screen. ;)

I rechecked everything and found some mistakes i made.
So i did the uboot update again step by step and then i tried the ext4 rootfs again and it is booting up as expected.
Will it be possible to boot up an btrfs rootfs in the future?

Only thing that is not working yet completely is systemd as the command systemctl gives me following error

Failed to get D-Bus connection: Unknown error -1

I already tried to find some hints by searching the forum and the internet but havent found some yet.
Maybe you know what is causing this error?

sascha



Edited 1 time(s). Last edit at 02/25/2017 09:23PM by saschadd.
Re: Problem booting NSA325v2 on HDD
February 26, 2017 12:00AM
saschadd,

> I rechecked everything and found some mistakes i m
> ade.
> So i did the uboot update again step by step and t
> hen i tried the ext4 rootfs again and it is bootin
> g up as expected.

Cool!

> Will it be possible to boot up an btrfs rootfs in
> the future?

You can boot with btrfs rootfs already! but this requires you to have /boot folder in a separate partition, and it must be the first partition. So the disk drive must be formatted with 2 partitions, boot partition (1st) is ext3/ext4, rootfs partitiion (2nd) is btrfs. U-boot can only load the kernel from fat/ext2/3/4 file system.

>
> Only thing that is not working yet completely is s
> ystemd as the command systemctl gives me following
> error
>
> Failed to get D-Bus connection: Unknown error -1
>
> I already tried to find some hints by searching th
> e forum and the internet but havent found some yet

Did you set up the bootarg to run with systemd?

Quote

Note2:

To boot with systemd, add this parameter to your u-boot env bootargs. If you are booting with my latest u-boot images then use the uEnv.txt capability to do this. See the instruction about uEnvt.txt in that thread.
init=/bin/systemd
For example,
fw_setenv usb_set_bootargs 'setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts init=/bin/systemd'

If that's still not possible to run systemd, you might want to install it again:
apt-get install systemd

If the systemd problem persists, do apt-get update and apt-get upgrade.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
February 26, 2017 04:32AM
LOL about myself now :D

I made completely nonense regarding the systemd.
I just made an file uEnv.txt in /boot and entered just init=/bin/systemd into it.
This couldnt have worked as expected.

I checked my env again and found this line

set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params

and added the init=/bin/systemd to it be executing

fw_setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params init=/bin/systemd'

Now it is working as it should. Sorry for this stoopid mistake. ;)


Regarding the btrfs boot:
Is it sufficient to
- make partition 1 with ext4 and label boot
- moving folder boot to that new partition
- make partition 2 with btrfs and label rootfs (will this work with btrfs raid1 made of sdb1 and sdc2?)
- moving anything else to that partition

Do i have to modify anything in /boot so that the new rootfs gets found?
Sorry for so many questions but i am very new to this modifying of the "standard install".

sascha
Re: Problem booting NSA325v2 on HDD
February 26, 2017 07:04AM
I tried to be not to shy and try it on my own with trial and error. ;)

Btrfs gets loaded but then it gets stuck

Btrfs loaded
Begin: Checking root file system ... fsck from util-linux 2.25.2
done.
[   15.958679] BTRFS: device label rootfs devid 1 transid 15 /dev/sda2
[   15.967064] BTRFS info (device sda2): disk space caching is enabled
[   15.974754] BTRFS: failed to read the system array on sda2
[   15.992941] BTRFS: open_ctree failed
mount: mounting /dev/sda2 on /root failed: Invalid argument
done.

After some more failure messages i get thrown to BusyBox.
So far my own try was not as successful as i wanted it to be.



Edited 2 time(s). Last edit at 02/26/2017 02:02PM by saschadd.
Re: Problem booting NSA325v2 on HDD
February 26, 2017 03:28PM
saschadd,

Best that you post the entire serial boot log, until the initramfs prompt where the rootfs could not be mounted.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
February 26, 2017 04:24PM
Okay, here is the complete serial bootlog

sudo picocom -b 115200 /dev/ttyAMA0
picocom v1.7

port is        : /dev/ttyAMA0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        :
omap is        :
emap is        : crcrlf,delbs,

Terminal ready


U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:48:40 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: Bus 0: .OK Bus 1: .OK
  Device 0: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG653NA
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
  Device 1: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG6624A
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
Unknown command 'mmc' - try 'help'

no USB devices available

Partition Map for IDE device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0x000327ff      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   34420f0e-52f6-4c67-b061-90b25f186a0d
  2     0x00032800      0x064327ff      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   51b13c41-e043-4ce5-99da-ea0dde2cc07e
  3     0x0c832800      0x15d50a38e     "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   58a13df2-a3cb-46f9-af3a-298cdd5f3b87


Partition Map for IDE device 1  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0x064007ff      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   7bd728e7-ca8e-44b9-86ac-e171000e298b
  2     0x0c800800      0x15d50a38e     "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   b32752d2-67e1-4466-b3cb-b5606f4c159a
loading envs from ide 0 ...
** File not found /boot/uEnv.txt **
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: OK
  Device 0: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG653NA
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
  Device 1: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG6624A
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
device ide 0:1
1 bytes read in 12 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
3154896 bytes read in 1108 ms (2.7 MiB/s)
loading uInitrd ...
7179935 bytes read in 2521 ms (2.7 MiB/s)
loading DTB /boot/dts/kirkwood-nsa325.dtb ...
14528 bytes read in 27 ms (525.4 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.4.0-kirkwood-tld-1
   Created:      2016-02-19   5:55:25 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3154832 Bytes = 3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.4.0-kirkwood-tld-1
   Created:      2016-02-19   7:33:04 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7179871 Bytes = 6.8 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
   Loading Kernel Image ... OK
   Loading Ramdisk to 1f439000, end 1fb11e5f ... OK
   Loading Device Tree to 1f432000, end 1f4388bf ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.0-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Mon Jan 25 20:35:24 PST 2016
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: ZyXEL NSA325
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) init=/bin/systemd
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 503452K/524288K available (6007K kernel code, 573K rwdata, 1992K rodata, 296K init, 312K bss, 20836K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc07d7ef4   (8000 kB)
[    0.000000]       .init : 0xc07d8000 - 0xc0822000   ( 296 kB)
[    0.000000]       .data : 0xc0822000 - 0xc08b169c   ( 574 kB)
[    0.000000]        .bss : 0xc08b169c - 0xc08ff9d0   ( 313 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000007] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000281] Console: colour dummy device 80x30
[    0.000308] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.090068] pid_max: default: 32768 minimum: 301
[    0.090160] Security Framework initialized
[    0.090225] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090242] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090888] Initializing cgroup subsys io
[    0.090917] Initializing cgroup subsys devices
[    0.090938] Initializing cgroup subsys freezer
[    0.090966] Initializing cgroup subsys net_cls
[    0.091036] CPU: Testing write buffer coherency: ok
[    0.091429] Setting up static identity map for 0x8200 - 0x8258
[    0.091702] mvebu-soc-id: MVEBU SoC ID=0x6282, Rev=0x1
[    0.094751] devtmpfs: initialized
[    0.099756] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.100199] prandom: seed boundary self test passed
[    0.103005] prandom: 100 self tests passed
[    0.103027] pinctrl core: initialized pinctrl subsystem
[    0.104172] NET: Registered protocol family 16
[    0.104604] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.130089] cpuidle: using governor ladder
[    0.160087] cpuidle: using governor menu
[    0.160538] Feroceon L2: Enabling L2
[    0.160575] Feroceon L2: Cache support initialised.
[    0.160907] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.165367] No ATAGs?
[    0.201295] vgaarb: loaded
[    0.201593] usbcore: registered new interface driver usbfs
[    0.201655] usbcore: registered new interface driver hub
[    0.201705] usbcore: registered new device driver usb
[    0.202672] clocksource: Switched to clocksource orion_clocksource
[    0.245798] NET: Registered protocol family 2
[    0.246463] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.246519] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.246571] TCP: Hash tables configured (established 4096 bind 4096)
[    0.246622] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.246644] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.246809] NET: Registered protocol family 1
[    0.247141] RPC: Registered named UNIX socket transport module.
[    0.247150] RPC: Registered udp transport module.
[    0.247156] RPC: Registered tcp transport module.
[    0.247161] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.247391] Unpacking initramfs...
[    0.737034] Freeing initrd memory: 7012K (df439000 - dfb12000)
[    0.737235] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.738145] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.738204] audit: initializing netlink subsys (disabled)
[    0.738253] audit: type=2000 audit(0.730:1): initialized
[    0.738537] Initialise system trusted keyring
[    0.738864] zbud: loaded
[    0.739101] VFS: Disk quotas dquot_6.6.0
[    0.739151] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.739593] NFS: Registering the id_resolver key type
[    0.739625] Key type id_resolver registered
[    0.739632] Key type id_legacy registered
[    0.739652] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.739663] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.739848] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.740271] Key type big_key registered
[    0.756169] Key type asymmetric registered
[    0.756188] Asymmetric key parser 'x509' registered
[    0.756270] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.756288] io scheduler noop registered
[    0.756299] io scheduler deadline registered
[    0.756350] io scheduler cfq registered (default)
[    0.757450] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.757996] irq: Cannot allocate irq_descs @ IRQ33, assuming pre-allocated
[    0.758319] irq: Cannot allocate irq_descs @ IRQ65, assuming pre-allocated
[    0.758941] mvebu-pcie mbus:pcie-controller: PCI host bridge to bus 0000:00
[    0.758956] pci_bus 0000:00: root bus resource [io  0x1000-0xfffff]
[    0.758967] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xefffffff]
[    0.758977] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.759274] PCI: bus0: Fast back to back transfers disabled
[    0.759295] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.772791] PCI: bus1: Fast back to back transfers disabled
[    0.772935] pci 0000:00:01.0: BAR 14: assigned [mem 0xe0000000-0xe00fffff]
[    0.772951] pci 0000:01:00.0: BAR 0: assigned [mem 0xe0000000-0xe0001fff 64bit]
[    0.772971] pci 0000:00:01.0: PCI bridge to [bus 01]
[    0.772984] pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xe00fffff]
[    0.773053] pcieport 0000:00:01.0: enabling device (0140 -> 0142)
[    0.773139] pci 0000:01:00.0: enabling device (0140 -> 0142)
[    0.773385] mv_xor f1060800.xor: Marvell shared XOR driver
[    0.813198] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.813392] mv_xor f1060900.xor: Marvell shared XOR driver
[    0.853195] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.853586] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.854709] console [ttyS0] disabled
[    0.854763] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
[    1.547310] console [ttyS0] enabled
[    1.551878] nand: device found, Manufacturer ID: 0x92, Chip ID: 0xf1
[    1.558287] nand: Eon NAND 128MiB 3,3V 8-bit
[    1.562575] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.570199] Scanning device for bad blocks
[    1.579141] Bad eraseblock 100 at 0x000000c80000
[    1.588550] Bad eraseblock 200 at 0x000001900000
[    1.637608] libphy: Fixed MDIO Bus: probed
[    1.642012] libphy: orion_mdio_bus: probed
[    1.650050] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    1.657400] mv643xx_eth: Set the PHY to fix link down
[    1.663006] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:50:43:00:02:02
[    1.672035] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.678665] ehci-pci: EHCI PCI platform driver
[    1.683230] ehci-orion: EHCI orion driver
[    1.687401] orion-ehci f1050000.ehci: EHCI Host Controller
[    1.692960] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    1.700773] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    1.722697] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    1.728919] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.735761] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.743025] usb usb1: Product: EHCI Host Controller
[    1.747919] usb usb1: Manufacturer: Linux 4.4.0-kirkwood-tld-1 ehci_hcd
[    1.754579] usb usb1: SerialNumber: f1050000.ehci
[    1.759897] hub 1-0:1.0: USB hub found
[    1.763736] hub 1-0:1.0: 1 port detected
[    1.768206] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.773517] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    1.781245] xhci_hcd 0000:01:00.0: hcc params 0x014042cb hci version 0x96 quirks 0x00000004
[    1.789864] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    1.796703] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.803968] usb usb2: Product: xHCI Host Controller
[    1.808863] usb usb2: Manufacturer: Linux 4.4.0-kirkwood-tld-1 xhci-hcd
[    1.815521] usb usb2: SerialNumber: 0000:01:00.0
[    1.820731] hub 2-0:1.0: USB hub found
[    1.824568] hub 2-0:1.0: 2 ports detected
[    1.829057] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.834363] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 3
[    1.841865] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    1.850113] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003
[    1.856947] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.864285] usb usb3: Product: xHCI Host Controller
[    1.869179] usb usb3: Manufacturer: Linux 4.4.0-kirkwood-tld-1 xhci-hcd
[    1.875842] usb usb3: SerialNumber: 0000:01:00.0
[    1.881042] hub 3-0:1.0: USB hub found
[    1.884868] hub 3-0:1.0: 2 ports detected
[    1.889684] mousedev: PS/2 mouse device common for all mice
[    1.895617] i2c /dev entries driver
[    1.899748] rtc-pcf8563 0-0051: chip found, driver version 0.4.4
[    1.910245] rtc rtc0: invalid alarm value: 2017-2-29 22:74:0
[    1.916132] rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0
[    1.925634] hidraw: raw HID events driver (C) Jiri Kosina
[    1.931371] drop_monitor: Initializing network drop monitor service
[    1.937898] NET: Registered protocol family 17
[    1.942568] Key type dns_resolver registered
[    1.947646] registered taskstats version 1
[    1.951800] Loading compiled-in X.509 certificates
[    1.956678] zswap: loaded using pool lzo/zbud
[    1.968354] Key type encrypted registered
[    1.974209] rtc-pcf8563 0-0051: setting system clock to 2017-02-26 22:21:09 UTC (1488147669)
[    1.985334] Freeing unused kernel memory: 296K (c07d8000 - c0822000)
Loading, please wait...
[    2.053411] systemd-udevd[81]: starting version 215
[    2.059906] random: systemd-udevd urandom read with 4 bits of entropy available
[    2.082784] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    2.207920] SCSI subsystem initialized
[    2.244670] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[    2.251424] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.271193] usb 1-1: Product: USB2.0 Hub
[    2.280388] hub 1-1:1.0: USB hub found
[    2.289685] sata_mv f1080000.sata: slots 32 ports 2
[    2.294732] hub 1-1:1.0: 4 ports detected
[    2.336150] scsi host0: sata_mv
[    2.352796] scsi host1: sata_mv
[    2.356230] ata1: SATA max UDMA/133 irq 32
[    2.360343] ata2: SATA max UDMA/133 irq 32
[    2.902709] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    2.942736] ata1.00: ATA-8: Hitachi HUA723030ALA640, MKAOA580, max UDMA/133
[    2.949728] ata1.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    3.012735] ata1.00: configured for UDMA/133
[    3.033072] scsi 0:0:0:0: Direct-Access     ATA      Hitachi HUA72303 A580 PQ: 0 ANSI: 5
[    3.552711] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    3.592735] ata2.00: ATA-8: Hitachi HUA723030ALA640, MKAOA580, max UDMA/133
[    3.599726] ata2.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    3.662732] ata2.00: configured for UDMA/133
[    3.683044] scsi 1:0:0:0: Direct-Access     ATA      Hitachi HUA72303 A580 PQ: 0 ANSI: 5
[    3.703102] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
[    3.711255] sd 1:0:0:0: [sdb] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
[    3.721834] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    3.727468] sd 0:0:0:0: [sda] Write Protect is off
[    3.732526] sd 1:0:0:0: [sdb] Write Protect is off
[    3.740286] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.749578] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.759307] sd 1:0:0:0: Attached scsi generic sg1 type 0
[    3.801259]  sda: sda1 sda2 sda3
[    3.806846] sd 0:0:0:0: [sda] Attached SCSI disk
[    3.812273]  sdb: sdb1 sdb2
[    3.821521] sd 1:0:0:0: [sdb] Attached SCSI disk
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
[   14.353015] raid6: int32x1  gen()   112 MB/s
[   14.522772] raid6: int32x1  xor()    73 MB/s
[   14.692819] raid6: int32x2  gen()   157 MB/s
[   14.862729] raid6: int32x2  xor()   104 MB/s
[   15.032890] raid6: int32x4  gen()   163 MB/s
[   15.202906] raid6: int32x4  xor()   115 MB/s
[   15.372710] raid6: int32x8  gen()   156 MB/s
[   15.542693] raid6: int32x8  xor()   105 MB/s
[   15.546977] raid6: using algorithm int32x4 gen() 163 MB/s
[   15.552392] raid6: .... xor() 115 MB/s, rmw enabled
[   15.557299] raid6: using intx1 recovery algorithm
[   15.563788] xor: measuring software checksum speed
[   15.662703]    arm4regs  :  1453.200 MB/sec
[   15.762723]    8regs     :   872.400 MB/sec
[   15.862694]    32regs    :  1207.600 MB/sec
[   15.866898] xor: using function: arm4regs (1453.200 MB/sec)
[   15.900476] Btrfs loaded
Begin: Checking root file system ... fsck from util-linux 2.25.2
done.
[   15.948628] BTRFS: device label rootfs devid 1 transid 15 /dev/sda2
[   15.957012] BTRFS info (device sda2): disk space caching is enabled
[   15.964751] BTRFS: failed to read the system array on sda2
[   15.982932] BTRFS: open_ctree failed
mount: mounting /dev/sda2 on /root failed: Invalid argument
done.
Target filesystem doesn't have requested /bin/systemd.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
done.
No init found. Try passing init= bootarg.
modprobe: module i8042 not found in modules.dep
[   16.102572] uhci_hcd: USB Universal Host Controller Interface driver
[   16.115870] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   16.129411] usbcore: registered new interface driver usbhid
[   16.135112] usbhid: USB HID core driver


BusyBox v1.22.1 (Debian 1:1.22.0-9+deb8u1) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
(initramfs)

Re: Problem booting NSA325v2 on HDD
February 26, 2017 05:58PM
saschadd,

With systemd, there are many bugs in earlier version. So I would

1. upgrade the kernel to linux-4.9.0-kirkwood-tld-1-bodhi.tar.bz2

2. And then do apt-get update, apt-get upgrade.

3. Add btrfs to list of modules to /etc/initramfs-tools/modules. And regenerate initramfs and uInitrd.

One minor problem in bootargs that should be fixed:

[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) init=/bin/systemd

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
February 27, 2017 03:58AM
bodhi Wrote:
-------------------------------------------------------
> saschadd,
>
> With systemd, there are many bugs in earlier versi
> on. So I would
>
> 1. upgrade the kernel to linux-4.9.0-kirkwood-tld-
> 1-bodhi.tar.bz2
>
> 2. And then do apt-get update, apt-get upgrade.

You are right.
Well this is the original rootfs version 4.4.0-kirkwood-tld-1 - released 20 Feb 2016 just unpacked to the btrfs raid 1 rootfs and moved /boot folder to partition one labeled boot.

To update the kernel i need the system already up and running or am i wrong?

> 3. Add btrfs to list of modules to /etc/initramfs-
> tools/modules. And regenerate initramfs and uInitr
> d.

This has to be done on the running system as well?

>
> One minor problem in bootargs that should be fixed
> :
>
>
> [    0.000000] Kernel command line: console=ttyS0,
> 115200 root=LABEL=rootfs rootdelay=10 orion_nan
> d:0x100000(uboot),0x80000(uboot_env),0x80000(k
> ey_store),0x80000(info),0xA00000(etc),0xA00000(ker
> nel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC
> 0000(rootfs2) init=/bin/systemd
>

Thanks, fixed it in mtdparts.
Re: Problem booting NSA325v2 on HDD
February 27, 2017 04:33AM
saschadd,

>
> To update the kernel i need the system already up
> and running or am i wrong?

You should boot up the Ext3 rootfs, upgrade the kernel, apt-get upgrade. And then copy the Ext3 rootfs to an empty btrfs partition.

Normally, you could chroot into a rootfs that is not running and then upgrade kernel and packages. But these 2 are newly created rootfs, so it is really simpler to upgrade the kernel on a live system than chroot into the btrfs partition.

>
> > 3. Add btrfs to list of modules to /etc/initramf
> s-
> > tools/modules. And regenerate initramfs and uIni
> tr
> > d.
>
> This has to be done on the running system as well?
>

Similar answer as above. Should do this right after upgrading kernel, since the uInitrd needs to be regenerated. So do this is a live system is simpler.

All that said, if you have already installed a lot of stuff in the brtfs rootfs, then do everything by chroot into it will save time.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
February 27, 2017 07:16AM
I already had the idea about doing this on on the already running live system on the stick and then moving to the sata drive.
But i had the idea while on the road so i am just yet able to try.
Do i have to copy it with a special command or just copy everything from sda1 to sdb1 for example.

As i am brand new to this initramfs and unitrd rebuilding i dont know where to get that btrfs module.
Is it already somewhere on the rootfs or do i have to download it somewhere?
Re: Problem booting NSA325v2 on HDD
February 27, 2017 02:16PM
saschadd Wrote:
-------------------------------------------------------
> I already had the idea about doing this on on the
> already running live system on the stick and then
> moving to the sata drive.
> But i had the idea while on the road so i am just
> yet able to try.
> Do i have to copy it with a special command or jus
> t copy everything from sda1 to sdb1 for example.

Use a different Linux box. Assuming your USB is mounted at /media/sda1, and HDD is mounted at /media/sdb1. Become root, and copy

su
cd /media/sdb1
time cp -aR /media/sda1/* .


> As i am brand new to this initramfs and unitrd reb
> uilding i dont know where to get that btrfs module
> .
> Is it already somewhere on the rootfs or do i have
> to download it somewhere?

Here is an example for addding the netconsole module and regenerate initramfs. Put the module name btrfs in file /etc/initramfs-tools/modules.

http://forum.doozan.com/read.php?2,9522,9522#msg-9522

Note: this adding module name might be redundant, but with a possibly buggy systemd, it might serve as a workaround the bugs.

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



Edited 2 time(s). Last edit at 02/27/2017 02:19PM by bodhi.
Re: Problem booting NSA325v2 on HDD
February 27, 2017 04:03PM
bodhi,

i was already working on this over the day and got the btrfs module loaded etc.

But i think the kernel module is not able to load an btrfs raid1 rootfs as i get the following error when booting it.

Btrfs loaded, crc32c=crc32c-generic
Begin: Will now check root file system ... fsck from util-linux 2.25.2
done.
[   19.187676] BTRFS: device label rootfs devid 1 transid 31 /dev/sda2
[   19.196077] BTRFS info (device sda2): disk space caching is enabled
[   19.202378] BTRFS info (device sda2): has skinny extents
[   19.209212] BTRFS error (device sda2): failed to read the system array: -5
[   19.242813] BTRFS error (device sda2): open_ctree failed
mount: mounting /dev/sda2 on /root failed: Invalid argument
done.

Just tried to have just a single btrfs partition without raid and this is starting, even if systemd gives me some failures

[FAILED] Failed to start Remount Root and Kernel File Systems.
...
[FAILED] Failed to start Load/Save Random Seed.
...
[FAILED] Failed to start Update UTMP about System Boot/Shutdown.
[DEPEND] Dependency failed for Update UTMP about System Runlevel Changes.

Maybe it is a problem of the raid1 or of my different approach to copy the rootfs while running with

tar -c --one-file-system -f - . | (cd /media/sdb2/; tar -xvf -)

But as it is quite late in Germany and i am sitting already to long in front of the monitor today, i will check this tomorrow.
So far i am happy with the results even if it is not already everything set.

I wrote down what i did, which i could post as a howto for other people who want to achieve the same. ;)
Re: Problem booting NSA325v2 on HDD
February 28, 2017 03:25AM
After some more reading and testing i think it is not that the boot of an btrfs raid is impossible but you have to boot it with uuid

Now i tried to set the bootargs for sata boot in uEnv.txt but it is not working as intended.
Thats my uEnv.txt which gets loaded but does nothing.

sata_root=2f613613-85b4-46cf-bbbe-90a1748f7753
sata_rootstype=btrfs
sata_rootflags=defaults,compress,subvol=@
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$sata_rootfstype rootflags=$sata_rootflags $mtdparts

Do i use wrong variables? Is there a list of available uboot variables somewhere?
Re: Problem booting NSA325v2 on HDD
February 28, 2017 03:37AM
saschadd,

> Do i use wrong variables? Is there a list of avail
> able uboot variables somewhere?

Either root LABEL or UUID should work.

root=LABEL=rootfs
require initramfs, i.e. uInitrd

root=UUID=2f613613-85b4-46cf-bbbe-90a1748f7753
does not require initramfs, but you are limited to this UUID. This is how Arch boot without initrd (therefore the LABEL option is not available to Arch).

And judging from your boot log, the btrfs file system was regconized by the kernel, so sata_rootstype=btrfs is redundant. But it does not hurt to specify that bootarg explicitly.

Try UUID bootarg and get it working first, if that is necessary. And then play with LABEL, because rootfs LABEL is the best way to boot a rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
February 28, 2017 05:04AM
Hmm, confirmed that the reasion for the failures

[FAILED] Failed to start Remount Root and Kernel File Systems.
...
[FAILED] Failed to start Load/Save Random Seed.
...
[FAILED] Failed to start Update UTMP about System Boot/Shutdown.
[DEPEND] Dependency failed for Update UTMP about System Runlevel Changes.

was not my different approach of copying.
They persist even after copying with your command

time cp -aR /media/sda1/* .

Trying to boot with non raid1 btrfs and then converting it to raid1 with

mount /dev/sdb1 /mnt
btrfs device add /dev/sdc1 /mnt
btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt

does also not do the trick.

So i assume i am trying to do something which isnt possible. ;)
Re: Problem booting NSA325v2 on HDD
February 28, 2017 10:04AM
Okay, i need to make a btrfs device scan before the rootfs gets mounted as stated in the official btrfs FAQs.

With multiple devices, btrfs normally needs an initramfs to perform a device scan. It may be necessary to modprobe (and then rmmod) scsi-wait-scan to work around a race condition.
....

btrfs device scan

This should be in many distributions' startup scripts (and initrd images, if your root filesystem is btrfs), but you may have to add it yourself.

I have to add somewhere in an script something like the following

mount_root() {
    echo "scanning for btrfs filesystems.... will take about 5-10 seconds"
#
#  earlier versions of btrfs required devices on scan.  As of around 0.19.11 or so this now is a syntax error
#
#    /sbin/btrfs device scan /dev/sda /dev/sdb
    /sbin/btrfs device scan
    echo "mounting /mnt/root"
    mount /mnt/root
}

But how do i modify the initramfs to do this?

I am feeling like following the white rabbit... it goes deeper and deeper....



Edited 1 time(s). Last edit at 02/28/2017 12:39PM by saschadd.
Re: Problem booting NSA325v2 on HDD
February 28, 2017 03:59PM
saschadd,

1. Have you added the module to initramfs-tools/modules ? this is the way to tell the kernel to beware of btrfs earlier.

2. If in doubt, switch back to sysvinit and work this out. That eliminates an unknown variable. IIRC, systemd had some problem with mounting btrfs in the past.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
February 28, 2017 04:24PM
bodhi,

bodhi Wrote:
-------------------------------------------------------
> saschadd,
>
> 1. Have you added the module to initramfs-tools/modules ? this is the way to tell the kernel to beware of btrfs earlier.

Yes, module is added and loaded at boot.

> 2. If in doubt, switch back to sysvinit and work this out. That eliminates an unknown variable. IIRC, systemd had some problem with mounting btrfs in the past.

Unfortunately this doesnt change things.
After removing systemd by doing

fw_setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params

the following is the output of console boot

U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:48:40 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: Bus 0: OK Bus 1: OK
  Device 0: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG653NA
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
  Device 1: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG6624A
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
Unknown command 'mmc' - try 'help'

no USB devices available

Partition Map for IDE device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0x000327ff      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   34420f0e-52f6-4c67-b061-90b25f186a0d
  2     0x00032800      0x064327ff      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   51b13c41-e043-4ce5-99da-ea0dde2cc07e
  3     0x0c832800      0x15d50a38e     "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   58a13df2-a3cb-46f9-af3a-298cdd5f3b87


Partition Map for IDE device 1  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000800      0x064007ff      "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   7bd728e7-ca8e-44b9-86ac-e171000e298b
  2     0x0c800800      0x15d50a38e     "Linux filesystem"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   b32752d2-67e1-4466-b3cb-b5606f4c159a
loading envs from ide 0 ...
287 bytes read in 16 ms (16.6 KiB/s)
Unknown command 'mmc' - try 'help'
importing envs ...
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: OK
  Device 0: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG653NA
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
  Device 1: Model: Hitachi HUA723030ALA640  Firm: MKAOA580 Ser#: MK0331YHG6624A
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 2861588.4 MB = 2794.5 GB (5860533168 x 512)
device ide 0:1
1 bytes read in 16 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
3260992 bytes read in 1153 ms (2.7 MiB/s)
loading uInitrd ...
7429671 bytes read in 2605 ms (2.7 MiB/s)
loading DTB /boot/dts/kirkwood-nsa325.dtb ...
14548 bytes read in 42 ms (337.9 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.9.0-kirkwood-tld-1
   Created:      2017-02-27  19:53:07 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3260928 Bytes = 3.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.9.0-kirkwood-tld-1
   Created:      2017-02-27  19:54:09 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7429607 Bytes = 7.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
   Loading Kernel Image ... OK
   Loading Ramdisk to 1f3fc000, end 1fb11de7 ... OK
   Loading Device Tree to 1f3f5000, end 1f3fb8d3 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Tue Dec 13 01:58:23 PST 2016
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt:Machine model: ZyXEL NSA325
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 503044K/524288K available (6218K kernel code, 621K rwdata, 1680K rodata, 304K init, 321K bss, 21244K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc061ade8   (6220 kB)
[    0.000000]       .init : 0xc07f2000 - 0xc083e000   ( 304 kB)
[    0.000000]       .data : 0xc083e000 - 0xc08d9544   ( 622 kB)
[    0.000000]        .bss : 0xc08d9544 - 0xc0929cd0   ( 322 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000008] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000433] Console: colour dummy device 80x30
[    0.000461] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.090074] pid_max: default: 32768 minimum: 301
[    0.090240] Security Framework initialized
[    0.090363] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090380] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.091289] CPU: Testing write buffer coherency: ok
[    0.091658] Setting up static identity map for 0x8200 - 0x8258
[    0.091891] mvebu-soc-id: MVEBU SoC ID=0x6282, Rev=0x1
[    0.095254] devtmpfs: initialized
[    0.101368] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.101601] prandom: seed boundary self test passed
[    0.104405] prandom: 100 self tests passed
[    0.104415] pinctrl core: initialized pinctrl subsystem
[    0.105502] NET: Registered protocol family 16
[    0.105925] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.130093] cpuidle: using governor ladder
[    0.160092] cpuidle: using governor menu
[    0.160530] Feroceon L2: Enabling L2
[    0.160568] Feroceon L2: Cache support initialised.
[    0.160935] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.165925] No ATAGs?
[    0.201317] vgaarb: loaded
[    0.201580] usbcore: registered new interface driver usbfs
[    0.201644] usbcore: registered new interface driver hub
[    0.201712] usbcore: registered new device driver usb
[    0.202653] clocksource: Switched to clocksource orion_clocksource
[    0.239638] VFS: Disk quotas dquot_6.6.0
[    0.239712] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.249023] NET: Registered protocol family 2
[    0.249717] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.249774] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.249826] TCP: Hash tables configured (established 4096 bind 4096)
[    0.249874] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.249895] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.250047] NET: Registered protocol family 1
[    0.250473] RPC: Registered named UNIX socket transport module.
[    0.250483] RPC: Registered udp transport module.
[    0.250489] RPC: Registered tcp transport module.
[    0.250495] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.250715] Unpacking initramfs...
[    0.760561] Freeing initrd memory: 7256K (df3fc000 - dfb12000)
[    0.760753] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.761578] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.761639] audit: initializing netlink subsys (disabled)
[    0.761686] audit: type=2000 audit(0.750:1): initialized
[    0.761945] Initialise system trusted keyrings
[    0.762126] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.762214] zbud: loaded
[    0.763035] NFS: Registering the id_resolver key type
[    0.763059] Key type id_resolver registered
[    0.763067] Key type id_legacy registered
[    0.763080] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.763088] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.763308] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.763608] orangefs_debugfs_init: called with debug mask: :none: :0:
[    0.763833] orangefs_init: module version upstream loaded
[    2.552658] random: fast init done
[    3.816481] Key type asymmetric registered
[    3.816495] Asymmetric key parser 'x509' registered
[    3.816575] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    3.816585] io scheduler noop registered
[    3.816592] io scheduler deadline registered
[    3.816620] io scheduler cfq registered (default)
[    3.817694] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    3.819291] mvebu-pcie mbus@f1000000:pcie-controller@82000000: PCI host bridge to bus 0000:00
[    3.819310] pci_bus 0000:00: root bus resource [io  0x1000-0xfffff]
[    3.819321] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xefffffff]
[    3.819332] pci_bus 0000:00: root bus resource [bus 00-ff]
[    3.819631] PCI: bus0: Fast back to back transfers disabled
[    3.819650] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    3.842716] PCI: bus1: Fast back to back transfers disabled
[    3.842917] pci 0000:00:01.0: BAR 14: assigned [mem 0xe0000000-0xe00fffff]
[    3.842934] pci 0000:01:00.0: BAR 0: assigned [mem 0xe0000000-0xe0001fff 64bit]
[    3.842954] pci 0000:00:01.0: PCI bridge to [bus 01]
[    3.842967] pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xe00fffff]
[    3.843035] pcieport 0000:00:01.0: enabling device (0140 -> 0142)
[    3.843114] pci 0000:01:00.0: enabling device (0140 -> 0142)
[    3.843548] mv_xor f1060800.xor: Marvell shared XOR driver
[    3.903221] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    3.903419] mv_xor f1060900.xor: Marvell shared XOR driver
[    3.963220] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    3.963636] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    3.964811] console [ttyS0] disabled
[    3.964868] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
[    4.632179] console [ttyS0] enabled
[    4.636751] nand: device found, Manufacturer ID: 0x92, Chip ID: 0xf1
[    4.643161] nand: Eon NAND 128MiB 3,3V 8-bit
[    4.647448] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    4.655076] Scanning device for bad blocks
[    4.664035] Bad eraseblock 100 at 0x000000c80000
[    4.673465] Bad eraseblock 200 at 0x000001900000
[    4.717514] 9 ofpart partitions found on MTD device orion_nand
[    4.723389] Creating 9 MTD partitions on "orion_nand":
[    4.728555] 0x000000000000-0x000000100000 : "uboot"
[    4.734661] 0x000000100000-0x000000180000 : "uboot_env"
[    4.741025] 0x000000180000-0x000000200000 : "key_store"
[    4.747377] 0x000000200000-0x000000280000 : "info"
[    4.753239] 0x000000280000-0x000000c80000 : "etc"
[    4.759070] 0x000000c80000-0x000001680000 : "kernel_1"
[    4.765365] 0x000001680000-0x000004640000 : "rootfs1"
[    4.771747] 0x000004640000-0x000005040000 : "kernel_2"
[    4.778107] 0x000005040000-0x000008000000 : "rootfs2"
[    4.785388] libphy: Fixed MDIO Bus: probed
[    4.789932] libphy: mdio_driver_register: mv88e6085
[    4.795172] libphy: orion_mdio_bus: probed
[    4.803644] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    4.903093] mv643xx_eth: Set the PHY to fix link down[    4.908623] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:50:43:00:02:02
[    4.917502] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.924092] ehci-pci: EHCI PCI platform driver
[    4.928608] ehci-orion: EHCI orion driver
[    4.932802] orion-ehci f1050000.ehci: EHCI Host Controller
[    4.938335] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    4.946173] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    4.972684] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    4.978891] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    4.985731] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.993002] usb usb1: Product: EHCI Host Controller
[    4.997897] usb usb1: Manufacturer: Linux 4.9.0-kirkwood-tld-1 ehci_hcd
[    5.004558] usb usb1: SerialNumber: f1050000.ehci
[    5.009903] hub 1-0:1.0: USB hub found
[    5.013743] hub 1-0:1.0: 1 port detected
[    5.018196] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    5.023514] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    5.031259] xhci_hcd 0000:01:00.0: hcc params 0x014042cb hci version 0x96 quirks 0x00000004
[    5.039876] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    5.046717] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    5.053982] usb usb2: Product: xHCI Host Controller
[    5.058884] usb usb2: Manufacturer: Linux 4.9.0-kirkwood-tld-1 xhci-hcd
[    5.065544] usb usb2: SerialNumber: 0000:01:00.0
[    5.070766] hub 2-0:1.0: USB hub found
[    5.074610] hub 2-0:1.0: 2 ports detected
[    5.079094] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    5.084393] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 3
[    5.091890] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    5.100145] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003
[    5.106978] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    5.114246] usb usb3: Product: xHCI Host Controller
[    5.119149] usb usb3: Manufacturer: Linux 4.9.0-kirkwood-tld-1 xhci-hcd
[    5.125886] usb usb3: SerialNumber: 0000:01:00.0
[    5.131104] hub 3-0:1.0: USB hub found
[    5.134937] hub 3-0:1.0: 2 ports detected
[    5.139795] mousedev: PS/2 mouse device common for all mice
[    5.145713] i2c /dev entries driver
[    5.154345] rtc rtc0: invalid alarm value: 2017-2-29 22:74:0
[    5.160206] rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0
[    5.169720] hidraw: raw HID events driver (C) Jiri Kosina
[    5.175457] drop_monitor: Initializing network drop monitor service
[    5.181927] NET: Registered protocol family 17
[    5.186734] Key type dns_resolver registered
[    5.191751] registered taskstats version 1
[    5.195897] Loading compiled-in X.509 certificates
[    5.200741] zswap: loaded using pool lzo/zbud
[    5.213639] Key type big_key registered
[    5.224394] Key type encrypted registered
[    5.230889] rtc-pcf8563 0-0051: setting system clock to 2017-02-28 22:13:12 UTC (1488319992)
[    5.241264] Freeing unused kernel memory: 304K (c07f2000 - c083e000)
[    5.247827] This architecture does not have kernel memory protection.
Loading, please wait...
[    5.323496] systemd-udevd[96]: starting version 215
[    5.372751] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    5.500481] SCSI subsystem initialized
[    5.558312] sata_mv f1080000.sata: slots 32 ports 2
[    5.574445] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[    5.574453] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    5.574457] usb 1-1: Product: USB2.0 Hub
[    5.575410] hub 1-1:1.0: USB hub found
[    5.575816] hub 1-1:1.0: 4 ports detected
[    5.681682] scsi host0: sata_mv
[    5.685964] scsi host1: sata_mv
[    5.689922] ata1: SATA max UDMA/133 irq 32
[    5.694151] ata2: SATA max UDMA/133 irq 32
[    6.192694] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    6.203494] ata1.00: ATA-8: Hitachi HUA723030ALA640, MKAOA580, max UDMA/133
[    6.210484] ata1.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    6.224010] ata1.00: configured for UDMA/133
[    6.238799] scsi 0:0:0:0: Direct-Access     ATA      Hitachi HUA72303 A580 PQ: 0 ANSI: 5
[    6.802690] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    6.813487] ata2.00: ATA-8: Hitachi HUA723030ALA640, MKAOA580, max UDMA/133
[    6.820483] ata2.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    6.834010] ata2.00: configured for UDMA/133
[    6.848753] scsi 1:0:0:0: Direct-Access     ATA      Hitachi HUA72303 A580 PQ: 0 ANSI: 5
[    6.924240] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[    6.936039] sd 1:0:0:0: [sdb] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[    6.945143] sd 0:0:0:0: [sda] Write Protect is off
[    6.950195] sd 1:0:0:0: [sdb] Write Protect is off
[    6.955144] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    6.964390] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    7.002742]  sda: sda1 sda2 sda3
[    7.008411] sd 0:0:0:0: [sda] Attached SCSI disk
[    7.013901]  sdb: sdb1 sdb2
[    7.018717] sd 1:0:0:0: [sdb] Attached SCSI disk
[    7.026036] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    7.033249] sd 1:0:0:0: Attached scsi generic sg1 type 0
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
[   17.583213] raid6: int32x1  gen()   113 MB/s
[   17.752885] raid6: int32x1  xor()    74 MB/s
[   17.922809] raid6: int32x2  gen()   158 MB/s
[   18.093000] raid6: int32x2  xor()   105 MB/s
[   18.262780] raid6: int32x4  gen()   163 MB/s
[   18.432936] raid6: int32x4  xor()   116 MB/s
[   18.602918] raid6: int32x8  gen()   157 MB/s
[   18.772668] raid6: int32x8  xor()   105 MB/s
[   18.776951] raid6: using algorithm int32x4 gen() 163 MB/s
[   18.782365] raid6: .... xor() 116 MB/s, rmw enabled
[   18.787273] raid6: using intx1 recovery algorithm
[   18.793765] xor: measuring software checksum speed
[   18.892688]    arm4regs  :  1452.800 MB/sec
[   18.992702]    8regs     :   872.400 MB/sec
[   19.092681]    32regs    :  1207.600 MB/sec
[   19.096880] xor: using function: arm4regs (1452.800 MB/sec)
[   19.133590] Btrfs loaded, crc32c=crc32c-generic
Begin: Will now check root file system ... fsck from util-linux 2.25.2
done.
[   19.177651] BTRFS: device label rootfs devid 1 transid 50 /dev/sda2
[   19.186133] BTRFS info (device sda2): disk space caching is enabled
[   19.192437] BTRFS info (device sda2): has skinny extents
[   19.199284] BTRFS error (device sda2): failed to read the system array: -5
[   19.232801] BTRFS error (device sda2): open_ctree failed
mount: mounting /dev/sda2 on /root failed: Invalid argument
done.
Target filesystem doesn't have requested /sbin/init.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
done.
No init found. Try passing init= bootarg.
modprobe: module i8042 not found in modules.dep
[   19.364332] uhci_hcd: USB Universal Host Controller Interface driver
[   19.377748] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   19.391552] usbcore: registered new interface driver usbhid
[   19.397290] usbhid: USB HID core driver


BusyBox v1.22.1 (Debian 1:1.22.0-9+deb8u1) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off

fw_printenv output is

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=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
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
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_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 0; do run uenv_read_disk; done; done;
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15
arcNumber=4495
ethaddr=00:50:43:00:02:02
dtb_file=/boot/dts/kirkwood-nsa325.dtb
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3
mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params

and my uEnv.txt is

sata_root=LABEL=rootfs
sata_rootfstype=btrfs
sata_rootflags=device=/dev/sda2,device=/dev/sdb1,defaults,noatime,compress=lzo,autodefrag
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$sata_rootfstype rootflags=$sata_rootflags $mtdparts

After reading and trying so much today i am blind to details but maybe you see a failure there.
Re: Problem booting NSA325v2 on HDD
March 01, 2017 07:36AM
As already said i am going so far down the rabbit hole... but somehow i can't let it go... ;)

So i retried installing it only on one partition without raid1 first.
I figured out that the btrfs rootfs will be mounted ro if you dont correct the fstab.
Maybe i missunderstood something but i thought fstab is no longer necessary with newest uboot.
Anyhow got this working and then systemd is running without problems.

After having it running on btrfs without raid1 i made the rootfs a raid1 by adding a device and balancing it.
This worked without problems.

After that i updated the boot files with

update-initramfs -u -k all

this command gave me the following error:

update-initramfs: Generating /boot/initrd.img-4.9.0-kirkwood-tld-1
Warning: /sbin/fsck.btrfs doesn't exist, can't install to initramfs, ignoring.

This failure can be ignored if i can trust the description on that site http://www.linuxfromscratch.org/blfs/view/svn/postlfs/btrfs-progs.html

fsck.btrfs does nothing, but is present for consistency with fstab.

finally i regenerated uImage and uInitrd

cd /boot

mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.9.0-kirkwood-tld-1 -d vmlinuz-4.9.0-kirkwood-tld-1 uImage
 
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.9.0-kirkwood-tld-1 -d initrd.img-4.9.0-kirkwood-tld-1 uInitrd

After that i rebooted and.... tata... busybox :( So nothing changed.

But i just found the information that it would work with an /dev/mapper/rootfs entry in fstab as btrfs is clever enough to populate the array then. https://blog.samcater.com/fix-for-btrfs-open_ctree-failed-when-running-root-fs-on-raid-1-or-raid10-arch-linux/

Even if this is vor arch-linux, could this be done on debian as well?
As i havent found any useful tips about devmapper usage or configuration in debian it might be very difficult to do but maybe you already did something like that and its gonna be easy. ;)
Re: Problem booting NSA325v2 on HDD
March 01, 2017 04:10PM
saschadd,

> fsck.btrfs does nothing, but is present for con
> sistency with fstab.

>

This is correct. fsck needs to find the binary to check the file system. But no check is needed.

> As i havent found any useful tips about devmapper
> usage or configuration in debian it might be very
> difficult to do but maybe you already did somethin
> g like that and its gonna be easy. ;)

Try look for tips about using mdm in Debian. There might be some useful info in that angle.

I don't use btrfs (but I know it is possible) so I can't fill in the details. You are our btrfs pioneer here :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
March 05, 2017 11:32AM
bodhi,

it is possible!!!
I got it working!!!
I noted down what i did to get it up and running and will do a howto for others.

Thanks for your help and sugesstions even if the problem was selfmade by me.
I tried to get it up and running with the newest btrfs-tools installed via make install.
By doing this there is the file local-premount/btrfs missing and therefore the kernel cant assemble the array.

I will let you know when the howto is ready so you can add a link to the wiki.

sascha
Re: Problem booting NSA325v2 on HDD
March 05, 2017 03:32PM
saschadd,

> By doing this there is the file local-premount/btr
> fs missing and therefore the kernel cant assemble
> the array.

That's what I recalled was similar to one of systemd bugs in the past about assembling the array!

>
> I will let you know when the howto is ready so you
> can add a link to the wiki.

Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Avio
Re: Problem booting NSA325v2 on HDD
March 16, 2017 08:30AM
Hello saschadd and bodhi,

I'm having the exact same problem on my raspberry: the raid1 is not assembled at boot. Can you point me to the solution of this issue?

Kind regards
Avio
Re: Problem booting NSA325v2 on HDD
March 16, 2017 03:35PM
Avio,

I've asked saschadd to post the solution.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Problem booting NSA325v2 on HDD
March 17, 2017 02:57AM
Hi Avio and bodhi,

thanks for the "little reminder". ; )
I was about to forget to post the howto because i am stuck at my next step of setting up a backup box with bareos.
Unfortunately bareos seems not to be usable with actual openssl versions as i get failures
crypto_openssl.c:131:1: error: expected constructor, destructor, or type conversion before ‘IMPLEMENT_STACK_OF’ IMPLEMENT_STACK_OF(RecipientInfo)

followed by many more until it stops with failure

Makefile:225: die Regel für Ziel „crypto_openssl.lo“ scheiterte
make[2]: *** [crypto_openssl.lo] Fehler 1

I tried with OpenSSL 1.0.1t which is the actual version from Debian jessie
when trying to compile it. There is a gnutls version available at the repos but this seems not to work with letsencrypt. :(

Well, after going a bit offtopic, I just posted my howto for the btrfs raid 1 here http://forum.doozan.com/read.php?2,33146,33146#msg-33146

-
happy hacking,

saschadd
Avio
Re: Problem booting NSA325v2 on HDD
March 17, 2017 06:45AM
Hi guys,

thank you both for the quick replies and thank you saschadd for the excellent tutorial. For the moment I solved the problem in the "brutal" way. Thanks to saschadd, my attention focused on the «local-premount/btrfs» file. In my case it was not missing, and the content matched with this one: http://askubuntu.com/questions/829205/stuck-in-initramfs-with-btrfs-root-array

But I noticed that on my Raspberry Pi 3 (with external USB enclosure with 2x WD RED 3Tb hdd in btrfs RAID1) the "btrfs device scan" output was printed just before USB devices appeared.

So when I was dropped to (initramfs) I just did:
1) a device scan manually
2) mount the raid
3) chroot into the rootfs
4) edit /usr/share/initramfs-tools/scripts/local-premount/btrfs (god bless chroot maintainers and a little bit less initramfs maintainers that don't even ship nano with it) adding these lines to the bottom:

echo "----------------- Waiting 30 seconds for USB to become ready... -----------------------"
sleep 30

if [ -x /bin/btrfs ]
then
echo "----------------- Re-doing btrfs scan -----------------------"
/bin/btrfs device scan 2> /dev/null
fi

5) run update-initramfs -k -u `uname -r`
6) got tons of errors because I forgot to mount /proc /dev /sys and /run, so went back to step 3) and did everything again
7) forgot to mount /boot/firmware so went back again and did everything again
8) uncompressed both old and new initramfs-es (with gzip -d and cpio -i < uncompressed_initrd) to check that everything was ok
9) rebooted for the tenth time and it finally worked

For the moment (= until 18.04 arrives) I'll stay with this workaround. I know that it's really not update-proof, but I already lost many hours on this so, well, it's perfectly fine :)

Thank you again!

Cheers
Avio
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: