1

I have an embedded system with an sd card that has an ext4 filesystem on it. I have a rootfs.squasfs that is placed in the ext4 filesystem and I am trying to boot to it. I built an initramfs where I can mount the sd card and then mount the squashfs. But I cannot switch_root to it. When I attempt exec switch_root /newroot /linuxrc I get a crash:

/ # mount
rootfs on / type rootfs (rw)
/dev/root.old on / type ext3 (rw,relatime,errors=continue,barrier=1,data=ordered)
/proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/mmcblk0p1 on /tmp type ext4 (rw,relatime,data=ordered)
/dev/loop0 on /newroot type squashfs (ro,relatime)

/ # exec switch_root /newroot /linuxrc
BusyBox v1.22.1 VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
0700          119920 loop0  (driver?)
b300         7634944 mmcblk0  driver: mmcblk
  b301          262144 mmcblk0p1 00000000-0000-0000-0000-000000000000
  b302          262144 mmcblk0p2 00000000-0000-0000-0000-000000000000
  b303         2202010 mmcblk0p3 00000000-0000-0000-0000-000000000000
b310            4096 mmcblk0boot1  (driver?)
b308            4096 mmcblk0boot0  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c000eab4>] (unwind_backtrace+0x0/0xfc) from [<c041b0d4>] (panic+0x94/0x1c0)
[<c041b0d4>] (panic+0x94/0x1c0) from [<c0592c9c>] (mount_block_root+0x194/0x224)
[<c0592c9c>] (mount_block_root+0x194/0x224) from [<c0592f20>] (mount_root+0x108/0x110)
[<c0592f20>] (mount_root+0x108/0x110) from [<c0593b6c>] (initrd_load+0x270/0x360)
[<c0593b6c>] (initrd_load+0x270/0x360) from [<c0593010>] (prepare_namespace+0xe8/0x1d8)
[<c0593010>] (prepare_namespace+0xe8/0x1d8) from [<c0592970>] (kernel_init+0x1b4/0x1bc)
[<c0592970>] (kernel_init+0x1b4/0x1bc) from [<c0009ccc>] (kernel_thread_exit+0x0/0x8)
(2015-04-07 17:27:21 CDT) multi-call binary.

Usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGS]

Can someone help me understand what I am doing wrong?

  • If I understood correctly, you have everything (I mean: rootfs and initramfs) in the SD card. I see the mount point of the ext4 from /dev/mmcblk0p1 in /tmp ... so I assume that is your SD card. Where is your /linuxrc and your /newroot? Are they supposed to be mounted? Are they separated partitions in your SD card? Oh, and check this other question out: unix.stackexchange.com/questions/5032/… – dave_alcarin Sep 30 '15 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.