Linux qemu-nbd mount qemu disk image
Linux qemu-nbd mount qemu disk image
deepin@deepin:~$
deepin@deepin:~$ qemu-nbd --help
Usage: qemu-nbd [OPTIONS] FILE
QEMU Disk Network Block Device Server -h, --help display this help and exit
-V, --version output version information and exit Connection properties:
-p, --port=PORT port to listen on (default `')
-b, --bind=IFACE interface to bind to (default `0.0.0.0')
-k, --socket=PATH path to the unix socket
(default '/var/lock/qemu-nbd-DEVICE')
-e, --shared=NUM device can be shared by NUM clients (default '')
-t, --persistent don't exit on the last connection
-v, --verbose display extra debugging information
-x, --export-name=NAME expose export by name
-D, --description=TEXT with -x, also export a human-readable description Exposing part of the image:
-o, --offset=OFFSET offset into the image
-P, --partition=NUM only expose partition NUM General purpose options:
--object type,id=ID,... define an object such as 'secret' for providing
passwords and/or encryption keys
-T, --trace [[enable=]<pattern>][,events=<file>][,file=<file>]
specify tracing options
--fork fork off the server process and exit the parent
once the server is running
Kernel NBD client support:
-c, --connect=DEV connect FILE to the local NBD device DEV
-d, --disconnect disconnect the specified device Block device options:
-f, --format=FORMAT set image format (raw, qcow2, ...)
-r, --read-only export read-only
-s, --snapshot use FILE as an external snapshot, create a temporary
file with backing_file=FILE, redirect the write to
the temporary one
-l, --load-snapshot=SNAPSHOT_PARAM
load an internal snapshot inside FILE and export it
as an read-only device, SNAPSHOT_PARAM format is
'snapshot.id=[ID],snapshot.name=[NAME]', or
'[ID_OR_NAME]'
-n, --nocache disable host cache
--cache=MODE set cache mode (none, writeback, ...)
--aio=MODE set AIO mode (native or threads)
--discard=MODE set discard mode (ignore, unmap)
--detect-zeroes=MODE set detect-zeroes mode (off, on, unmap)
--image-opts treat FILE as a full set of image options See <http://qemu.org/contribute/report-a-bug> for how to report bugs.
More information on the QEMU project at <http://qemu.org>.
deepin@deepin:~$
deepin@deepin:~$
deepin@deepin:~$ grep NBD /boot/config-4.4.102-deepin-server
CONFIG_BLK_DEV_NBD=m
deepin@deepin:~$
deepin@deepin:~$ modinfo nbd
filename: /lib/modules/4.4.-deepin-server/kernel/drivers/block/nbd.ko
license: GPL
description: Network Block Device
depends:
intree: Y
vermagic: 4.4.-deepin-server SMP mod_unload modversions aarch64
parm: nbds_max:number of network block devices to initialize (default: ) (int)
parm: max_part:number of partitions per device (default: ) (int)
deepin@deepin:~$
deepin@deepin:~$ sudo modprobe nbd max_part=16
deepin@deepin:~$
deepin@deepin:~$ sudo ls -al /dev/nbd*
brw-rw---- root disk , 2月 : /dev/nbd0
brw-rw---- root disk , 2月 : /dev/nbd1
brw-rw---- root disk , 2月 : /dev/nbd10
brw-rw---- root disk , 2月 : /dev/nbd11
brw-rw---- root disk , 2月 : /dev/nbd12
brw-rw---- root disk , 2月 : /dev/nbd13
brw-rw---- root disk , 2月 : /dev/nbd14
brw-rw---- root disk , 2月 : /dev/nbd15
brw-rw---- root disk , 2月 : /dev/nbd2
brw-rw---- root disk , 2月 : /dev/nbd3
brw-rw---- root disk , 2月 : /dev/nbd4
brw-rw---- root disk , 2月 : /dev/nbd5
brw-rw---- root disk , 2月 : /dev/nbd6
brw-rw---- root disk , 2月 : /dev/nbd7
brw-rw---- root disk , 2月 : /dev/nbd8
brw-rw---- root disk , 2月 : /dev/nbd9
deepin@deepin:~$
deepin@deepin:~$ sudo qemu-nbd --connect=/dev/nbd0 ./vans-kvm.qcow2 --nocache
deepin@deepin:~$ sudo fdisk -l /dev/nbd0
deepin@deepin:~$ sudo ls -l /dev/nbd0*
deepin@deepin:~$
deepin@deepin:~$ sudo mkdir -p /mnt/bsd_system
deepin@deepin:~$ sudo chmod 777 /mnt/bsd_system
deepin@deepin:~$ sudo mount -t ufs -o ro,ufstype=44bsd /dev/nbd0p5 /mnt/bsd_system
deepin@deepin:~$
deepin@deepin:~$ sudo mkdir -p /mnt/bsd_data
deepin@deepin:~$ sudo chmod 777 /mnt/bsd_data
deepin@deepin:~$ sudo mount -t ufs -o ro,ufstype=44bsd /dev/nbd0p7 /mnt/bsd_data
deepin@deepin:~$
deepin@deepin:~$ sudo mkdir -p /mnt/fat_dos
deepin@deepin:~$ sudo chmod 777 /mnt/fat_dos
deepin@deepin:~$ sudo mount -t vfat -o ro,umask=000,noatime,async,codepage=936,iocharset=gb2312 /dev/nbd0p2 /mnt/fat_dos
deepin@deepin:~$
deepin@deepin:~$ sudo umount /mnt/bsd_system
deepin@deepin:~$ sudo umount /mnt/bsd_data
deepin@deepin:~$ sudo umount /mnt/fat_dos
deepin@deepin:~$ sudo qemu-nbd --disconnect /dev/nbd0
deepin@deepin:~$
============ End
Linux qemu-nbd mount qemu disk image的更多相关文章
- Linux下编译安装qemu和libvirt
目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 2 安装libvirt 2.1 libvirt介绍 2.2 下载libvirt 2.3 编译安装 3 ...
- Linux mount BSD disk partition
Linux mount BSD disk partition 来源 https://www.cnblogs.com/jhcelue/p/6858159.html 假设须要从第二块硬盘复制文件.该硬盘格 ...
- Linux下编译安装qemu和libvirt【转】
转自:http://www.cnblogs.com/findumars/p/5679742.html 目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 ...
- 编译aarch64 Linux内核并基于qemu运行
核心流程 首先,本文主要讲述如何编译Linux内核并在qemu虚拟机上运行.这里针对的架构是aarch64. 本文的实验平台是Ubuntu 16.04. 为了达成目标,我们需要有qemu.buildr ...
- Redhat linux 挂载命令mount
命令格式: mount [-t vfstype] [-o options] device dir 其中: 1.-t vfstype 指定文件系统的类型,通常不必指定.mount 会自动选择正确的类型. ...
- linux下的mount命令的用法详解
挂接命令(mount) 首先,介绍一下挂接(mount)命令的使用方法,mount命令参数非常多,这里主要讲一下今天我们要用到的. 命令格式:mount [-t vfstype] [-o option ...
- MOUNT MACBOOK DISK (OSX / HFS+) ON UBUNTU 12.04 LTS WITH READ/WRITE
MOUNT MACBOOK DISK (OSX / HFS+) ON UBUNTU 12.04 LTS WITH READ/WRITE So you want to mount your HFS+ ( ...
- 【转】linux文件系统之mount流程分析
本质上,Ext3 mount的过程实际上是inode被替代的过程. 例如,/dev/sdb块设备被mount到/mnt/alan目录.命令:mount -t ext3 /dev/sdb /mnt/al ...
- 【转载】linux下的mount命令详解;
以下内容来自:http://blog.csdn.net/clozxy/article/details/5299054 http://linux.chinaunix.net/techdoc/system ...
随机推荐
- Contest1692 - 2019寒假集训第三十一场 UPC 11075 Problem D 小P的国际象棋
非常简单的单点修改+区间加+区间查询.我用的是最近刚学的区间修改版本树状数组. 直接维护即可,注意修改后的单点值已经不是a[i],或者b[i],要通过区间查询求单点.不然是错的. 区间修改版本树状数 ...
- UITableView加载数据,没有数据,没有网络界面处理
https://blog.csdn.net/chmod_r_755/article/details/53231461 俗话说的好,傻逼的APP都是相似的,牛逼的APP各有各的牛逼...但是UITabl ...
- 福州大学软件工程1816 | W班 第7次作业成绩排名
写在前面 汇总成绩排名链接 1.作业链接 第七次作业--项目需求分析(团队) 2.评分准则 本次作业映射总分为100分+贡献度得分,由以下部分组成: 引言(5 points) . 用户场景(15 po ...
- Vector源码分析
Vector与ArrayList底层实现基本类似,底层都是用数组实现的,最大的不同是Vector是线程安全的.ArrayList源码分析请参考ArrayList源码分析 一.源码分析 基于jdk1.7 ...
- CodeIgniter框架中尝试使用swoole
ci框架版本:3.1.7. swoole版本:1.7. php版本:5.6 相关文档: 以cli方式运行ci框架 swoole官方手册 创建一个TestSwoole和Hello控制器 ...
- 6 Prefer and Would rather
1 prefer 使用 "prefer" 用来表明通常喜欢某件事甚于另一件事.说话者喜欢打高尔夫球更甚于喜欢打网球."prefer" 的后面可以接名词(&quo ...
- ArrayList性能短板深入分析
ArrayList的数据结构主体是Object[]数组,数组对象在内存的位置是成块成块的. 1.对数组进行非尾部修改,会引发System.arrayCopy()行为.这就需要对后半部要移动的对象进行内 ...
- IntelliJ IDEA启动Tomcat后,却无法访问Tomcat主页 等一系列问题
1.IntelliJ IDEA启动Tomcat后,却无法访问Tomcat主页 转:http://www.myexception.cn/other/1998827.html https://blog.c ...
- kubernetes资源类别介绍
类别 名称 资源对象 Pod.ReplicaSet.ReplicationController.Deployment.StatefulSet.DaemonSet.Job.CronJob.Horizon ...
- JavaSE从入门到精通
1.JavaSE的安装 windows下安装完成后,配置环境变量如下: JAVA_HOME C:\Program Files (x86)\Java\jdk1.8.0_91 CLASSP ...