我正在尝试使用以下命令在 QEMU 中运行 Linux 内核:qemu-system-x86_64 -m 4G -initrd initrd -kernel arch/x86_64/boot/bzImage -append "root=/dev/sda" Linux.raw
但当我运行它时,我看到这
答案1
有可能需要将附加内容更改为/dev/vda
。
在提示符下,您可以通过运行 blkid 或 lsblk 进行检查,它将显示根设备。
例如,在我的:
(initramfs) ls /dev/disk/by-uuid/21e3fd4e-278f-4e27-a3fa-abf88ed5156f
/dev/disk/by-uuid/21e3fd4e-278f-4e27-a3fa-abf88ed5156f
(initramfs) lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 128M 0 disk
vda 254:0 0 1G 0 disk
(initramfs) blkid
/dev/vda: UUID="21e3fd4e-278f-4e27-a3fa-abf88ed5156f" BLOCK_SIZE="4096" TYPE="ext2"
只是为了让它可谷歌,这是您看到的错误:
Gave up waiting for root file system device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/sda does not exist. Dropping to a shell!