[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

can't boot a Debian on QEMU-mips virtual machine, could be initrd or root device problems



Hi, I'm having trouble bootting Debian 9.4 on a QEMU-emulated MIPS
malta virtual machine. I know QEMU introduces some complexity, but I
think my problem is more of a misunderstanding of Linux boot concepts.
I've tried different permutations, and reading, but am stuck.

I installed Debian inside a virtual disk image. Here is the output of
"fdisk -lu" that shows the partition setup of this disk image. I think
it shows a valid and recognized first partition, as set up at
install-time.
$ fdisk -lu debian_mips32b.img
Disk debian_mips32b.img: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6c0f31a2

Device       Boot    Start      End  Sectors  Size Id Type
debian_mips32b.img1          2048 15992831 15990784  7.6G 83 Linux
debian_mips32b.img2      15994878 16775167   780290  381M  5 Extended
debian_mips32b.img5      15994880 16775167   780288  381M 82 Linux
swap / Solaris

Booting this doesn't work. If I supply the same Debian initrd image I
used to install, I see the installer language selection menu, not the
system. Despite the fact I don't attach a virtual CD-ROM install
media.

If I don't point qemu at the initrd RAM disk, the kernel seems to
start, but it has problems.
# qemu-system-mips -m 2048 -rtc base=localtime -boot order=c
-nographic -hda debian_mips32b.img -kernel vmlinux-4.9.0-6-4kc-malta
-append "root=/dev/sda1"

I've attached the console output, but note:
[    0.000000] Kernel command line: root=/dev/sda1 console=ttyS0,38400n8r

This suggests that the kernel has received my intention to look for
root on /dev/sda1. But then:

[    0.644281] List of all partitions:
[    0.644483] No filesystem could mount root, tried: [    0.644669]
[    0.644847] Kernel panic - not syncing: VFS: Unable to mount root
fs on unknown-block(0,0)

So two questions:

1.  Am I supposed to tell the virtual machine where to find the initrd
RAM disk, and do I use the same initrd downloaded from Debian as the
installer, or a different initrd from somewhere? The kernel seems to
go some way without this.

2.  It seems the kernel is somehow not recognizing the partition. I'm
not sure what the problem is here.

I'd appreciate any hints. Even confirming how things are supposed to
work helps. Thanks.

Alan
[    0.000000] Linux version 4.9.0-6-4kc-malta (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 Debian 4.9.82-1+deb9u3 (2018-03-02)
[    0.000000] earlycon: uart8250 at I/O port 0x3f8 (options '38400n8')
[    0.000000] bootconsole [uart8250] enabled
[    0.000000] Config serial console: console=ttyS0,38400n8r
[    0.000000] CPU0 revision is: 00019300 (MIPS 24Kc)
[    0.000000] FPU revision is: 00739300
[    0.000000] MIPS: machine is mti,malta
[    0.000000] Software DMA cache coherency enabled
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 10000000 @ 00000000 (usable)
[    0.000000]  memory: 6ffff000 @ 90000000 (usable)
[    0.000000] Kernel relocated by 0x00fd0000
 .text @ 0x810d0000
 .data @ 0x816a0c04
 .bss  @ 0x819e0000
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Reserving 0MB of memory at 0MB for crashkernel
[    0.000000] Primary instruction cache 2kB, VIPT, 2-way, linesize 16 bytes.
[    0.000000] Primary data cache 2kB, 2-way, VIPT, no aliases, linesize 16 bytes
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x0000000000ffffff]
[    0.000000]   Normal   [mem 0x0000000001000000-0x000000000fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line: root=/dev/sda1 console=ttyS0,38400n8r
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 248996K/262144K available (5946K kernel code, 576K rwdata, 1328K rodata, 1420K init, 284K bss, 13148K reserved, 0K cma-reserved)
[    0.000000] NR_IRQS:256
[    0.000000] CPU frequency 200.00 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112599307 ns
[    0.000149] sched_clock: 32 bits at 100MHz, resolution 9ns, wraps every 21474830331ns
[    0.006413] Console: colour dummy device 80x25
[    0.007713] Calibrating delay loop... [    0.058167] 844.80 BogoMIPS (lpj=1689600)
[    0.058380] pid_max: default: 32768 minimum: 301
[    0.059468] Security Framework initialized
[    0.059677] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.060638] AppArmor: AppArmor disabled by boot time parameter
[    0.061177] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.061438] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.072281] ftrace: allocating 18619 entries in 37 pages
[    0.103653] Performance counters: No available PMU.
[    0.117572] devtmpfs: initialized
[    0.122967] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.123427] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.127929] NET: Registered protocol family 16
[    0.140895] clocksource: pit: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1601818034827 ns
[    0.158532] vgaarb: loaded
[    0.159600] SCSI subsystem initialized
[    0.162245] PCI host bridge to bus 0000:00
[    0.162747] pci_bus 0000:00: root bus resource [mem 0x10000000-0x17ffffff]
[    0.163066] pci_bus 0000:00: root bus resource [io  0x1000-0x1fffff]
[    0.163372] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.163667] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.165386] pci 0000:00:00.0: [Firmware Bug]: reg 0x14: invalid BAR (can't size)
[    0.165677] pci 0000:00:00.0: [Firmware Bug]: reg 0x18: invalid BAR (can't size)
[    0.165947] pci 0000:00:00.0: [Firmware Bug]: reg 0x1c: invalid BAR (can't size)
[    0.166242] pci 0000:00:00.0: [Firmware Bug]: reg 0x20: invalid BAR (can't size)
[    0.166525] pci 0000:00:00.0: [Firmware Bug]: reg 0x24: invalid BAR (can't size)
[    0.169051] pci 0000:00:0a.1: legacy IDE quirk: reg 0x10: [io  0x01f0-0x01f7]
[    0.169334] pci 0000:00:0a.1: legacy IDE quirk: reg 0x14: [io  0x03f6]
[    0.169593] pci 0000:00:0a.1: legacy IDE quirk: reg 0x18: [io  0x0170-0x0177]
[    0.169870] pci 0000:00:0a.1: legacy IDE quirk: reg 0x1c: [io  0x0376]
[    0.171374] pci 0000:00:0a.3: quirk: [io  0x1000-0x103f] claimed by PIIX4 ACPI
[    0.171688] pci 0000:00:0a.3: quirk: [io  0x1100-0x110f] claimed by PIIX4 SMB
[    0.172892] vgaarb: device added: PCI:0000:00:12.0,decodes=io+mem,owns=none,locks=none
[    0.174668] pci 0000:00:12.0: BAR 0: assigned [mem 0x10000000-0x11ffffff pref]
[    0.175094] pci 0000:00:13.0: BAR 6: assigned [mem 0x12000000-0x1203ffff pref]
[    0.175409] pci 0000:00:13.0: BAR 0: assigned [mem 0x12040000-0x1205ffff]
[    0.175666] pci 0000:00:12.0: BAR 6: assigned [mem 0x12060000-0x1206ffff pref]
[    0.175929] pci 0000:00:12.0: BAR 1: assigned [mem 0x12070000-0x12070fff]
[    0.176211] pci 0000:00:13.0: BAR 1: assigned [io  0x1040-0x107f]
[    0.176451] pci 0000:00:0a.2: BAR 4: assigned [io  0x1080-0x109f]
[    0.176772] pci 0000:00:0a.1: BAR 4: assigned [io  0x10a0-0x10af]
[    0.183302] clocksource: Switched to clocksource MIPS
[    0.235800] VFS: Disk quotas dquot_6.6.0
[    0.236147] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.255729] NET: Registered protocol family 2
[    0.260358] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    0.260695] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.261020] TCP: Hash tables configured (established 2048 bind 2048)
[    0.261736] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.262040] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.263649] NET: Registered protocol family 1
[    0.264453] PCI: Enabling device 0000:00:0a.2 (0000 -> 0001)
[    0.274239] audit: initializing netlink subsys (disabled)
[    0.275135] audit: type=2000 audit(1525097654.255:1): initialized
[    0.277722] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.278351] zbud: loaded
[    0.296029] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.296826] io scheduler noop registered
[    0.297016] io scheduler deadline registered
[    0.297394] io scheduler cfq registered (default)
[    0.298474] PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
[    0.299845] cirrusfb 0000:00:12.0: Cirrus Logic chipset on PCI bus, RAM (4096 kB) at 0x10000000
[    0.540906] Console: switching to colour frame buffer device 80x30
[    0.560936] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.566936] console [ttyS0] disabled
[    0.590002] serial8250.0: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.591369] console [ttyS0] enabled
[    0.591369] console [ttyS0] enabled
[    0.591828] bootconsole [uart8250] disabled
[    0.591828] bootconsole [uart8250] disabled
[    0.614418] serial8250.0: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[    0.617914] mousedev: PS/2 mouse device common for all mice
[    0.620522] rtc_cmos 70.rtc: rtc core: registered rtc_cmos as rtc0
[    0.621302] rtc_cmos 70.rtc: alarms up to one day, 242 bytes nvram
[    0.622817] ledtrig-cpu: registered to indicate activity on CPUs
[    0.624028] NET: Registered protocol family 10
[    0.629716] mip6: Mobile IPv6
[    0.629934] NET: Registered protocol family 17
[    0.630237] mpls_gso: MPLS GSO support
[    0.631945] registered taskstats version 1
[    0.632682] zswap: loaded using pool lzo/zbud
[    0.635003] ima: No TPM chip found, activating TPM-bypass!
[    0.638034] rtc_cmos 70.rtc: setting system clock to 2018-04-30 14:14:16 UTC (1525097656)
[    0.644281] List of all partitions:
[    0.644483] No filesystem could mount root, tried: [    0.644669] 
[    0.644847] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.645259] Kernel relocated by 0x00fd0000
 .text @ 0x810d0000
 .data @ 0x816a0c04
 .bss  @ 0x819e0000
[    0.645839] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.051301] random: fast init done
[   53.319613] random: crng init done

Reply to: