如何在Linux上从包含多个分区的映像文件中挂载一个分区? [英] How to mount one partition from an image file that contains multiple partitions on Linux?

查看:126
本文介绍了如何在Linux上从包含多个分区的映像文件中挂载一个分区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该图像文件具有一个分区表,并且包含多个分区.

The image file has a partition table, and it contains multiple partitions.

可能有环回设备.

相关线程:

  • http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-01/7183.html
  • http://lists.gnu.org/archive/html/grub-devel/2005-01/msg00077.html
  • ftp://ftp.hq.nasa.gov/pub/ig/ccd/enhanced_loopback/

推荐答案

比方说,$ IMAGE设置为图像文件的路径. 您可以使用

Let's say $IMAGE is set to the path to your image file. You could write a small script by using

fdisk -u sectors -l $IMAGE

以获取图像内的分区列表.然后使用

to get a list of partitions inside the image. And then use a sequence of

mount -o ro,loop,offset=$OFFSET -t auto $IMAGE /media/$DEST

计算偏移量的位置意味着fdisk(起始扇区*扇区大小,以字节为单位)中的信息,而$ DEST是每个分区的唯一名称.

Where offset is calculated means the info from fdisk (start sector * size of a sector in bytes) and $DEST a unique name for each of the partitions.

这不是直接的解决方案,但我希望能很好地说明如何实现它.如果您一次完成工作,那么对于某些取证工具包来说,这是一个很小的好开始!

That's not directly the solution but I hope a pretty good indication on how to realize it. If you make the job once, you've some small nice beginning for some forensic toolkit!​​​​​​​​​​​​​​​​​​​​​

这篇关于如何在Linux上从包含多个分区的映像文件中挂载一个分区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆