标签:安装 exe 操作 auto localhost amd rbd undo str
使用kpartx挂载raw镜像使用ceph作为存储池,用户云主机win7系统故障,但有重要文件,需要复制出来。
以下是处理过程:
1、导出云主机文件raw,云主机ID为b05a71ce-e43d-4b02-a85d-8b8edb2820a2,存储中体验的文件是是compute中的b05a71ce-e43d-4b02-a85d-8b8edb2820a2_disk,导出为rjk.raw。
[root@localhost ~]#rbd export -p compute --image b05a71ce-e43d-4b02-a85d-8b8edb2820a2_disk /root/rjk.raw
[root@localhost ~]# cd /root/
[root@localhost ~]# ll
total 44535984
-rw-r--r-- 1 root root 42949672960 Feb 10 16:45 rjk.raw
2、使用kapartx 挂载文件
[root@localhost yum.repos.d]# yum install kpartx -y # kapartx 没安装,需用yum install 安装,过程略
[root@localhost ~]# losetup -f #查看哪个loop设备是空闲的
/dev/loop2 #/dev/loop2是空闲的
[root@localhost ~]# losetup /dev/loop2 rjk.raw
[root@localhost ~]# kpartx -av /dev/loop2 #把第一个分区挂载到空闭的loop2
add map loop2p1 (253:2): 0 204800 linear /dev/loop2 2048
add map loop2p2 (253:3): 0 83677184 linear /dev/loop2 206848
##显示有二个分区,第二个分区loop2p2是我们要挂载的win7系统目录
[root@localhost ~]# mkdir -p /media #创建一个目录,用于挂载/dev/loop2p2
[root@localhost ~]# mount /dev/mapper/loop2p2 /media #挂载
[root@localhost ~]# ll /media/
total 3145282
drwxrwxrwx 1 root root 4096 Dec 20 14:39 360极速浏览器下载
-rwxrwxrwx 1 root root 24 Jun 11 2009 autoexec.bat
drwxrwxrwx 1 root root 0 Jul 24 2017 BaiduYunDownload
-rwxrwxrwx 1 root root 10 Jun 11 2009 config.sys
lrwxrwxrwx 2 root root 60 Jul 14 2009 Documents and Settings -> /media/Users
-rwxrwxrwx 1 root root 307 Jul 18 2017 error.log
-rwxrwxrwx 1 root root 0 Jun 6 2016 IO.SYS
drwxrwxrwx 1 root root 0 Dec 19 16:28 KuGou
-rwxrwxrwx 1 root root 0 Jun 6 2016 MSDOS.SYS
-rwxrwxrwx 1 root root 3220692992 Jan 19 11:10 pagefile.sys
drwxrwxrwx 1 root root 0 Jul 14 2009 PerfLogs
drwxrwxrwx 1 root root 8192 Jan 15 14:01 ProgramData
drwxrwxrwx 1 root root 12288 Jan 15 11:59 Program Files
drwxrwxrwx 1 root root 0 Apr 15 2016 Recovery
drwxrwxrwx 1 root root 4096 May 24 2016 $Recycle.Bin
-rwxrwxrwx 2 root root 2289 Jan 19 18:03 servicestatus.txt
drwxrwxrwx 1 root root 4096 Jul 15 2016 System Volume Information
drwxrwxrwx 1 root root 4096 May 24 2016 Users
drwxrwxrwx 1 root root 4096 Jun 1 2016 VDownload
drwxrwxrwx 1 root root 24576 Jan 15 14:01 Windows
drwxrwxrwx 1 root root 4096 Jul 17 2017 我的共享文件夹
##已经可以看到raw镜像里面的文件了。
##可以用winscp拷文件了。
[root@localhost ~]# umount /media #结束后umount卸载操作
[root@localhost ~]# kpartx -dv /dev/mapper/loop2p2
标签:安装 exe 操作 auto localhost amd rbd undo str
原文地址:http://blog.51cto.com/fzhddn/2071081