qemu启动zfs 映像(未解决)

根据FreeBSD的riscv wiki :riscv - FreeBSD Wiki进行 qemu的启动实践,发现例子中的文件无法下载,

fetch https://download.freebsd.org/snapshots/VM-IMAGES/15.0-CURRENT/riscv64/Latest/FreeBSD-15.0-CURRENT-riscv-riscv64.raw.xz

该文件FreeBSD-15.0-CURRENT-riscv-riscv64.raw.xz只有32个字节

在同一目录下,发现有 FreeBSD-15.0-CURRENT-riscv-riscv64-zfs.raw.xz 文件,但是这个文件启动的时候报错

qemu-system-riscv64 -machine virt -m 2048M -smp 2 -nographic -bios /usr/local/share/opensbi/lp64/generic/firmware/fw_jump.elf -kernel /usr/local/share/u-boot/u-boot-qemu-riscv64/u-boot.bin -drive file=FreeBSD-15.0-CURRENT-riscv-riscv64.raw,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0,ipv6=off,hostfwd=tcp::8022-:22 -device virtio-net-device,netdev=net0
 

Device 0: QEMU VirtIO Block Device
            Type: Hard Disk
            Capacity: 10240.0 MB = 10.0 GB (20971520 x 512)
... is now current device
** No partition table - virtio 0 **
Couldn't find partition virtio 0:1
scanning bus for devices...
 

查找资料,发现网上有个关于zfs盘的:

qemu-system-x86_64 -cdrom /path/to/freebsd14.iso -drive if=none,file=freebsd14.zfs,id=hd -device virtio-scsi-device,drive=hd -m 2048 -smp 2 -boot d

This command will install FreeBSD 14.0 on the ZFS-based disk using the provided ISO image. The -cdrom flag specifies the location of the ISO image, while the -drive and -device flags specify the ZFS-based disk and the virtio-scsi device, respectively.

根据这个,改写zfs的:

qemu-system-riscv64 -machine virt -m 2048M -smp 2 -nographic -bios /usr/local/share/opensbi/lp64/generic/firmware/fw_jump.elf -kernel /usr/local/share/u-boot/u-boot-qemu-riscv64/u-boot.bin -drive if=none,file=FreeBSD-15.0-CURRENT-riscv-riscv64.raw,format=raw,id=hd0 -device virtio-scsi-device,drive=hd0 -netdev user,id=net0,ipv6=off,hostfwd=tcp::8022-:22 -device virtio-net-device,netdev=net0

一直报错

qemu-system-riscv64: -device virtio-scsi-device,drive=hd: Property 'virtio-scsi-device.drive' not found
百度说:

解决方法通常包括以下几个步骤:

  1. 确认QEMU版本是否支持VirtIO SCSI设备。

  2. 确认virtio-scsi设备的属性是否正确配置。

  3. 查看QEMU的文档或错误日志,以获取更多关于属性错误的信息。

试试这个:

qemu-system-riscv64 -machine virt -m 2048M -smp 2 -nographic -bios /usr/local/share/opensbi/lp64/generic/firmware/fw_jump.elf -kernel /usr/local/share/u-boot/u-boot-qemu-riscv64/u-boot.bin -drive file=FreeBSD-15.0-CURRENT-riscv-riscv64.raw,format=raw,id=hd0 -device virtio-blk-device,scsi=on,drive=hd0 -netdev user,id=net0,ipv6=off,hostfwd=tcp::8022-:22 -device virtio-net-device,netdev=net0

virtio-blk,scsi=on

还是报错...

参考这个文档:

看看这篇文档:Running ZFS Disk on QEMU with Windows 11 and FreeBSD 14 as Guests

Creating a ZFS-based FreeBSD 14.0 Disk

To create a ZFS-based FreeBSD 14.0 disk, you will need to use the following command in the QEMU shell:

qemu-img create -f zfs freebsd14.zfs 10G

This command will create a new ZFS-based disk with a size of 10GB, which will be named freebsd14.zfs.

Configuring the Hyper-V Hypervisor

Next, you will need to configure the Hyper-V hypervisor to use the new ZFS-based FreeBSD 14.0 disk. To do this, you will need to use the Hyper-V Manager to create a new virtual machine and attach the ZFS-based disk to it.

Installing FreeBSD 14.0 on the ZFS-based Disk

Once the Hyper-V hypervisor has been configured to use the ZFS-based FreeBSD 14.0 disk, you can install FreeBSD 14.0 on the disk using the following command:

qemu-system-x86_64 -cdrom /path/to/freebsd14.iso -drive if=none,file=freebsd14.zfs,id=hd -device virtio-scsi-device,drive=hd -m 2048 -smp 2 -boot d

This command will install FreeBSD 14.0 on the ZFS-based disk using the provided ISO image. The -cdrom flag specifies the location of the ISO image, while the -drive and -device flags specify the ZFS-based disk and the virtio-scsi device, respectively.

Using the ZFS-based FreeBSD 14.0 Disk

Once FreeBSD 14.0 has been installed on the ZFS-based disk, you can use it as you would any other FreeBSD disk. This includes creating and managing ZFS file systems, as well as installing and running applications on the disk.

  • In this article, we have discussed the process of creating and running a ZFS-based FreeBSD 14.0 disk on QEMU in Windows 11 using the Hyper-V hypervisor.
  • We have covered the key concepts and provided detailed context on the topic, including subtitles, paragraphs, and code blocks as needed.
  • We have also provided a summary of the steps involved in creating and using the ZFS-based FreeBSD 14.0 disk.

参考这个

qemu-system-riscv64 -machine virt -smp 2 -m 2048 -nographic \-bios /usr/local/share/opensbi/lp64/generic/firmware/fw_jump.elf \-kernel /usr/local/share/u-boot/u-boot-qemu-riscv64/u-boot.bin \-drive file=/path/to/riscv.img,format=raw,id=hd0 \-device virtio-blk-device,drive=hd0
qemu-system-riscv64 -machine virt -smp 2 -m 2048 -nographic \-bios /usr/local/share/opensbi/lp64/generic/firmware/fw_jump.elf \-kernel /usr/local/share/u-boot/u-boot-qemu-riscv64/u-boot.bin \-drive file=FreeBSD-15.0-CURRENT-riscv-riscv64-zfs.raw,format=raw,id=hd0 \-device virtio-blk-device,drive=hd0

启动后报错:

32-083c-11ef-8a1b-0cc47ad8b808,0x21043a,0xa00000)
Setting currdev to disk0p3:
ERROR: cannot open /boot/lua/loader.lua: no such file or directory.
 

仔细看里面的内容,识别出来三块盘:

   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8500000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600850000000000)/HD(1,GPT,b2307226-083c-11ef-8a1b-0cc47ad8b808,0x22,0x10418)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8500000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600850000000000)/HD(1,GPT,b2307226-083c-11ef-8a1b-0cc47ad8b808,0x22,0x10418)
Setting currdev to disk0p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8500000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600850000000000)/HD(2,GPT,b230722e-083c-11ef-8a1b-0cc47ad8b808,0x1043a,0x200000)
Setting currdev to disk0p2:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000001000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,8500000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,1600850000000000)/HD(3,GPT,b2307232-083c-11ef-8a1b-0cc47ad8b808,0x21043a,0xa00000)
Setting currdev to disk0p3:
ERROR: cannot open /boot/lua/loader.lua: no such file or directory.
 

map-vdisk FreeBSD-15.0-CURRENT-riscv-riscv64-zfs.raw
 

使用lsdev命令看到盘了:

lsdev
disk devices:
    disk0:    20971520 X 512 blocks
      disk0p1: EFI
      disk0p2: FreeBSD swap
      disk0p3: FreeBSD ZFS
http: (unknown)
net devices:
 

该怎么挂载呢? chatgpt说:

es, you can operate and mount disk devices in the QEMU command line. In the provided example, the disk devices are listed as follows:

  • disk0: This is the main disk device with a size of 20971520 x 512 blocks.
    • disk0p1: This is the EFI partition.
    • disk0p2: This is the FreeBSD swap partition.
    • disk0p3: This is the FreeBSD ZFS partition.

To mount a disk device in QEMU, you can use the -drive option followed by the appropriate parameters. For example, to mount the disk0p3 partition, you can use the following command:CopyCopy

qemu-system-x86_64 -drive file=disk0p3,format=raw
Copy

This command tells QEMU to use the disk0p3 partition as a disk image file in raw format.Copy

Please note that the above command is just an example, and you may need to adjust it based on your specific setup and requirements. Additionally, ensure that you have the necessary permissions to access the disk devices and that your system's version of QEMU supports ZFS.

Let me know if you need further assistance!

发现还是不行,chatgpt并没有理解,我讲的是映像是zfs格式的,不是当前系统。

真不明白,别人就没碰到过zfs系统的吗? 

还是说别人都很顺利? 

未完待续

调试

执行qemu命令报错

qemu-system-riscv64: drive=hd0: drive with bus=0, unit=0 (index=0) exists
 

原来qemu的-device后面的内容,不能有空格,如:

-device virtio-scsi-device, drive=hd0 -netdev user,id=net0,ipv6=off,hostfwd=tcp::8022-:22 

这其中device, drive之间有个空格,就会报错 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/832543.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

git-新增业务代码分支

需求 使用git作为项目管理工具管理项目,我需要有两个分支,一个分支是日常的主分支,会频繁的推送和修改代码并推送另外一个是新的业务代码分支,是一个长期开发的功能,同时这个业务分支需要频繁的拉取主分支的代码&#…

Python_GUI框架 Pyside6的常用部件介绍

PySide6是一个非常完善的商用级别的GUI框架,涉及的知识点相对比较多,今天我先在这里介绍一下我们在实际应用中最常见的几种部件及其功能: 1. QMainWindow QMainWindow 提供了一个主应用程序窗口的框架,通常包含一个菜单栏、工具…

pytest教程-37-钩子函数-pytest_collection_finish

领取资料,咨询答疑,请➕wei: June__Go 上一小节我们学习了pytest_collection_start钩子函数的使用方法,本小节我们讲解一下pytest_collection_finish钩子函数的使用方法。 pytest_collection_finish(session) 是一个 pytest 钩子函数&…

03_Redis

文章目录 Redis介绍安装及使用redis的核心配置数据结构常用命令stringlistsethashzset(sortedset) 内存淘汰策略Redis的Java客户端JedisRedisson Redis 介绍 Redis是一个NoSQL数据库。 NoSQL: not only SQL。表示非关系型数据库(不支持SQL标准语法)。 …

Java特性之设计模式【享元模式】

一、享元模式 概述 享元模式(Flyweight Pattern)主要用于减少创建对象的数量,以减少内存占用和提高性能。这种类型的设计模式属于结构型模式,它提供了减少对象数量从而改善应用所需的对象结构的方式 享元模式尝试重用现有的同类对…

简述前后端分离架构案例

Hello , 这里是小恒不会java 。今晚1点写写关于RESTful接口的使用案例,本文会通过django原生js前后端分离的案例简单讲解。本文带你认识一下简化版的前后端分离架构 代码 本文案例代码在GitHub上 https://github.com/lmliheng/fontend前后端分离 先说说什么是前后…

GateWay检查接口耗时

添加gateway依赖 <dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-gateway</artifactId> </dependency>创建一个LogTimeGateWayFilterFactory类&#xff0c;可以不是这个名字但是后面必须是x…

【高校科研前沿】中国科学院地理资源所钟帅副研究员研究组博士生朱屹东为一作在Top期刊发文:从潜力到利用:探索西藏风能资源开发的技术路径优化布局

01 文章简介 论文名称&#xff1a;From potential to utilization: Exploring the optimal layout with the technical path of wind resource development in Tibet&#xff08;从潜力到利用:探索西藏风能资源开发的技术路径优化布局&#xff09; 文章发表期刊&#xff1a;《…

【Pytorch】2.TensorBoard的运用

什么是TensorBoard 是一个可视化和理解深度爵溪模型的工具。它可以通过显示模型结构、训练过程中的指标和图形化展示训练的效果来帮助用户更好地理解和调试他们的模型 TensorBoard的使用 安装tensorboard环境 在终端使用 conda install tensorboard通过anaconda安装 导入类Sum…

蛋白质/聚合物防污的机器学习(材料基因组计划)

前言&#xff1a;对于采用机器学习去研究聚合物的防污性能&#xff0c;以及或者其他性质。目前根据我的了解我认为最困难的点有三条&#xff1a; 其一&#xff1a;数据&#xff0c;对于将要训练的数据必须要有三点要求&#xff0c;1.数据要多&#xff0c;也就是大数据&#xff…

电子取证平航杯的复现

闻早起部分&#xff1a; 一、闻早起的windows10电脑 &#xff08;1&#xff09;.“闻早起”所使用的笔记本电脑使用何种加密程式&#xff1f; 1.在EFI文件中找到加密程式 &#xff08;2&#xff09; 教徒“闻早起”所使用的笔记本电脑中安装了一款还原软件&#xff0c;其版本…

寻找最佳App分发平台:小猪APP分发脱颖而出

在当今移动应用市场日益饱和的环境下&#xff0c;选择一个合适的App分发平台对于开发者来说至关重要。这不仅关系到应用能否快速触达目标用户&#xff0c;还直接影响到品牌的塑造与市场份额的争夺。本文将深入探讨几大关键因素&#xff0c;帮助开发者判断哪个App分发平台最适合…

Whisper、Voice Engine推出后,训练语音大模型的高质量数据去哪里找?

近期&#xff0c;OpenAI 在语音领域又带给我们惊喜&#xff0c;通过文本输入以及一段 15 秒的音频示例&#xff0c;可以生成既自然又与原声极为接近的语音。值得注意的是&#xff0c;即使是小模型&#xff0c;只需一个 15 秒的样本&#xff0c;也能创造出富有情感且逼真的声音。…

【driver4】锁,错误码,休眠唤醒,中断,虚拟内存,tasklet

文章目录 1.互斥锁和自旋锁选择&#xff1a;自旋锁&#xff08;开销少&#xff09;的自旋时间和被锁住的代码执行时间成正比关系2.linux错误码&#xff1a;64位系统内核空间最后一页地址为0xfffffffffffff000~0xffffffffffffffff&#xff0c;这段地址是被保留的&#xff0c;如果…

全球260多个国家的年通货膨胀率数据集(1960-2021年)

01、数据简介 全球年通货膨胀率是指全球范围内&#xff0c;在一年时间内&#xff0c;物价普遍上涨的比率。这种上涨可能是由于货币过度供应、需求过热、成本上升等原因导致的。通货膨胀率是衡量一个国家或地区经济状况和物价水平的重要指标&#xff0c;通常以消费者价格指数&a…

深度学习之DCGAN

目录 须知 转置卷积 DCGAN 什么是DCGAN 生成器代码 判别器代码 补充知识 LeakyReLU&#xff08;x&#xff09; torch.nn.Dropout torch.nn.Dropout2d DCGAN完整代码 运行结果 图形显示 须知 在讲解DCGAN之前我们首先要了解转置卷积和GAN 关于GAN在这片博客中已经很…

数据结构——链表专题2

文章目录 一、返回倒数第k 个节点二、链表的回文结构三、相交链表 一、返回倒数第k 个节点 原题链接&#xff1a;返回倒数第k 个节点 利用快慢指针的方法&#xff1a;先让fast走k步&#xff0c;然后fast和slow一起走&#xff0c;直到fast为空&#xff0c;最后slow指向的结点就…

BGP路由控制实验

1、按照需求配置IP地址&#xff0c;R1和R4配置环回口模拟业务网段&#xff0c;R2、R3、R4配置Loopback0口地址作为OSPF的Router-id和IBGP邻居地址。 2、AS 200 内部配置OSPF&#xff0c;仅用于实现BGP的TCP可达&#xff0c;不允许宣告业务网段。 3、配置BGP&#xff0c;R1和R…

数据结构学习/复习8--树与二叉树的概念与基本性质练习

一、树 1.概念 2.树的表示 二、二叉树 1.二叉树的概念 2.与性质相关的题

OpenHarmony实战开发-如何使用Web组件加载页面

页面加载是Web组件的基本功能。根据页面加载数据来源可以分为三种常用场景&#xff0c;包括加载网络页面、加载本地页面、加载HTML格式的富文本数据。 页面加载过程中&#xff0c;若涉及网络资源获取&#xff0c;需要配置ohos.permission.INTERNET网络访问权限。 加载网络页面…