Welcome! Log In Create A New Profile

Advanced

Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora

Posted by TheYanusz 
Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
November 29, 2023 03:00PM
Hello,
I encountered an issue while trying to setup debian on my Netgear Stora. The thing is that I did everything mentioned in this tutorial but I managed to get into mounting error while booting into the system.
Error:
Begin: Will now check root file system ... fsck from util-linux 2.38.1
fsck: error 2 (No such file or directory) while executing fsck.ext2 for /dev/sda1
fsck exited with status code 8
done.
Warning: File system check failed but did not detect errors
mount: mounting /dev/sda1 on /root failed: No such device
Failed to mount /dev/sda1 as root file system.

The Debian is booted from USB formatted in ext2 in MBR/DOS partition scheme. After this error I'm being dropped into initramfs busybox shell.

fstab:
LABEL=rootfs   /   ext2   defaults   0   2

I also tried with noatime,errors=remount-ro fstab option but ended up with same result. I'm connected to Stora via RS232 to TTL adapter made with arduino so I'm operating from serial console.
Output after typing ' dmesg | grep -i 'bad' ':
[    5.922319][    T1] Scanning device for bad blocks
[    5.970409][    T1] Bad eraseblock 400 at 0x000003200000
[    5.976034][    T1] Bad eraseblock 403 at 0x000003260000
[    5.982949][    T1] Bad eraseblock 418 at 0x000003440000
[    6.012720][    T1] Bad eraseblock 645 at 0x0000050a0000
[    6.113638][    T1] Bad eraseblock 1532 at 0x00000bf80000
[    6.119187][    T1] Bad eraseblock 1533 at 0x00000bfa0000
[    6.131852][    T1] Bad eraseblock 1600 at 0x00000c800000
[    6.137403][    T1] Bad eraseblock 1601 at 0x00000c820000
[    6.181632][    T1] Bad eraseblock 1960 at 0x00000f500000
[    6.187178][    T1] Bad eraseblock 1961 at 0x00000f520000
[    6.199409][    T1] Bad eraseblock 2024 at 0x00000fd00000
[    6.204934][    T1] Bad eraseblock 2025 at 0x00000fd20000

Setenv commands executed in Marvell u-boot:
setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'run usb_bootcmd; usb stop; reset'

Interestingly after typing usb reset I'm no longer able to see my connected USB and the ext2ls command returns Bad parition message. After restarting and typing exactly same command I can list all files on the USB. That's why after I deleted the usb reset command from bootcmd environmental variable.

Thats actually my very first time doing something like this and I'm sure I messed something up.

Thanks in advance,
TheYanusz

EDIT:
Fix: In my situation the problem was uInitrd file, I used mkimage without one zero in arguments, moreover I used ext3 over ext2.

P.S
Sorry for bad spelling




Edited 1 time(s). Last edit at 12/02/2023 09:07AM by TheYanusz.
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
November 29, 2023 05:43PM
TheYanusz,

The rootfs name is Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2. Was this what you downloaded and used to create the rootfs?

Quote

Updated 01 Nov 2023:

Basic Debian bookworm Kirkwood rootfs for most Kirwood plugs:

- tarball size: 250MB
- install size: 714MB
- The init system used in this rootfs is sysvinit . To boot with systemd, see Notes below.
- Installed packages: nano, avahi, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, dialog, bzip2, nfs server/client, iperf, ethtool, sysvinit-core, sysvinit, sysvinit-utils, u-boot-tools, libubootenv-tool, mtd-utils, and orphan-sysvinit-scripts.
- see LED controls examples in /etc/rc.local, and /etc/init.d/halt
- see some useful aliases in /root/.profile
- root password: root

NOTE: I had a typo in the file name Debian-5.6.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2. It should be Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2. After downloaded the tarball, please adjust it.

> The Debian is booted from USB formatted in ext2 in
> MBR/DOS partition scheme. After this error I'm
> being dropped into initramfs busybox shell.

It's very likely that you did not follow the instruction while creating the rootfs.

The most important thing to do is to become root (sudo won't work). And don't use GUI on the host Linux box for create the partition and format it, use fdisk and mkfs.ext2.

> Interestingly after typing usb reset I'm no longer able to see my connected USB and the ext2ls command returns Bad parition message. After restarting and typing exactly > same command I can list all files on the USB. That's why after I deleted the usb reset command from bootcmd environmental variable.

It is required to bring up the USB drive with "usb reset" before you can load the kernel. So that's not good.

How did you create the partition? did you use fdisk? and how did you format it? did you use mkfs.ext2 ?

====

Please post the entire serial console log when you try booting with the original set of envs (i.e. with usb reset).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
November 30, 2023 02:58PM
Bodhi,
Thanks for anserwing.
Quote
The rootfs name is Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2. Was this what you downloaded and used to create the rootfs?
Yeah I used this tarball but I didn't realized that earlier. I think I missed the info about the other filename.

Quote
The most important thing to do is to become root (sudo won't work). And don't use GUI on the host Linux box for create the partition and format it, use fdisk and mkfs.ext2.
I used my laptop with fedora. I did the proccess from tty while being logged in as root. I used these commands:
dd if=/dev/zero of=/dev/sda bs=1M count=1
fdisk /dev/sda1
mkfs.ext2 -L rootfs /dev/sda1

In the fdisk I typed o then w. Rerun the fdisk, clicked n and enter these few times to create one partition with max space.
I wrote zeroes to first mb of disk because it was in GPT.

I forgot to mention that after the first try I certainly messed something up because after reset I got many environmental overflow errors. Just like I read stormy's post and found some file to make recovery(?) and I downloaded u-boot.mtd0 posted by some user and followed their instructions. As You can see in the boot log attached there are some loops(?) that I can skip by interrupting with ctrl+c. You can see it in section with
Broadcasting Distress Beacon Packet.

Using egiga0 device
TFTP from server 10.0.0.1; our IP address is 10.166.113.215
Filename 'uImage'.
Load address: 0x2000000
Loading: T

Its repeating until I interrupt it. As I presume It's because the machine tries to fetch uImage file from TFTP server. Previous user of u-boot put this in startup I guess.

Regards,
TheYanusz
Attachments:
open | download - serialOutput_boot.txt (3.4 KB)
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
November 30, 2023 03:57PM
TheYanusz,

mkfs.ext2 -L rootfs /dev/sda1
After that, did you extract the tarball, and do Step 4 using the Stora DTB?

Quote

4. (Stock u-boot only) Create uImage with embedded DTB

=====

Marvell>> usb reset
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
I see, it could be that this u-boot driver has problem and too slow.

Try this.

With the USB drive attached, power up and

setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'run usb_bootcmd; reset'
And then
boot
If it boots the kernel, and hopefully will boot to Debian prompt, please post the entire serial console log.

======

You should also try to run kwboot using the Stora u-boot uboot.2017.07-tld-1.kwb here in the release thread.

https://forum.doozan.com/read.php?3,12381

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
December 01, 2023 10:04AM
Bodhi,
Unfortunately it still have some problem with mounting.
Quote
After that, did you extract the tarball, and do Step 4 using the Stora DTB?
Yes, I used kirkwood-netgear_stora_ms2000.dtb file in mkimage.
Quote
You should also try to run kwboot using the Stora u-boot uboot.2017.07-tld-1.kwb here in the release thread.
Can I actually install this without already installed debian on the stora?

Regards,
TheYanusz



Edited 1 time(s). Last edit at 12/01/2023 10:11AM by TheYanusz.
Attachments:
open | download - linux_boot.txt (25.1 KB)
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
December 01, 2023 01:56PM
TheYanusz,

1. I think it's time to try wiping the disk with fdisk and format it as Ext3. And try again.

>
Quote
You should also try to run kwboot using
> the Stora u-boot uboot.2017.07-tld-1.kwb here in
> the release thread.

>
>
> Can I actually install this without already
> installed debian on the stora?

2. Yes, kwboot loads the new u-boot image over UART. And when it runs, it will be just like a u-boot installed on NAND. It will boot the Debian USB rootfs. This is what we should alway do since the Marvell Kirkwood SoC supports this (except for a few very old Kirkwood versions). And you're not installing it by running kwboot, it runs in RAM. When you shutdown/power off the box, it's gone and you'll be back booting the stock u-boot on NAND.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
December 02, 2023 08:38AM
Bodhi,
I managed to boot into Debian without issues. I installed u-boot with this tutorial. Everything went smooth, then I rebooted and encountered this:
[   10.708964][    T1] /dev/root: Can't open blockdev
[   10.713820][    T1] VFS: Cannot open root device "" or unknown-block(0,0): error -6
[   10.721641][    T1] Please append a correct "root=" boot option; here are the available partitions:
[   10.730832][    T1] 0800        15155200 sda
[   10.730850][    T1]  driver: sd
[   10.738459][    T1]   0801        15154176 sda1 36031b7e-01
[   10.738477][    T1]
[   10.746283][    T1] List of all bdev filesystems:
[   10.751058][    T1]  ext3
[   10.751068][    T1]  ext4
[   10.753712][    T1]  exfat
[   10.756344][    T1]  fuseblk
[   10.759117][    T1]  xfs
[   10.762022][    T1]  f2fs
[   10.764576][    T1]
[   10.769466][    T1] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   10.778480][    T1] CPU: 0 PID: 1 Comm: swapper Not tainted 6.5.7-kirkwood-tld-1 #2 b782412796a181fef4037ede16903ece36aa46a3
[   10.789768][    T1] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[   10.796781][    T1]  unwind_backtrace from show_stack+0x10/0x14
[   10.802771][    T1]  show_stack from dump_stack_lvl+0x28/0x30
[   10.808572][    T1]  dump_stack_lvl from panic+0xf0/0x320
[   10.814021][    T1]  panic from mount_root_generic+0x1c8/0x288
[   10.819924][    T1]  mount_root_generic from prepare_namespace+0x180/0x214
[   10.826864][    T1]  prepare_namespace from kernel_init_freeable+0x1b0/0x204
[   10.833981][    T1]  kernel_init_freeable from kernel_init+0x10/0x130
[   10.840484][    T1]  kernel_init from ret_from_fork+0x14/0x28
[   10.846273][    T1] Exception stack(0x88819fb0 to 0x88819ff8)
[   10.852060][    T1] 9fa0:                                     00000000 00000000 00000000 00000000
[   10.860991][    T1] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   10.869919][    T1] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   10.877275][    T1] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---

The USB stick was formatted in ext3 and worked before reboot.

EDIT:
I recovered the fw_printenv output from terminal session, attached in this post. I thought it may have some useful info.
EDIT 2:
Whole boot log attached

Regards,
TheYanusz



Edited 2 time(s). Last edit at 12/02/2023 09:03AM by TheYanusz.
Attachments:
open | download - envs.txt (2.7 KB)
open | download - kernel_panic_boot.txt (21.9 KB)
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
December 02, 2023 11:09AM
OK I'm just stupid. Forgot about stock u-boot section in tutorial. Debian is booting sorry for this

Regards,
TheYanusz
Re: Mount error while booting Debian-5.6.7-kirkwood on Netgear Stora
December 02, 2023 02:21PM
Quote

I managed to boot into Debian without issues. I installed u-boot with this tutorial.

Cool!

Quote

Forgot about stock u-boot section in tutorial. Debian is booting sorry for this

Not at all. It's a common mis-step after kwboot. I need to add some more notes to the kwboot instruction make it more prominent.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: