Cannot find tape devices in linux - linux

I want to use tape devices to backup in linux. But I can't find the information of that devices in /proc/scsi/scsi. The tape devices is Quantum Scalar i40 and the OS in cluster is Red Hat Enterprise Linux.
Below is some information.
tape devices
# uname -r
2.6.32-504.el6.x86_64
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)
# lsscsi
[0:0:0:0] disk HP LOGICAL VOLUME 3.56 /dev/sda
[0:0:0:1] disk HP LOGICAL VOLUME 3.56 /dev/sdb
[0:3:0:0] storage HP P840 3.56 -
# cat /proc/scsi/scsi
Attached devices:
Host:scsi0 Channel: 03 Id: 00 Lun: 00
Vendor: HP Model: P840 Rev: 3.56
Type: RAID ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: LOGICAL VOLUME Rev: 3.56
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: LOGICAL VOLUME Rev: 3.56
Type: Direct-Access ANSI SCSI revision: 05
# modinfo st
filename: /lib/modules/2.6.32-504.el6.x86_64/kernel/drivers/scsi/st.ko alias: scsi:t-0x01*
alias: char-major-9-*
license: GPL
description: SCSI tape (st) driver
author: Kai Makisara
srcversion: AB519E7875D34CA8D8A68F0
depends:
vermagic: 2.6.32-504.el6.x86_64 SMP mod_unload modversions
parm: buffer_kbs:Default driver buffer size for fixed block mode (KB; 32) (int)
parm: max_sg_segs:Maximum number of scatter/gather segments to use (256) (int)
parm: try_direct_io:Try direct I/O between user buffer and tape drive (1) (int)
parm: try_rdio:Try direct read i/o when possible (int)
parm: try_wdio:Try direct write i/o when possible (int)
#dmesg
................omit............................
st 1:0:0:0: Attached scsi tape st0
st 1:0:0:0: st0: try direct i/o: yes (alignment 4 B)
osst :I: Tape driver with OnStream support version 0.99.4
osst :I: $Id: osst.c,v 1.73 2005/01/01 21:13:34 wriede Exp $
SCSI Media Changer driver v0.25
ch0: type #1 (mt): 0x1+1 [medium transport]
ch0: type #2 (st): 0x1000+39 [storage]
ch0: type #3 (ie): 0x10+0 [import/export]
ch0: type #4 (dt): 0x100+1 [data transfer]
ch0: dt 0x100: ID/LUN unknown
ch0: INITIALIZE ELEMENT STATUS, may take some time ...
ch0: ... finished
ch 1:0:0:1: Attached scsi changer ch0
................omit............................
st0: Block limits 1 - 8388608 bytes.
pci 0000:01:00.1: Invalid ROM contents
tun3: Disabled Privacy Extensions
st0: Error e0000 (driver bt 0x0, host bt 0xe).
rport-1:0-0: blocked FC remote port time out: removing target and saving binding
st 1:0:0:0: rejecting I/O to offline device
st 1:0:0:0: rejecting I/O to offline device
st0: Error on write filemark.
................omit............................
How can I solve the issue? Thanks!

Related

UBI layout volume not found

I am following Bootlin's embedded Linux training which aims to put an embedded Linux system on an Atmel SAMA5D4 Xplained board (theory slides, practical lab instructions) and I am stuck a putting the whole system on the NAND flash.
They ask me to put the DTB, the kernel, the root filesystem and a data filesystem in a UBI image to be written to the flash but I cannot access the UBI partitions once I flashed it (the access fails with error code 22, or -22 in an embedded Linux environment).
Detailed description
(to see my actual questions, go to the end of the question)
In U-Boot, the partitions are defined by mtdparts:
device nand0 <atmel_nand>, # parts = 8
#: name size offset mask_flags
0: bootstrap 0x00040000 0x00000000 1
1: uboot 0x00080000 0x00040000 1
2: env 0x00040000 0x000c0000 1
3: envbackup 0x00040000 0x00100000 1
4: dtb 0x00020000 0x00140000 0
5: kernel 0x00500000 0x00160000 0
6: rootfs 0x01000000 0x00660000 0
7: datafs 0x01000000 0x01660000 0
active partition: nand0,0 - (bootstrap) 0x00040000 # 0x00000000
defaults:
mtdids :
mtdparts:
With printenv mtdparts, I get:
mtdparts=mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env)ro,256k(envbackup)ro,128k(dtb),5M(kernel),16M(rootfs),16M(datafs)
and printenv mtdids
mtdids=nand0=atmel_nand
The UBI image was created with ubinize and the following configuration:
[dtb]
peb=0x20000
min_io_size=0x800
mode=ubi
image=dtb.img
vol_id=0
vol_size=128KiB
vol_type=static
vol_name=dtb
vol_alignment=1
[kernel]
peb=0x20000
min_io_size=0x800
mode=ubi
image=zImage
vol_id=1
vol_size=5MiB
vol_type=static
vol_name=kernel
vol_alignment=1
[rootfs]
peb=0x20000
min_io_size=0x800
mode=ubi
image=root.img
vol_id=2
vol_size=16MiB
vol_type=static
vol_name=rootfs
vol_alignment=1
[datafs]
peb=0x20000
min_io_size=0x800
mode=ubi
image=files.img
vol_id=3
vol_size=16MiB
vol_type=static
vol_name=datafs
vol_alignment=1
and this command (the sama5-ubinize.cfg is the above configuration)
ubinize -o ubi.img -p 128KiB -m 2KiB sama5-ubinize.cfg
The PEB is indeed 128KB (0x2000) and the page size is 2048B (0x800). I added those parameters based on this answer.
Both UBI partitions have been make with the following commands:
mkfs.ubifs -e 124KiB -c 132 -m 2KiB -r nfsroot/ root.img
mkfs.ubifs -e 124KiB -c 132 -m 2KiB -r nfsroot/www/upload/files data.img
I then write the UBI image to the flash with the following commands (in U-Boot):
nand erase 0x140000 0xfec0000
tftp 0x21000000 ubi.img
nand write.trimffs 0x21000000 0x140000 0x880000
When trying to access the partitions from U-Boot with ubi part rootfs, I get the following error:
ubi0: attaching mtd1
ubi0: scanning is finished
UBI init error 22
For now I am booting Linux from a SD card. The Linux boot arguments are (from printenv bootargs):
bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
When booting Linux, I get the following log:
resetting ...
RomBOOT
AT91Bootstrap 3.8.9 (Mi Dez 12 21:06:49 CET 2018)
NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0xda
NAND: Page Bytes: 2048, Spare Bytes: 64
NAND: ECC Correctability Bits: 4, ECC Sector Bytes: 512
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 4, sector: 512
NAND: Image: Copy 0xa0000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image
<debug_uart>
U-Boot 2017.09 (Dec 12 2018 - 23:16:12 +0100)
CPU: SAMA5D36
Crystal frequency: 12 MHz
CPU clock : 528 MHz
Master clock : 132 MHz
DRAM: 256 MiB
NAND: 256 MiB
MMC: Atmel mci: 0, Atmel mci: 1
In: serial#ffffee00
Out: serial#ffffee00
Err: serial#ffffee00
Net: eth0: ethernet#f0028000
Error: ethernet#f802c000 address not set.
Hit any key to stop autoboot: 0
reading zImage
4279056 bytes read in 281 ms (14.5 MiB/s)
reading at91-sama5d3_xplained.dtb
34404 bytes read in 7 ms (4.7 MiB/s)
## Flattened Device Tree blob at 22000000
Booting using the fdt blob at 0x22000000
Loading Device Tree to 2fb39000, end 2fb44663 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.18.20 (dopsi#dopsi-ThinkPad-T430) (gcc version 8.1.0 (crosstool-NG 1.23.0.435-eb65)) #4 Sat Dec 15 14:07:41 CET 2018
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: SAMA5D3 Xplained
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
random: get_random_bytes called from start_kernel+0x9c/0x3d8 with crng_init=0
Built 1 zonelists, mobility grouping on. Total pages: 65024
Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 250120K/262144K available (6144K kernel code, 237K rwdata, 1588K rodata, 1024K init, 124K bss, 12024K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0x(ptrval) - 0x(ptrval) (7136 kB)
.init : 0x(ptrval) - 0x(ptrval) (1024 kB)
.data : 0x(ptrval) - 0x(ptrval) ( 238 kB)
.bss : 0x(ptrval) - 0x(ptrval) ( 125 kB)
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
clocksource: pit: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 14479245754 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 351.43 BogoMIPS (lpj=1757184)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20100000 - 0x20100060
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
AT91: PM: standby: standby, suspend: ulp0
No ATAGs?
gpio-at91 fffff200.gpio: at address (ptrval)
gpio-at91 fffff400.gpio: at address (ptrval)
gpio-at91 fffff600.gpio: at address (ptrval)
gpio-at91 fffff800.gpio: at address (ptrval)
gpio-at91 fffffa00.gpio: at address (ptrval)
pinctrl-at91 ahb:apb:pinctrl#fffff200: initialized AT91 pinctrl driver
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 115833966437 ns
at_hdmac ffffe600.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels
at_hdmac ffffe800.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels
AT91: Detected SoC family: sama5d3
AT91: Detected SoC: sama5d36, revision 2
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f0014000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
at91_i2c f0014000.i2c: AT91 i2c bus driver (hw version: 0x402).
at91_i2c f0018000.i2c: using dma0chan2 (tx) and dma0chan3 (rx) for DMA transfers
at91_i2c f0018000.i2c: AT91 i2c bus driver (hw version: 0x402).
at91_i2c f801c000.i2c: can't get DMA channel, continue without DMA support
at91_i2c f801c000.i2c: AT91 i2c bus driver (hw version: 0x402).
videodev: Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Initialise system trusted keyrings
workingset: timestamp_bits=30 max_order=16 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Key type asymmetric registered
Asymmetric key parser 'x509' registered
io scheduler noop registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
f001c000.serial: ttyS1 at MMIO 0xf001c000 (irq = 23, base_baud = 4125000) is a ATMEL_SERIAL
f0020000.serial: ttyS2 at MMIO 0xf0020000 (irq = 24, base_baud = 4125000) is a ATMEL_SERIAL
f0024000.serial: ttyS5 at MMIO 0xf0024000 (irq = 25, base_baud = 4125000) is a ATMEL_SERIAL
ffffee00.serial: ttyS0 at MMIO 0xffffee00 (irq = 38, base_baud = 8250000) is a ATMEL_SERIAL
console [ttyS0] enabled
brd: module loaded
loop: module loaded
atmel_spi f0004000.spi: Using dma0chan4 (tx) and dma0chan5 (rx) for DMA transfers
atmel_spi f0004000.spi: Atmel SPI Controller version 0x213 at 0xf0004000 (irq 19)
atmel_spi f8008000.spi: Using dma1chan0 (tx) and dma1chan1 (rx) for DMA transfers
atmel_spi f8008000.spi: Atmel SPI Controller version 0x213 at 0xf8008000 (irq 28)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
at91_can f000c000.can: device registered (reg_base=(ptrval), irq=45)
libphy: MACB_mii_bus: probed
Micrel KSZ9031 Gigabit PHY f0028000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=f0028000.ethernet-ffffffff:07, irq=POLL)
macb f0028000.ethernet eth0: Cadence GEM rev 0x00020119 at 0xf0028000 irq 46 (12:34:56:ab:cd:ef)
macb f802c000.ethernet: invalid hw address, using random
libphy: MACB_mii_bus: probed
Micrel KSZ8081 or KSZ8091 f802c000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f802c000.ethernet-ffffffff:01, irq=POLL)
macb f802c000.ethernet eth1: Cadence MACB rev 0x0001010c at 0xf802c000 irq 47 (62:aa:eb:b7:c1:48)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 700000.ehci: EHCI Host Controller
atmel-ehci 700000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 700000.ehci: irq 50, io mem 0x00700000
atmel-ehci 700000.ehci: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.18
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.18.20 ehci_hcd
usb usb1: SerialNumber: 700000.ehci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 600000.ohci: USB Host Controller
at91_ohci 600000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 600000.ohci: irq 50, io mem 0x00600000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 4.18
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: USB Host Controller
usb usb2: Manufacturer: Linux 4.18.20 ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
atmel_usba_udc 500000.gadget: MMIO registers at [mem 0xf8030000-0xf8033fff] mapped at (ptrval)
atmel_usba_udc 500000.gadget: FIFO at [mem 0x00500000-0x005fffff] mapped at (ptrval)
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
at91_rtc fffffeb0.rtc: registered as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
at91-reset fffffe00.rstc: Starting after software reset
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan6 for DMA transfers
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 18, 1 slots
atmel_mci f8000000.mmc: version: 0x505
atmel_mci f8000000.mmc: using dma1chan2 for DMA transfers
atmel_mci f8000000.mmc: Atmel MCI controller at 0xf8000000 irq 27, 1 slots
sdhci-pltfm: SDHCI platform and OF driver helper
atmel_aes f8038000.aes: version: 0x135
atmel_aes f8038000.aes: Atmel AES - Using dma1chan3, dma1chan4 for DMA transfers
atmel_sha f8034000.sha: version: 0x410
atmel_sha f8034000.sha: using dma1chan5 for DMA transfers
atmel_sha f8034000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes f803c000.tdes: version: 0x701
atmel_tdes f803c000.tdes: using dma1chan6, dma1chan7 for DMA transfers
mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new high speed SDHC card at address b368
mmcblk0: mmc0:b368 SD4GB 3.74 GiB
mmcblk0: p1 p2 p3
atmel_tdes f803c000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
nand: Micron MT29F2G08ABAEAWP
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_read_bbt: bad block at 0x000000c80000
nand_read_bbt: bad block at 0x000000ca0000
6 fixed-partitions partitions found on MTD device atmel_nand
Creating 6 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "at91bootstrap"
0x000000040000-0x0000000c0000 : "bootloader"
0x0000000c0000-0x000000180000 : "bootloader env"
0x000000180000-0x000000200000 : "device tree"
0x000000200000-0x000000800000 : "kernel"
0x000000800000-0x000010000000 : "rootfs"
iio iio:device0: Resolution used: 12 bits
iio iio:device0: ADC Touch screen is disabled.
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20170425) max_hops=1
Loading compiled-in X.509 certificates
input: gpio_keys as /devices/platform/gpio_keys/input/input0
at91_rtc fffffeb0.rtc: setting system clock to 2007-01-01 01:05:49 UTC (1167613549)
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
ALSA device list:
No soundcards found.
platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
g_serial gadget: high-speed config #2: CDC ACM config
random: fast init done
cfg80211: failed to load regulatory.db
VFS: Mounted root (squashfs filesystem) readonly on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
starting pid 761, tty '': '/etc/init.d/rcS'
EXT4-fs (mmcblk0p3): recovery complete
EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
starting pid 768, tty '/dev/ttyS0': '/bin/sh'
BusyBox v1.29.3 (2018-12-15 12:27:14 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.
It detects all but one partition, but I cannot access them either. When trying to attach any of them (with ubiattach -m 5 /dev/ubi_ctrl), I get the following error (the error stays the same for all partition numbers):
ubi0: attaching mtd5
ubi0: scanning is finished
ubi0 error: ubi_read_volume_table: the layout volume was not found
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd5, error -22
ubiattach: UBI_IOCATT: Invalid argument
My questions
What exactly goes wrong my setup?
Should there be any preparation for the DTB and the Linux kernel before I put them in the UBI image?
Used tools and versions
U-Boot 2017.09
Linux 4.18
busybox 1.29.3
an Xubuntu 18.04 VM for development
Thanks for the very well described problem and questions. It's a pleasure to help you in such conditions :)
There are a few things don't seem right, or which at least are not in the spirit of Bootlin's lab.
You don't have the mtdparts settings in the kernel command line. As a consequence, you're working with the default partitions.
You're flashing your UBI image into the 5th MTD partition (from the offset you're using) but are trying to attach UBI to the 6th partition. No surprise that you have UBI attach issues.
When erasing and flashing the UBI images, you should use partition names instead of offsets. This will clarify things and reduce the risks of errors.
You should group the dtb, kernel, rootfs and datafs partitions into a single MTD partition called "ubi", which you will use to flash the UBI image and then to attach UBI. So instead of MTD partitions, you will have 4 UBI volumes, as described by your ubinize configuration file.
This should definitely help. Don't hesitate to come back if you're still facing issues after doing this.
Happy hacking and learning
Michael (from Bootlin)
I raised another thread as a followup
bootlin kernel doesn't boot from UBIFS
hope Michael can review it too

Qemu x86 and Linux 3.12.17 Kernel panic when booting

I have an issue regarding the execution of a custom Openwrt system with Linux 3.12.17 in Qemu 2.0.0. During the boot process, I have a message telling me that the bootloader cannot find my root partition device, which is /dev/sda as you can see in the following image :
Shell:~$ sudo fdisk -l
[sudo] password for :
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f25bd
Device Boot Start End Blocks Id System
/dev/sda1 * 16065 1028159 506047+ 83 Linux
/dev/sda2 1028160 41592284 20282062+ 83 Linux
/dev/sda3 41592285 976773167 467590441+ f W95 Ext'd (LBA)
/dev/sda5 41608350 45608534 2000092+ 82 Linux swap / Solaris
/dev/sda6 45620266 976773167 465576451 83 Linux
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 500118191 250059095+ ee GPT
Here is the command that I use to launch the Qemu emulator :
qemu-system-x86_64 -m 512 \
-kernel bin/x86/openwrt-x86-sgc_qemu-vmlinuz \
--append "root=/dev/sda rw" \
-nographic -usb \
-hda bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img
Here is the full boot log :
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.12.17 (g602882#rmm-p1303101) (gcc version 4.5.2 (GCC) ) #4 SMP PREEMPT Wed Mar 8 15:47:13 CET 2017
e820: BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
BIOS-e820: [mem 0x0000000000100000-0x000000001fffdfff] usable
BIOS-e820: [mem 0x000000001fffe000-0x000000001fffffff] reserved
BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel!
SMBIOS 2.4 present.
e820: last_pfn = 0x1fffe max_arch_pfn = 0x100000
PAT not supported by CPU.
found SMP MP-table at [mem 0x000f0b30-0x000f0b3f] mapped at [c00f0b30]
init_memory_mapping: [mem 0x00000000-0x000fffff]
init_memory_mapping: [mem 0x1f800000-0x1fbfffff]
init_memory_mapping: [mem 0x18000000-0x1f7fffff]
init_memory_mapping: [mem 0x00100000-0x17ffffff]
init_memory_mapping: [mem 0x1fc00000-0x1fffdfff]
ACPI: RSDP 000f09a0 00014 (v00 BOCHS )
ACPI: RSDT 1ffffbc1 00034 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001)
ACPI: FACP 1ffff1c0 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001)
ACPI: DSDT 1fffe040 01180 (v01 BOCHS BXPCDSDT 00000001 BXPC 00000001)
ACPI: FACS 1fffe000 00040
ACPI: SSDT 1ffff234 008DD (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001)
ACPI: APIC 1ffffb11 00078 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001)
ACPI: HPET 1ffffb89 00038 (v01 BOCHS BXPCHPET 00000001 BXPC 00000001)
511MB LOWMEM available.
mapped low ram: 0 - 1fffe000
low ram: 0 - 1fffe000
Zone ranges:
DMA [mem 0x00001000-0x00ffffff]
Normal [mem 0x01000000-0x1fffdfff]
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x00001000-0x0009efff]
node 0: [mem 0x00100000-0x1fffdfff]
Using APIC driver default
ACPI: PM-Timer IO Port: 0xb008
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
Using ACPI (MADT) for SMP configuration information
ACPI: HPET id: 0x8086a201 base: 0xfed00000
smpboot: Allowing 1 CPUs, 0 hotplug CPUs
e820: [mem 0x20000000-0xfeffbfff] available for PCI devices
setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:1 nr_node_ids:1
PERCPU: Embedded 13 pages/cpu #dfbed000 s30592 r0 d22656 u53248
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129948
Kernel command line: root=/dev/sda rw
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Initializing CPU#0
allocated 1048552 bytes of page_cgroup
please try 'cgroup_disable=memory' option if you don't want memory cgroups
Memory: 509692K/523888K available (4990K kernel code, 415K rwdata, 1928K rodata, 576K init, 452K bss, 14196K reserved)
virtual kernel memory layout:
fixmap : 0xfff16000 - 0xfffff000 ( 932 kB)
vmalloc : 0xe07fe000 - 0xfff14000 ( 503 MB)
lowmem : 0xc0000000 - 0xdfffe000 ( 511 MB)
.init : 0xc172b000 - 0xc17bb000 ( 576 kB)
.data : 0xc14dfc22 - 0xc172ae00 (2348 kB)
.text : 0xc1000000 - 0xc14dfc22 (4991 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
Preemptible hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
NR_IRQS:2304 nr_irqs:256 16
console [ttyS0] enabled
tsc: Fast TSC calibration using PIT
tsc: Detected 3092.840 MHz processor
Calibrating delay loop (skipped), value calculated using timer frequency.. 6185.68 BogoMIPS (lpj=12371360)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys blkio
Initializing cgroup subsys perf_event
mce: CPU supports 10 MCE banks
Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0
tlb_flushall_shift: 6
Freeing SMP alternatives memory: 24K (c17bb000 - c17c1000)
ACPI: Core revision 20130725
ACPI: All ACPI Tables successfully acquired
ftrace: allocating 25039 entries in 49 pages
Enabling APIC mode: Flat. Using 1 I/O APICs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
smpboot: CPU0: Intel QEMU Virtual CPU version 2.0.0 (fam: 06, model: 06, stepping: 03)
Performance Events: Broken PMU hardware detected, using software events only.
Failed to access perfctr msr (MSR c1 is 0)
Brought up 1 CPUs
smpboot: Total of 1 processors activated (6185.68 BogoMIPS)
devtmpfs: initialized
NET: Registered protocol family 16
cpuidle: using governor ladder
cpuidle: using governor menu
ACPI: bus type PCI registered
PCI: PCI BIOS revision 2.10 entry at 0xfd3c2, last bus=0
PCI: Using configuration type 1 for base access
pcimode=0x0
bio: create slab <bio-0> at 0
ACPI: Added _OSI(Module Device)
ACPI: Added _OSI(Processor Device)
ACPI: Added _OSI(3.0 _SCP Extensions)
ACPI: Added _OSI(Processor Aggregator Device)
ACPI: Interpreter enabled
ACPI: (supports S0 S5)
ACPI: Using IOAPIC for interrupt routing
PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug
ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
acpi PNP0A03:00: ACPI _OSC support notification failed, disabling PCIe ASPM
acpi PNP0A03:00: Unable to request _OSC control (_OSC support mask: 0x08)
acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [bus 00-ff]
pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
pci_bus 0000:00: root bus resource [mem 0x00000000-0xffffffff]
pci 0000:00:01.3: quirk: [io 0xb000-0xb03f] claimed by PIIX4 ACPI
pci 0000:00:01.3: quirk: [io 0xb100-0xb10f] claimed by PIIX4 SMB
ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
ACPI: Enabled 16 GPEs in block 00 to 0F
vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
vgaarb: loaded
vgaarb: bridge control possible 0000:00:02.0
SCSI subsystem initialized
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
PCI: Using ACPI for IRQ routing
NET: Registered protocol family 8
NET: Registered protocol family 20
HPET: 3 timers in total, 0 timers will be used for per-cpu timer
hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 100.000000 MHz counter
Switched to clocksource hpet
pnp: PnP ACPI init
ACPI: bus type PNP registered
pnp: PnP ACPI: found 8 devices
ACPI: bus type PNP unregistered
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
pci 0000:00:00.0: Limiting direct PCI/PCI transfers
pci 0000:00:01.0: PIIX3: Enabling Passive Release
pci 0000:00:01.0: Activating ISA DMA hang workarounds
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
NatSemi SCx200 Driver
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering unionfs 2.6 (for 3.12.26)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
Installing knfsd (copyright (C) 1996 okir#monad.swb.de).
NTFS driver 2.1.30 [Flags: R/W].
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.22)
msgmni has been set to 995
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 38, base_baud = 921600) is a 16550A
Linux agpgart interface v0.103
[drm] Initialized drm 1.1.0 20060810
SCSI Media Changer driver v0.25
physmap platform flash device: 08000000 at c0000000
physmap-flash physmap-flash.0: map_probe failed
Intel(R) SPI FLASH CONTROLLER Driver built on Mar 8 2017 # 15:45:49
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk#qualcomm.com>
Intel (R) UDMA Driver - 1.0.0
Copyright (c) 2012 Intel Corperation.
UDMA Network Device Driver init
e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
e1000: Copyright (c) 1999-2006 Intel Corporation.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 10
GBE working in Real Phy Mode
e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:04.0 eth1: (PCI:33MHz:32-bit) 52:54:00:12:34:57
e1000 0000:00:04.0 eth1: Intel(R) PRO/1000 Network Connection
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10
GBE working in Real Phy Mode
tsc: Refined TSC clocksource calibration: 3092.828 MHz
Switched to clocksource tsc
e1000 0000:00:05.0 eth2: (PCI:33MHz:32-bit) 52:54:00:12:34:58
e1000 0000:00:05.0 eth2: Intel(R) PRO/1000 Network Connection
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11
GBE working in Real Phy Mode
e1000 0000:00:06.0 eth3: (PCI:33MHz:32-bit) 52:54:00:12:34:59
e1000 0000:00:06.0 eth3: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:07.0 eth4: (PCI:33MHz:32-bit) 52:54:00:12:34:5a
e1000 0000:00:07.0 eth4: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:08.0 eth5: (PCI:33MHz:32-bit) 52:54:00:12:34:5b
e1000 0000:00:08.0 eth5: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:09.0 eth6: (PCI:33MHz:32-bit) 52:54:00:12:34:5c
e1000 0000:00:09.0 eth6: Intel(R) PRO/1000 Network Connection
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2013 Intel Corporation.
ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 3.15.1-k
ixgbe: Copyright (c) 1999-2013 Intel Corporation.
ixgb: Intel(R) PRO/10GbE Network Driver - version 1.0.135-k2-NAPI
ixgb: Copyright (c) 1999-2008 Intel Corporation.
PPP generic driver version 2.4.2
NET: Registered protocol family 24
i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mousedev: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2
rtc_cmos 00:00: RTC can wake from S4
rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
rtc_cmos 00:00: alarms up to one day, 114 bytes nvram, hpet irqs
softdog: Software Watchdog Timer: 0.08 initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
oprofile: using NMI interrupt.
IPv4 over IPSec tunneling driver
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
mip6: Mobile IPv6
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
8021q: 802.1Q VLAN Support v1.8
sctp: Hash tables configured (established 16384 bind 16384)
lib80211: common routines for IEEE802.11 drivers
Key type dns_resolver registered
Using IPI No-Shortcut mode
registered taskstats version 1
rtc_cmos 00:00: setting system clock to 2017-03-08 14:51:21 UTC (1488984681)
VFS: Cannot open root device "sda" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.17 #4
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
00000000 00000000 df45beec c14da955 df45bf34 df45bf04 c14da68e 00000000
df45bf34 fffffffa df75e000 df45bf60 c172bd4e c1605306 df45bf34 c16052b5
c1605282 c176906d df45bf34 fffffffa c16053a2 dffecbc0 00008000 6e6b6e75
Call Trace:
[<c14da955>] dump_stack+0x4b/0x7e
[<c14da68e>] panic+0x88/0x184
[<c172bd4e>] mount_block_root+0x17f/0x18f
[<c10e2a19>] ? SyS_mknod+0x1a/0x1c
[<c172be22>] mount_root+0xc4/0xce
[<c10e2b31>] ? SyS_unlink+0x15/0x17
[<c172bf3d>] prepare_namespace+0x111/0x142
[<c172ba87>] kernel_init_freeable+0x186/0x193
[<c14d7308>] kernel_init+0xd/0xb9
[<c14dea3b>] ret_from_kernel_thread+0x1b/0x30
[<c14d72fb>] ? rest_init+0x77/0x77
What is very weird is that I have the same version of OpenWRT system with a Linux 2.6.32 and it works well. Do I have additionnal kernel options to configure for linux 3.12.X for making it works with Qemu 2.0.0 ?
Thank you in advanced for your helps and comments.
There may be something wrong with your bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img file. Where did you get that file from?
Also, you're specifying a disk device as the root filesystem for the kernel (root=/dev/sda) . This is wrong. You're suppose to specify a partition not a disk device. So you probably meant to say "root=/dev/sda1". It's safer to specify a UUID instead of a partition name (e.g. root=UUID=3552064b-7e4d-4e3a-ae48-943b333267d9 ) in case your root partition isn't actually /dev/sda1.
You can extract the UUID for your virtual root partition by creating loopback devices from your disk image:
losetup -P /dev/loop1 bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img.
You should see new devices created called /dev/loop1p1 , /dev/loop1p2 , etc. Your virtual partition /dev/sda1 will be created as /dev/loop1p1, /dev/sda2 will be /dev/loop1p2 etc. You can then determine the UUID using parted or gparted on /dev/loop1
You may also need to specify something like "format=raw" in your qemu command, if the disk image is a raw disk image, or you may need to convert it first to a qcow2 image (qemu-image convert).

OpenWRT doesn't boot

I have a RT5350F router device (Hardware is almost the same as Nexx WT1520). It used to run Zyxel Keenetic 4G II firmware, and now I decided to reflash OpenWRT to it.
I tried a lot of versions, and all of them don't boot any further than this:
U-Boot 1.1.3 (Apr 11 2013 - 00:10:51)
Board: Ralink APSoC DRAM: 16 MB
relocate_code Pointer at: 80fb4000
spi_wait_nsec: 42
spi device id: c2 20 16 c2 20 (2016c220)
find flash: MX25L3205D
raspi_read: from:30000 len:1000
.*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 3.6.0.0
--------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: SDRAM
DRAM_SIZE: 128 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 16 MBytes
Flash component: SPI Flash
Date:Apr 11 2013 Time:00:10:51
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384
##### The CPU freq = 360 MHZ ####
estimate memory size =16 Mbytes
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP. 0
3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
. Image Name: MIPS OpenWrt Linux-3.18.45
Created: 2017-03-05 12:30:01 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1087633 Bytes = 1 MB
Load Address: 80000000
Entry Point: 80000000
raspi_read: from:50040 len:109891
................. Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 16
Starting kernel ...
[ 0.000000] Linux version 3.18.45 (wayfarer#VirtualBox) (gcc version 4.8.3 (O penWrt/Linaro GCC 4.8-2014.04 r49389) ) #3 Sun Mar 5 14:29:13 EET 2017
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is Nexx WT1520
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 # 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x00000000-0x01ffffff]
I reflashed U-boot as well, which didn't really help.
Some other OpenWRT firmwares boot, but crash right away, saying "Not enough RAM".

unexpected crash of embedded-linux on Zynq-Device (Zybo)

We have created, following the instruction on wiki-xilinx-linux web page, a system Zybo + embedded linux kernel (I want to remark that we didn't use PetaLinux but we have built all the file with the Xilinx tools).
When we turn on the system everything works fine and this is the output at the boot time:
U-Boot 2016.07-03720-g95e11f6-dirty (Oct 17 2016 - 02:56:48 -0700)
Model: Zynq ZYBO Development Board
Board: Xilinx Zynq
I2C: ready
DRAM: ECC disabled 512 MiB
MMC: sdhci#e0100000: 0
SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial#e0001000
Out: serial#e0001000
Err: serial#e0001000
Model: Zynq ZYBO Development Board
Board: Xilinx Zynq
Net: ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id
I2C EEPROM MAC address read failed
eth0: ethernet#e000b000
Hit any key to stop autoboot: 0
Device: sdhci#e0100000
Manufacturer ID: 3
OEM: 8368
Name: NCard
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
3843104 bytes read in 367 ms (10 MiB/s)
reading devicetree.dtb
10331 bytes read in 17 ms (592.8 KiB/s)
reading uramdisk.image.gz
5310018 bytes read in 504 ms (10 MiB/s)
## Booting kernel from Legacy Image at 02080000 ...
Image Name: Linux-4.6.0-xilinx-22285-g0e4e40
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3843040 Bytes = 3.7 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
Image Name:
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 5309954 Bytes = 5.1 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Loading Kernel Image ... OK
Loading Ramdisk to 1e601000, end 1eb11602 ... OK
Loading Device Tree to 1e5fb000, end 1e60085a ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.6.0-xilinx-22285-g0e4e407-dirty (leonardo#ubuntu) (gcc version 4.9.2 (Sourcery CodeBench Lite 2015.05-17) ) #1 SMP PREEMPT Mon Oct 17 03:54:44 PDT 2016
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: xlnx,zynq-7000
bootconsole [earlycon0] enabled
cma: Reserved 16 MiB at 0x1f000000
Memory policy: Data cache writealloc
percpu: Embedded 12 pages/cpu #debcc000 s19776 r8192 d21184 u49152
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=1
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 489332K/524288K available (5304K kernel code, 230K rwdata, 1844K rodata, 1024K init, 222K bss, 18572K reserved, 16384K cma-reserved, 0K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc07fb004 (8141 kB)
.init : 0xc0800000 - 0xc0900000 (1024 kB)
.data : 0xc0900000 - 0xc0939b60 ( 231 kB)
.bss : 0xc0939b60 - 0xc09714e8 ( 223 kB)
Preemptible hierarchical RCU implementation.
Build-time adjustment of leaf fanout to 32.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to e0800000
slcr mapped to e0802000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at e0802100
Zynq clock init
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4af477f6aa, max_idle_ns: 440795207830 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 551318127 ns
timer #0 at e080a000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 650.00 BogoMIPS (lpj=3250000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100058
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (1300.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB # 0xe0880000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 5188K (de601000 - deb12000)
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=28 max_order=17 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 143, base_baud = 6250000) is a xuartps
�console [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e086c000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
CAN device driver interface
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:35:00:01:22)
RTL8211E Gigabit Ethernet e000b000.etherne:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
ALSA device list:
mmc0: new high speed SDHC card at address b368
No soundcards found.
mmcblk0: mmc0:b368 NCard 3.72 GiB
mmcblk0: p1 p2
RAMDISK: gzip image found at block 0
EXT4-fs warning (device ram0): ext4_update_dynamic_rev:746: updating to rev 1 because of new feature flag, running e2fsck is recommended
EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 1:0.
Starting rcS...
++ Mounting filesystem
mount: mounting /dev/mmcblk0p1 on /mnt failed: No such file or directory
mount: mounting /dev/mmcblk0 on /mnt failed: No such file or directory
++ Setting up mdev
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting ssh daemon
random: sshd urandom read with 1 bits of entropy available
rcS Complete
zynq>
zynq>
zynq>
The problem is that, after some instructions, the system crash with this output:
zynq> EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
Trying to move old root to /initrd ... /initrd does not exist. Ignored.
Unmounting old root
Trying to free ramdisk memory ... failed
devtmpfs: error mounting -2
Unable to handle kernel NULL pointer dereference at virtual address 00000020
pgd = c0004000
[00000020] *pgd=00000000
Internal error: Oops - BUG: 17 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 10 Comm: migration/0 Not tainted 4.6.0-xilinx-22285-g0e4e407-dirty #1
Hardware name: Xilinx Zynq Platform
task: de060040 ti: de06a000 task.ti: de06a000
PC is at set_section_perms+0x8c/0x110
LR is at set_section_perms+0x18/0x110
pc : [<c0113404>] lr : [<c0113390>] psr: 80000093
sp : de06bec0 ip : dc4f3018 fp : 00000600
r10: 00000000 r9 : 00000000 r8 : 00000001
r7 : 00000003 r6 : c0902468 r5 : 00000000 r4 : c0908508
r3 : 00000000 r2 : c0000000 r1 : 00000003 r0 : 00000009
Flags: Nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
Control: 18c5387d Table: 1c4f804a DAC: 00000051
Process migration/0 (pid: 10, stack limit = 0xde06a210)
Stack: (0xde06bec0 to 0xde06c000)
bec0: c0908508 00000003 00000001 de0db780 de0db780 de0db998 00000003 c0908508
bee0: c09065c0 00000000 00000000 c01134f4 de04df70 00000001 a0000013 de04df84
bf00: 00000003 00000000 00000000 c011355c c011354c c017c420 de04df30 debccf64
bf20: de06a000 debccf68 00000000 c017c4f8 c017c478 de06a000 de02db40 c090cd94
bf40: 00000001 c0135454 de060040 de02d9c0 00000000 de02db40 c0135218 00000000
bf60: 00000000 c0132a40 4dff1176 00000001 00000000 de02db40 00000000 00030003
bf80: de06bf80 de06bf80 00000000 00000000 de06bf90 de06bf90 de06bfac de02d9c0
bfa0: c0132968 00000000 00000000 c0106ef8 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 dfefe0f2 77e519c8
[<c0113404>] (set_section_perms) from [<c01134f4>] (update_sections_early+0x6c/0xc4)
[<c01134f4>] (update_sections_early) from [<c011355c>] (__fix_kernmem_perms+0x10/0x1c)
[<c011355c>] (__fix_kernmem_perms) from [<c017c420>] (multi_cpu_stop+0xb0/0x108)
[<c017c420>] (multi_cpu_stop) from [<c017c4f8>] (cpu_stopper_thread+0x80/0xb0)
[<c017c4f8>] (cpu_stopper_thread) from [<c0135454>] (smpboot_thread_fn+0x23c/0x254)
[<c0135454>] (smpboot_thread_fn) from [<c0132a40>] (kthread+0xd8/0xec)
[<c0132a40>] (kthread) from [<c0106ef8>] (ret_from_fork+0x14/0x3c)
Code: e1520003 2a00001b e5943014 e1a0baa2 (e599a020)
---[ end trace 07a0838423ee7708 ]---
note: migration/0[10] exited with preempt_count 2
It is clear that there is an error with the "mounted filesystem":
zynq> EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
Trying to move old root to /initrd ... /initrd does not exist. Ignored.
Unmounting old root
Trying to free ramdisk memory ... failed
devtmpfs: error mounting -2
Why does this happen? Why before I can do everything with the system and, suddenly, I have a crash? Yes, the system crashes when I am doing nothing on it and not when I am working with it.
Are there some advice to solve this? to not to have anymore these crashes?
From the Linux Kernel Command line I can see "root=/dev/mmcblk0p2" and also the target is started with initial ramdisk image "uramdisk.image.gz". So the init process or scripts inside ramdisk image should be responsible to mount the real file system from SD i.e. from /dev/mmcblk0p2 and remove the used memory of ramdisk. To narrow down the problem, you need to analyze the steps taken in ramdisk image to mount the real filesystem and make sure you have the proper RFS flashed inside SD in /dev/mmcblk0p2. I can also seen some missing directories to mount the /dev/mmcblk0p1 and /dev/mmcblk0.
++ Mounting filesystem
mount: mounting /dev/mmcblk0p1 on /mnt failed: No such file or directory
mount: mounting /dev/mmcblk0 on /mnt failed: No such file or directory
In simple words, check the init scripts inside the ramdisk image and make sure the RFS is mounted properly.

Linux RHEL - Find disk type

I have Oracle Linux Server release 5.6 (Red Hat Enterprise Linux Server release 5.6) and I want to check if the disk type is SATA, SCSI, ATA or SAS or any other disk type.
I installed lshw (hardware lister) and executing "lshw -class storage" gives the below output
description: SCSI storage controller
product: 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
vendor: LSI Logic / Symbios Logic
physical id: 10
bus info: pci#0000:00:10.0
logical name: scsi0
version: 01
width: 64 bits
clock: 33MHz
capabilities: scsi bus_master rom scsi-host
configuration: driver=mptspi latency=64 maxlatency=255 mingnt=6
resources: irq:17 ioport:1400(size=256) memory:d8820000-d883ffff memory:d8800000-d881ffff memory:84008000-8400bfff(prefetchable)
Does this mean this is a SCSI disk type?
How do you find out if the disk type is SAS?
Thanks!

Resources