linux - 挂载包含单个分区的镜像

标签 linux image mount

我使用以下命令从包含多个分区的磁盘制作了单个分区的镜像:

#ddrescue -d -r3 /dev/sdb3 sdb3.img sdb3.logfile

但是,当我尝试使用以下命令安装镜像时:

mount -o loop,ro sdb3.img /media/mymount

我收到以下错误消息:

Failed to read last sector (81919999): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
    or it was not setup correctly (e.g. by not using mdadm --build ...),
    or a wrong device is tried to be mounted,
    or the partition table is corrupt (partition is smaller than NTFS),
    or the NTFS boot sector is corrupt (NTFS size is not valid).

Failed to mount '/dev/loop0': Invalid argument
The device '/dev/loop0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

任何解决该问题的帮助都将不胜感激。

问候

最佳答案

要从镜像文件挂载分区,您可以使用 kpartx

要列出该工具在图像文件中检测到的映射:

kpartx -l sdb3.img

然后添加映射:

kpartx -a sdb3.img

分区将在/dev/mapper下显示为设备,然后可以正常挂载。

参见man kpartx和这个blog .

关于linux - 挂载包含单个分区的镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26712730/

相关文章:

android - 如何启动相机 Intent 并保存非压缩图片

python - 通过python在图像上编写复杂的自定义元数据

linux - Docker:安装/共享单个 sock 文件?

windows - 适用于 Windows 的 ksh ide?

未找到 PHP fatal error 类

javascript - 将图像存储在 Javascript 对象中

linux - 在 Linux 中使用 mount --bind 挂载文件夹。一个子文件夹出现为空

linux - 为什么我在 ubuntu 上安装的文件系统上得到不正确的时间戳?

linux - 检查 bash 中的正确列

python - 无法使用 python 和 pyserial 打开/dev/ttyusb0